While trying to understand special relativity, i came across the following explanation several times: Imagine a train moving at c/4 from left to right. If a person A, inside the train standing near the back of the train, flashes a light, the light is supposed to travel in the direction of the train's motion (to the right) with a speed of c with respect to person A. But in this case, a person B looking at it from outside should observe light to move at a speed of c+c/4=5c/4 with respect to his frame. This cannot happen since all observers should measure the speed of light to be c. Therefore, the time inside the train must be slower than the time of person B. This will ensure that if person A observes light to move at c towards the front of the train, then person B will observe time going slower in the train and will observe light moving at 3c/4 with respect to the train. So person B will observe light to move at 3c/4+c/4=c with respect to his frame of reference. Thus both of the observers will observe the same speed of light. The explanation is fine but I started wondering about the following case: If you take into account a person C standing at the front of the train and flashing a light towards the back of the train, he too must observe the light to travel at c. If this should be the case then person B should observe it as c-c/4=3c/4 with respect ot his frame. But since time has slowed down in the moving train, B will observe the light from person C's flashlight moving at 3c/4 with respect to train. Therefore, person B should observe light to move at 3c/4-c/4=c/2 with respect to his own frame. Now again, there is a change in speed of light observed. The explanation mentioned above satisfies one case (light moving in direction of motion) but fails to explain how time dilation accounts for same speed of light in opposite direction. The same happens with length contraction also. How is this possible? Time dilation and length contraction are supposed to ensure that light moves at c in whichever direction meassured. Please help me out with this dilemma.