Let the distance between the cars when they come to rest be \( d \). Each car has an initial speed of 20 m/s. The deceleration \( a \) is \(-2 \, \text{m/s}^2\).
Using the equation of motion:
\( v^2 = u^2 + 2ad, \)
where \( v = 0 \) (final speed), \( u = 20 \, \text{m/s} \) (initial speed), and \( a = -2 \, \text{m/s}^2 \), we get:
\( 0 = 20^2 + 2(-2)d \quad \Rightarrow \quad 0 = 400 - 4d \quad \Rightarrow \quad d = 100 \, \text{m}. \)
Since the two cars are moving towards each other, the total distance covered by both cars is \( 100 + 100 = 200 \, \text{m} \), so the distance between them when they come to rest is 100 m.