# can you explain how time dilation works in the following situation?

in the image suppose A is an observer. a box length of 1 light second is moving away from A with a velocity of half of the speed of light. a laser is shot from the front side of the box(C) to the opposite side of the box meaning that the light is going to the opposite direction of the velocity of the box.

if there is an observer in the box he will see light to reach the end of the box(B) in one second.but in case of observer A will the time taken for the light be shorter than 1 second or longer? it seems like it would be shorter. according to special relativity should it be longer?

According to observer $A$, the length to $L$ of the $1$ light second box is contracted to $L\sqrt{\frac{3}{4}}$, but the speed of the light pulse remains $c$. This is simply the relativistic Doppler effect in action. Once you factor in the contracted length of the box, you can treat this problem kinematically, where the other end of the box and the photon are moving in opposite directions with speeds $\frac{c}{2}$ and $c$ respectively, and they are together covering a distance of $L\sqrt{\frac{3}{4}}$.

For two events that take place at the same spatial point in the frame of $B$, you could compare $B$'s rest frame time interval to the time interval measured by $A$; but in this case, the two events; light getting emitted from one end of the box, and light reaching the other end of the box, happen at different spatial points in both $A$ and $B$'s frame. So time-dilation may not be something very obviously discernible here.

Time dilation compares the elapsed wristwatch time between two events experienced by an inertial observer with the apparent elapsed time measured by another inertial observer. They key thing here is that the two events must be experienced by an inertial observer... that is, the events must be on her worldline. (Technically speaking, the events are timelike-related.)
You don't have this situation here.

In your problem, the events "light-signal emitted from the front wall" and "light-signal arrives at the back wall" are not two events on the worldline of an inertial observer... these events are spatially separated. Instead they are two events related by a light-signal. (Technically speaking, the events are lightlike-related.)
Time-dilation does not apply here... but the Doppler effect does.

(Time-dilation will apply in the case of these two events: the emission event and the reception-of-the-reflection event on the worldline of the emitting observer. This is "one tick" of the light clock.)

It might be helpful to draw a spacetime diagram (a position-vs-time graph) of the problem you posed. In my diagram, time runs upwards. I've drawn it on rotated graph paper to make it easy to draw the light-signals.

For velocity $v=\frac{1}{2}$,
the time-dilation factor is $\gamma=\frac{1}{\sqrt{1-v^2}}=\sqrt{\frac{4}{3}}=\frac{2}{\sqrt{3}}$
and the Doppler factor is $k=\sqrt{\frac{1+v}{1-v}}=\sqrt{3}$.
The length contraction factor $1/\gamma=\frac{\sqrt{3}}{2}\approx 0.866$.
To check the speed is (1/2), count upwards 2 diamonds, then right 1 diamond to reach the moving worldline. Lorentz-invariance requires that the area of all clock diamonds are equal.

The diagram shows two light-clocks and the spacetime paths of the light-signals in each clock. I highlighted the signal from the front of the clock to the back of the clock, and the subsequent reflections. Note the length contraction of the moving clock.

For observer B (moving with the clock), the total time is $1+1=(2\rm\ seconds)$.

For observer A (at rest, observing the moving clock), it's not.

• For backward-directed ray, the elapsed time is shorter than one second...it is $1/k$ seconds.
This is the Doppler effect.
• For forward-directed ray, the elapsed time is longer than one second...it is $k$ seconds.
This is the Doppler effect.
• The total time is $(1/k)+k=\left(\frac{1}{\sqrt{3}}+\sqrt{3}\right)= \frac{4}{\sqrt{3}}=\frac{2}{\sqrt{3}}(2\rm\ seconds)$.
This is time-dilation... where your "ticks" are 2 seconds long.

[Note the identity: $\gamma=\displaystyle\frac{(\frac{1}{k})+k}{2}$.]