Special relativity: where does this naive calculation go wrong? Inspired by the recent question, "If all motion is relative, how does light have a finite speed?", I tried to work out a little calculation. Where does it go wrong?
My friend Buzz is traveling in a spaceship at $c/2$, relative to me. A beam (or say, particle) of light going in the same direction enters his rear window, and exits through the front: the distance is $3\ \text m$. Buzz notes these events and finds that about $10\ \text{ns}$ elapsed which of course confirms the speed of light in his frame of reference to be around $3\times 10^8\ \text m/\text s$, as expected.
Now relative to me, both Buzz's time and the length of Buzz's craft are distorted by the Lorentz factor, which is $\sqrt{1 - 0.5^2}$ or about $1.154$.  So:


*

*When Buzz makes his $10\ \text{ns}$ observation, that looks to me like $11.54\ \text{ns}$ have elapsed due to time dilation.

*In $11.5\ \text{ns}$, Buzz, moving at $c/2$, travels $(11.54\times 10^{-9})(1.5\times 10^8) \approx 1.73\ \text m$

*Buzz's ship is shortened by the same $1.154$ factor, and so from my perspective, the $3 \ \text m$ distance from the rear to the front window is shortened to about $2.60\ \text m$.

*Thus, in $11.54$ nanoseconds, Buzz's craft moves $1.73$ meters, and in that time, a particle of light travels from the rear to the front, which is $2.60$ meters. The total distance traveled by the light between the two intersection events should be $1.73 + 2.60 = 4.33\ \text m$.


See the problem? 4.33 meters in 11.5 nanoseconds doesn't correspond to $c$. In that much time, light can travel only $3.45\ \text m$.

So application of Bill N's answer: we have to take into account the change of position when measuring time, and vice versa, and not use the special-case dilation/contraction formula.
Buzz observes two events at different times. To translate his 10 ns into our inertial frame of reference we must first add $d{v/{c^2}}$: where $d$ is the distance from back to front, 3 m.   This works out to 5 ns, giving us 15 ns. This is the value which we must then dilate by the 1.154 factor to obtain 17.3 ns.
In the inertial frame of reference, 17.3 ns is precisely the time that light needs to cover two relativity-contracted ship lengths: $2.6 \times 2 = 5.2\ \text m$.  The ship is 2.6 m long. Traveling at $c/2$, it moves 2.6 m in 17.3 ns. And so, in that time, the front window is 5.2 m farther down than the starting position of the back window. By golly, that is the distance covered by light moving at $c$ in 17.3 ns.
This is just like a bird flying at 100 km/h needing two car lengths of ground distance to pass a 50 km/h car from bumper to bumper. Light at $c$ needs two (contracted) ship lengths to pass the ship moving at $c/2$.
Neglecting the $d{v/{c^2}}$ term is an obvious mistake in retrospect, because without this term, it wouldn't  matter in which direction the light pulse traverses the ship: front to back or back to front, which doesn't make sense. From Buzz's point of view, of course, it doesn't matter: it's 10 ns either way. But from the stationary frame, it makes a huge difference. A pulse of light going opposite to the ship traverses only 1.73 m from back to front, rather than 5.2 m, and this takes only 5.8 ns.
 A: Let's look at this in terms of events in the Buzz's S frame and your S' frame. Let S' be moving in the negative-$x$ direction at $|\beta|=0.5$. That means that $\gamma$= 1.1547. So far, so good. The Lorentz transformation matrix from S to S' will be
$$\mathcal{L}=\begin{bmatrix}\gamma &\gamma\beta \\ \gamma\beta& \gamma\end{bmatrix}=\begin{bmatrix}1.1547 &0.5774 \\0.5774& 1.1574\end{bmatrix}.$$
The two events in S are the light pulse entering the rear window (t=0,x=0) and the light pulse leaving the front window (t=3 meters/c, x=3 meters). Let's transform each event to explain when and where you observed them. The first event will be:
$$\begin{bmatrix}ct_1'\\x_1' \end{bmatrix} = \begin{bmatrix}1.1547 &0.5774 \\0.5774& 1.1574 \end{bmatrix}\begin{bmatrix}c\cdot 0\\0 \end{bmatrix}=\begin{bmatrix}0\\0 \end{bmatrix}.$$
This is what we expect.  Now for the second event:
$$\begin{bmatrix}ct_2'\\x_2' \end{bmatrix} = \begin{bmatrix}1.1547 &0.5774 \\0.5774& 1.1574 \end{bmatrix}\begin{bmatrix}c\cdot \frac{3}{c}\\3 \end{bmatrix}=\begin{bmatrix}5.1963\\5.1963 \end{bmatrix}.$$
From this we see that you observe the photon exit Buzz's window at a location of 5.1963 m at a time of 17.3 ns. Now if we calculate $\Delta x' / \Delta t'$ we get $c$.
Part of the problem with your calculation is that simple time dilation as you applied it only works for the time between 2 events which happen at a common location in the other frame. Here, the two events happen at different locations which makes using the time dilation and length contraction methods susceptible to confusion.  It seems to me to be better to Lorentz transform the events. One could even transform $\Delta$s of events.
(By the way, if you transform from S to an S' moving in the positive-$x$ direction, one should change each $\gamma\beta$ to $-\gamma\beta$, where $\beta$ is really |$\beta$|.)
A: This is much easier if you think about Lorentz transformations. Suppose $\Delta t$ elapses in Buzz's frame of reference $S$ and the ship is of length $\Delta x$. He measures the speed of light to be 
$$u := \frac{\Delta x}{\Delta t} = c.$$ 
Good. In your frame of reference $S'$ you measure the total length traversed by the beam of light, $\Delta x'$. Your notice that a total time of $\Delta t'$ has elapsed. I state without proof the Lorentz transformations relating the coordinates of the system: 
$$\Delta t' = \gamma (\Delta t - v \Delta x/c^2)$$
$$\Delta x' = \gamma \left(\Delta x - v \Delta t \right)$$
For arbitrary $u \le c$ (i.e. anything moving at speed $u$ in $S$), the measured speed is 
$$\frac{\Delta x'}{\Delta t'} = \frac{\Delta x - v \Delta t}{\Delta t - v \Delta x/c^2}
= \frac{u - v}{1 - vu/c^2}$$
Plugging in $u = c$, we find
$$\frac{\Delta x'}{\Delta t'} = \frac{c - v}{1 - v/c} = c \frac{c-v}{c-v} = c.$$
Good, as it should be. No contradictions.
