Time dilation and length contraction applied to a specific physics problem I was thinking of a problem that most of the lecture notes go over when introducing special relativity to the students.
Consider a spaceship with Alice inside it. Let's say the spaceship is traveling at a speed of $0.7c$. Alice then shines a laser light and tries to calculate the time taken by the light to hit the other end of the spaceship, assuming the spaceship has a length $50 m$. Bob is watching all of this from outside and tries to calculate the same quantity. If we denote Alice's time (time measured in Alice's frame) as $t_{A}$ and Bob's time (time measured in Bob's frame as $t_B$, the goal is to find out the numerical values of $t_A$ and $t_B$.
Here is my attempt.
First, $\gamma = 1.4$
So, for Alice,
$t_A = \frac{50}{c} s$
Bob, however, will disagree with the time measured by Alice (time dilation). He will say that  the light took $t_B = \gamma t_A = \frac{70}{c} s$.
My question is:
Can we arrive at the same answer if we consider this problem from the view point of length contraction?
My confusion is: Bob will see that the spaceship itself is length contracted. So, for him, $l_{spaceship} = 35.7 m$ . Also, by the time the light travels a distance of $35.7 m$, the right end of the spaceship will have moved farther to the right. I believe that the reason why $t_B$ turned out to be $\frac{70}{c} s$ earlier is simply the manifestation of this idea that the spaceship had a chance to move farther to the right. So I am confused as to what "time" should I be using to calculate this extra distance moved by the spaceship if I consider Bob's viewpoint? I might be confusing something very fundamental, but I would appreciate any help.
 A: We have 2 equations for Lorentz tranformation, considering both observers in the same position and time when the light is emmited.
$x_b = \gamma(x_a - vt_a)$
$t_b = \gamma(t_a - (v/c^2)x_a)$
For Alice: $x = ct$, because it is a light beam between 2 points.
$x_b = \gamma(x_a - (v/c)x_a \implies \gamma x_a(1 - v/c)$
$t_b = \gamma(t_a - (v/c^2)ct_a) \implies \gamma t_a(1 - v/c)$
Substituting the values:
$t_b = 1.4 t_a(1 - 0.7) = 0,42t_a = 21/c$ s
$x_b = 1.4 x_a(1 - 0.7) = 0,42x_a = 21 m$
A: Do all your calculations in the frame of your choice and then transform them to the other frame.
In this case, the easy frame to work in is Alice's.  Take frames based at the event $A$ where Alice releases the lightbeam.  So $A$ is given by $(t=0,x=0)$.  The beam hits the other end of the ship at event $B$, with $x=50$ meters, so $t=x/c$.
Now translate $B$ to Bob's frame:  $x'=(x-vt)/\sqrt{1-v^2}$, $t'=(t-vx)/\sqrt{1-v^2}$. Now you're done.  If you want to check your work, make sure that $x'/c=t'$, so that Bob sees the same speed of light that Alice does.
