Thought experiments applying from newons thought experiments on frame of references A train is travelling towards a tunnel at relativistic velocity. The tunnel has two gates on either side that open/close to admit/reject the train. The train is the same length as the tunnel when it at rest in the tunnel's frame of reference. In the tunnel frame, the train is moving so it is contracted and can fully fit inside the tunnel. Thus, the gates are initially closed, open right before the train enters, close while the train is completely inside the tunnel, open right before the train leaves and closes right after the train has completely left. 
How would you describe this sequence of events in the frame of reference of the train??
 A: You have set up the pole-and-barn paradox problem correctly, but you forgot one important detail, which helps to clarify the situation. To recap:


*

*In the tunnel frame, the train is length contracted and can easily fit in the tunnel.

*In the train frame, the tunnel is length contracted and cannot fit in the tunnel.

*In the tunnel frame, the doors open/close simultaneously.
However, if the tunnel observer sees the train pass through without hitting the doors, that must be true - either it hit the doors, or it didn't. So the only other option is the events (doors opening and closing) are not simultaneous in the train's frame of reference. The train observer sees the back door open, then the front door open, with sufficient time between those events such that the train can pass through the tunnel. Then, the back door closes, and the front door closes once the train has left.
There's a great video about it here.
Also, in case you're wondering, the mathematics of Lorentz contraction are determined by
$$ L' = L\sqrt{1-\frac{v^2}{c^2}}, $$
where $L$ is the rest length and $L'$ is contracted length. Since in this case, the reference frames are effectively arbitrary, both the tunnel and train frames have equally correct observations.
A: The paradox is resolved because two clocks, each in a different reference frame, measure time at different rates relative to each other, depending on the relative velocities of each reference frame.
For example, if a 50-meter-long train (as measured at rest in the tunnel) travels at 250K meters per second relative to the stationary 50-meter tunnel, then to an observer in the tunnel frame, the train's length would appear to be 50 * sqrt(1-(250K^2 / c^2)) =  27.6 meters, and a 50-meter tunnel would accommodate the train as it passes between simultaneously opening and closing doors.
But to an observer on the train, it would appear that the tunnel rushes past at 250 meters per second, and he would expect that his 50-meter train would not fit into a 27.6-meter tunnel.  The doors would be unable to open and close simultaneously without smashing the train.  Both observers are making valid observations in their own reference frames.
The key to resolving the paradox may be to visualize that travel time can be a measure of distance, and distance travelled can be a measure of time.  In order for the on-board observer and the tunnel observer to agree that the train has passed through the tunnel without smashing into the doors, time measured in the train reference frame must differ from time measured in the tunnel reference frame.  From the viewpoint of the on-board observer, the tunnel doors do not open and close simultaneously.  This provides time for the rear of the train to enter the tunnel after the front of the train has exited the tunnel.  But to the tunnel observer, the doors do open and close simultaneously.  Both observers make valid and accurate observations, the train does not smash into the doors, and time is the parameter that absorbs and reconciles the paradox.
A: This is Ladder paradox and can be simply resolved, see Wikipedia ladder paradox
