Proof of length contraction I am trying to prove relativistic length contraction using the following thought experiment however it does not work out. Please explain where I have gone wrong rather than directing me towards a different proof as I'd like to understand why this one in particular doesn't work. Also note that b is $\frac{v}{c}$ and $g$ is the lorentz factor.
A Light ray travels along a train of length $L$ from the point of view of the passenger. The train travels at velocity $v$ relative to an outside observer in the same direction as the light ray.
Consider the point of view of the passenger:
  Distance traveled by the ray: $L$
  Time the ray takes to travel: $t$
  Speed of the ray: $c= \frac{L}{t}$
Consider the point of view of the observer:
  Distance traveled by the ray: $L' + t'v$ 
  Time the ray takes to travel: $t'$ 
  Speed of the ray: $c = \frac{L'+t'v}{t'} = \frac{L'}{t'}+ v$ 
Equation summary:
  (1) $ c = \frac{L}{t}→ t=\frac{L}{c}$ 
  (2)  $c = \frac{L'}{t'} + v$ 
  (3)  $t' = gt$ 
Math:
  equate (1) and (2):
   $ \frac{L}{t}= \frac{L'}{t'} + v $ 
  substituting in (3):
    $\frac{L}{t}= \frac{L'}{gt}+ v$  
  simplify:
    $L = \frac{L'}{g}+ tv$
  sub in (1)
   $ L = \frac{L'}{g} + \frac{Lv}{c}$
   $ L = \frac{L'}{g} + Lb$
   $ L -Lb = \frac{L'}{g}$
   $ L (1-b) =\frac{ L'}{g}$ (This is wrong)
 A: Let's make it a bit clear what we are measuring. Let's assume that at time zero the rear of the train is just passing the observer standing by the track, so the situation looks like this:

$S$ is the frame of the observer sitting in the train. In this frame the train is stationary and the light is emitted at the point $(0,0)$ so it starts at the back of the train, travels a distance $\ell$ in a time $t$ and arrives at the front of the train. The time $t$ is just $t=\ell/c$ so we get your first equation:
$$ c = \frac{\ell}{t} $$
$S'$ is the frame of the observer standing by the track. In this frame the light ray is also emitted at the point $(0,0)$ but this time is has to travel the (contracted) length of the train $t'$ plus the extra distance the front of the train has moved $vt'$. This gives us your second equation:
$$ c = \frac{\ell' + vt'}{t'} $$
And you are quite correct that the speed of light is the same in both frames so we can equate these to get:
$$ \frac{l}{t} = \frac{\ell' + vt'}{t'} $$
Your problem is that you cannot assume $t' = \gamma t$. To get the value of $t'$ you need to use the Lorentz transformations:
$$ t' = \gamma \left(t - \frac{vx}{c^2}\right) $$
The equation $t' = \gamma t$ applies only when $x=0$, which is not the case here.
Beginners in SR are prone to casually throwing factors of $\gamma$ around, but this is a dangerous strategy unless you know what you are doing. The only safe way to analyse problems like this is to first identify the spacetime points of interest then use the Lorentz transformations to transform them into the other frame. Trying to shortcut this is likely to lead to problems, as indeed you've found in this case.
Incidentally Lorentz contraction is not as simple as beginners usually believe, and deriving the (simplified) equation for it is a bit involved. Have a look at my answer to “Reality” of length contraction in SR for more on this.
A: Even though you where not looking for another way to solve this problem, and your question has already been answered years ago, I'm still going to add the solution I found, as I struggled at the exact same point you did, couldn't find any simple proof to length contraction, and kept ending up on this page. I hope this will help the next person blocked here.
The next steps will assume you already proved time dilation (you can find the equations really easily using the Pythagorean Theorem). The equations you get are :
$$\gamma = \frac{1}{\sqrt{1 - (\frac{v}{c})^2}}$$
$$t' = \gamma t$$
Using the classical example of a spaceship, $t$ is duration of an event inside the spaceship, and $t'$ is the apparent duration of the event to an external observer watching the spaceship move. The consequence is always that $t' \geq t$ : time dilation.
Now, you might already have heard about the muon thing. Muons are very short lived particles, and when they are created in the upper layers of the atmosphere, even though they approach the speed of light, they should decay before touching the ground. But, we still detect many of them. The explanation is the following :

*

*From our point of view, because the muons are going near the speed of light, relativistic effects must be taken into account, and because of time dilation, the clock of the muon seems to be ticking slower from our point of view. Because the clock is ticking slower, the muons have enough time to reach the ground.


*From the point of view of the muon, his own time is flowing at the usal rate, so it is still very short lived, but the Earth seems to be coming in its direction close to the speed of light. So the Earth appears contracted in the direction of the movement. Because of this, the atmosphere seems way thinner, and the muons can pass through it quickly enough.
This shows that length contraction is time dilation, from a shifted perspective. If we apply the example above, we get :
$$v = \frac{l_0}{t'}$$
$$v = \frac{l}{t}$$
With $v$ the speed of the muon from the point of view of the earth (which is the same as the speed of the earth from the point of view of the muon), $l_0$ the width at rest of the atmosphere, $t'$ the apparent lifetime of the muon, $l$ the apparent width of the atmosphere (from the point of view of the muon), and $t$ the lifetime of the muon. We get :
$$\frac{l}{t} = \frac{l_0}{t'}$$
$$\frac{l}{t} = \frac{l_0}{\gamma t}$$
$$l = \frac{l_0}{\gamma}$$
And we get length contraction : when something moves relative to us, its length seems shorter in the direction of movement.
Just a quick note : The goal here was just to show where the formulas come from, but using Lorentz's transformations directly is probably the safest way to solve a problem.
