We want to find how much time will pass before the two cars collide. By using one as a frame of reference, we will see that 8 seconds elapse before the two cars collide.
The frame of reference is the point where the observer is at. For example, if we define one of the cars as a frame of reference, we will see that the selected car does not move (because we move with it, so we can't notice the movement).
Then the velocity of the selected car is "passed on" to the other car.
This means that if we select car A as our frame of reference, which moves at 30 m/s, then we will see that car A does not move, while car B moves with a speed of:
S = 20m/s + 30m/s = 50m/s
The velocities are added because the two cars move in opposite directions (So car A sees that car B comes faster than it actually does).
Now that we are on this frame of reference, we just need to see how long will take car B to travel 400 meters when it moves at 50 m/s
So we need to solve:
Distance/speed = time
With:
(400m)/( 50 m/s) = 8s
This means that 8 seconds elapse before the two cars collide.
If you want to learn more about frames of reference, you can read:
https://brainly.com/question/17548508