We can calculate the maximum compression of the spring using the conservation of mechanical energy. The kinetic energy of the car at the moment of collision is converted into the potential energy stored in the spring:
\[
KE = PE
\]
The kinetic energy of the car is:
\[
KE = \frac{1}{2} m v^2
\]
Where:
- \( m = 1000 \, \text{kg} \) is the mass of the car,
- \( v = 10 \, \text{m/s} \) is the velocity of the car.
Substitute the values:
\[
KE = \frac{1}{2} \times 1000 \times 10^2 = 50000 \, \text{J}
\]
The potential energy stored in the spring at maximum compression is given by:
\[
PE = \frac{1}{2} k x^2
\]
Where:
- \( k = 4000 \, \text{N/m} \) is the spring constant,
- \( x \) is the maximum compression of the spring.
Equating the kinetic energy to the potential energy:
\[
50000 = \frac{1}{2} \times 4000 \times x^2
\]
Solving for \( x \):
\[
50000 = 2000 x^2 \quad \Rightarrow \quad x^2 = \frac{50000}{2000} = 25 \quad \Rightarrow \quad x = 5 \, \text{m}
\]
Thus, the maximum compression of the spring is \( \boxed{5 \, \text{m}} \).