When the train overtakes the man running in the same direction, the relative speed is the length of the train divided by the time taken, yielding 100 m divided by 10 s = 10 m/s. Since the actual speed of the train is 15 m/s, the speed of the man is 15 m/s minus 10 m/s, which equals 5 m/s. If the man runs in the opposite direction, their relative speed becomes the sum of their speeds, giving 15 m/s + 5 m/s = 20 m/s. The time taken to cross the man is the length of the train divided by this new relative speed, resulting in 100 m divided by 20 m/s, which is 5 s.