Station X of length 900 meters has two station masters A and B. But as the station is not a busy one, they are mostly jobless and decide to conduct an experiment. They stand at either end of the station and decide to note the exact time when trains cross the station masters. They synchronize their watches and proceed to either end of the station. Two trains P and Q go past the station (neither train stops here), and after having taken down their readings, the station masters sit down to have a chat.
A: Train P entered the station at exactly 8:00:00
B: Train Q entered the station at exactly 8:00:10 (10 seconds past 8)
A: The last carriage of train P crossed me by at 8:00:20, and precisely two seconds after this, the engines of the two trains went past each other. (Engines are at the front of the train)
B: The last carriage of train Q crossed me 22 seconds after the engine of P went past me.
A: After the last carriage of train P crossed by me, it took 35 seconds for the engine of train Q to cross me.
B: I got bored and I came here.
Now, let us try to jot down the points in a slightly different format and see if we can make any inferences. Let us assume speed of train P = p, speed of train Q = q, length of train P = L, length of train Q = M
Take statements 1 and 3
Train P crosses the stationmaster A entirely in 20 seconds (enters station at 8:00:00 and last carriage passes at 8:00:20) => Length of train = 20p => L = 20p
Statement 5 tells us that engine of train Q crosses station master A at 8:00:55. Train Q enters the station at 8:00:10, so the train takes 45 seconds to cross the entire station. Or, it takes 45 seconds to travel 900 meters => Speed to train Q, q = 20m/s.
Statement 3 tells us that the two trains cross each other at 8:00:22. This implies train P has traveled for 22 seconds since entering the station and train Q has traveled for 12 seconds since entering the station before they cross each other. The cumulative distance traveled by the two trains should be equal to the length of the station = 900m.
=> 900 = 22p + 12qSo, train P takes = 30 seconds to cross the station. So, engine of train P will cross stationmaster B at 8:00:30.
Statement 4 states that the last carriage of Q went past 22 seconds after the engine of P went by. Or, the last carriage of Q went by at 8:00:52.
Engine of train Q went by at 8:00:10, last carriage went by at 8:00:52, or train Q took 42 seconds to cross station master B. Train Q travels at 20m/s.
=> Length of train Q = 840m