# Special relativity spaceships time question

Here is the problem and my solution,

Two spaceships each measuring 100m in its own rest frame, pass by each other travelling in opposite directions. Instruments on board spaceship A determine that the front of spaceship B takes 5x10^-6 s to traverse the full length of A.
a) what is the relative velocity of the two spaceships
b) how much time elapses on a clock on spaceship B as it traverses the full length of A?

So for this i thought that since A is doing the measurement, it takes 5 x 10^-6 s for B to pass 100 m. Since according to A, it is still 100m. then the velocity is just 100/5 x 10^-6. is this correct?

then i took this speed and put it into the time dilation equation with the 5x10^-6s to get the answer for part b.

In b if you by time dilation equation mean $T = \gamma T_0$ where T is the time obsered in b, then this will be incorrect. I had a similar problem (thread: Relativity). You must remember that the events don't occure at the same location, that is $\Delta x \neq 0$ and $\Delta x' \neq 0$. You have $\Delta x =100$ and $\Delta t =5\times 10^{-6}$ in A's reference frame, and since B is moving with a relative velocity v, you must use the Lorentztransformation to transform this time $\Delta t$ to B's referenceframe, which will be
$$\Delta t' = \gamma(v)\left(\Delta t-\Delta x\,\frac{v}{c^2}\right)$$
You can also solve this problem by considering the event from B. In B referenceframe the length of A's spaceship will be $L = L_0/\gamma(v)$, and since A is moving with a relative velocity v with respect to B, the time it will take to for B to traverse THAT length of A, will be
$$\Delta t' = \frac{L}{v} =\frac{L_0}{v\gamma(v)}$$