Simple length contraction question The question I'm doing states that the nearest star to earth is 4 light years away, as measured on earth and a spaceship can get there in 5 years, as measured by an observer on earth. It asks how long the pilot would measure the journey to take and how far from earth the pilot would measure the star to be. 
Using  $t= \gamma t_0 $ I have (correctly) calculated the time measured by the pilot to be 3 years. This makes sense as I have taken $t_0$ to be the time measured by the pilot (stationary frame) and $t$ to be the time measured on earth. 
However, using the same principle with the length contraction formula $l= \frac{l_0}{ \gamma} $, taking $l_0$ as the pilot's distance and $l$ as the distance measured on earth I get $l_0=4 *(5/3)=6.66... $ which is wrong as it is not a contraction. The right answer is obtained by switching the roles of $l$ and $l_0$ around but I don't understand why my initial thought process was wrong? Also, switching the roles seems inconsistent with how I'm using the time dilation formula.
Also, as a side question, I've heard stuff along the lines of "you're always safer using the Lorentz equations instead of the simple time dilation, length contraction equations." - I'm wondering how I'd use the Lorentz equations in this case. I think I successfully got the time answer using the Lorentz time equation but again, had trouble on how to even use the $x$ coordinate Lorentz equation for the second part of this question.
Many thanks for any answers!
 A: So the question is: Why is $l_{o}$, the proper length, measured in the Earth's frame of reference and not the pilot's?  $l_{o}$ is the length of something measured in the frame of reference in which it is at rest.  On Earth we see the Earth and the star at rest.  The pilot sees them as moving.
A: Imagine that, along the route to the nearest star, there are 'mileposts' at rest with respect to Earth and, in this frame, spaced $l_0 = 1\mathrm{km}$ apart.
To an observer moving uniformly relative to, and along the line of, the mileposts, their spacing is contracted to
$$l' = \frac{l_0}{\gamma}$$
To use the Lorentz transformation to derive this, express the spatial coordinates of two consecutive mileposts in terms of the relatively moving (primed) coordinate system (simultaneous measurement in the primed coordinates):
$$x_2 = \gamma(x_2' + \beta t')$$
$$x_1 = \gamma(x_1' + \beta t')$$
and subtract
$$(x_2 - x_1) = \gamma(x_2' - x_1')$$
But $(x_2 - x_1) = 1\mathrm{km}$ thus, the distance as measured in the primed system
$$\Delta x' = \frac{1\mathrm{km}}{\gamma}  $$
A: The lorentz transformations are:
$$t' = \gamma (t - \frac{vx}{c^2})$$
$$x' = \gamma (x - vt)$$
$$y' = y$$
$$z' = z$$
where 
$$\gamma = \frac{1}{\sqrt{1-v^2/c^2}}$$
To use the lorentz tranformations to figure out the time and length from the astronauts point of view, firstly label two events $A$ and $B$, where $A$ is the event that the astronaut leaves Earth, and $B$ is the event where the astronaut reaches his destination. $A$ and $B$ are both from the perspective of Earth, and $A'$ and $B'$ are the same events, except seen from the astronauts perspective. We know that:
$$A(t,x,y,z) = (0, 0, 0, 0)$$
$$B(t,x,y,z) = (L, T, 0, 0)$$
Where $L$ is the distance between the two planets, and $T$ is the time it takes the astronaut to reach his destination from Earth's point of view. Now we can apply the lorentz transformations to each of the two events to obtain:
$$A'(t',x',y',z') = (0, 0, 0, 0)$$
$$B'(t',x',y',z') = (\gamma(T - \frac{vL}{c^2}), \gamma(L - vT), 0, 0)$$
By noting that $v = L/T$, we can simplify the expressions:
$$A'(t',x',y',z') = (0, 0, 0, 0)$$
$$B'(t',x',y',z') = (\frac{T}{\gamma}, 0, 0, 0)$$
So we recover correctly that $T' = \frac{T}{\gamma}$. To get $L'$ (the distance in the astronauts point of view), we note that $v = \frac{L'}{T'}$, so we also have $L' = \frac{L}{\gamma}$ as needed.
A: You can use the Lorentz transformations to work out how far away the star is for the spaceship pilot, but it has a pitfall for the unwary.
We'll assume, as usual, that the spaceship passes the stationary observer at the origin. In the stationary observer frame the position of the star is $(t=0,x=d)$, where $d$ is the $4$ light year distance mentioned in the question. So let's transform this spacetime point into the spaceship coordinates:
$$ t' = \gamma \left( t - \frac{vx}{c^2} \right ) = -\gamma \frac{vd}{c^2} $$
$$ x' = \gamma \left( x - vt \right) = \gamma d $$
But because $\gamma \gt 1$ this means $x' \gt x$ and it appears that the distance has increased not contracted, just as you say in the question.
The solution is to note that the time is $t' = -\gamma vd/c^2$ so for the spaceship pilot the star was at $x' = \gamma d$ in the past not at time zero. In the pilot's frame the star is moving towards them at velocity $v$, so we calculate the star's position at time zero by subtracting off $vt'$:
$$ x'(0) = \gamma d - v\ \gamma \frac{vd}{c^2} $$
and this rearranges to:
$$\begin{align}
 x'(0) &= \gamma d\left(1 - \frac{v^2}{c^2}\right) \\
       &= \gamma d \frac{1}{\gamma^2} \\
       &= \frac{d}{\gamma}
\end{align}$$
Giving us the equation for the contracted distance that we expect.
A: There is a slight misunderstanding in the terms you have used. Time dilation means that the time interval measured between two events from a moving frame appears to be smaller than that measured from a stationary frame with respect to the frame on which the event happened. So a stationary observer see a larger time interval than a moving observer. This is time dilation. The constant   
$γ$ = 1/√(1-[$v^2$/$c^2$])  
will be always greater than 1 as v

$t$ = $γ$$t_0$  
Now, the proper length is the length of an object measured in the same reference frame as the object is at. It is denoted as $l_0$. Now suppose the length is moving with a velocity v. The length measured on a stationary frame w.r.t he moving frame see the length contradicted by a factor of $γ$. So we write  
$l$ = $l_0$/$γ$.  
So in the above problem, you should select the proper length $l_0$ as the length measured in the moving frame (the pilot's frame) and $l$ to be measured from the stationary frame which is from the earth. you just inverted the values. The concept of time dilation and length contraction works inversely. From a stationary frame time dilation happens and length contraction happens to the proper time and proper length in a moving frame.
