Make two clocks each run slow, without contradiction
At v = 3/5 c, each frame finds the other's clock slow: two different events, exact fractions, one invariant proper time.
At v = 3/5 c, γ = 5/4 exactly, so every event can be computed with fractions. This program reproduces the chapter’s two clocks: each frame finds the other’s clock slow. It then checks what every frame agrees on, shows two events simultaneous in one frame and not the other, and measures a moving rod.
Run it
Save this as simultaneity.py and run it with Python 3.11 or later. It uses the standard library only.
"""Events, frames and simultaneity, exactly: v = 3/5 c, so gamma = 5/4 (standard library only).
Units with c = 1. An event is (t, x). S' moves at +v relative to S.
"""
from fractions import Fraction as F
v, g = F(3, 5), F(5, 4)
assert g * g * (1 - v * v) == 1
def to_s_prime(t, x):
return g * (t - v * x), g * (x - v * t)
def to_s(tp, xp):
return g * (tp + v * xp), g * (xp + v * tp)
def show(e):
return "(" + ", ".join(str(c) for c in e) + ")"
O = (F(0), F(0))
B = to_s(F(4), F(0)) # clock C' (at rest at x' = 0) reads 4
Bt = (F(4), F(0)) # clock C (at rest at x = 0) reads 4
print("Two clocks, each slow:")
print(f" C' reads 4 at S'-event (4, 0) = S-event {show(B)}: in S, time 5 has passed, C' shows 4")
print(f" C reads 4 at S-event (4, 0) = S'-event {show(to_s_prime(*Bt))}: in S', time 5 has passed, C shows 4")
print(f" B and B~ are different events: {B != Bt}")
tau = lambda e1, e2: (e2[0] - e1[0]) ** 2 - (e2[1] - e1[1]) ** 2 # squared proper time
print("\nProper time is what every frame agrees on:")
for name, e in (("O to B", B), ("O to B~", Bt)):
print(f" {name}: in S {tau(O, e)}, in S' {tau(to_s_prime(*O), to_s_prime(*e))} (each = 4^2)")
print("\nSimultaneity is frame-relative: two events at S-time 0")
E1, E2 = (F(0), F(0)), (F(0), F(5))
t1, t2 = to_s_prime(*E1)[0], to_s_prime(*E2)[0]
print(f" E1 = (0, 0), E2 = (0, 5): S' times {t1} and {t2}; simultaneous in S', {t1 == t2}")
L = F(4) # a rod at rest in S' from x' = 0 to x' = 4
rear = to_s(F(0), F(0))
front = to_s(-v * L, L) # the front end's event that has S-time 0
print("\nLength contraction, stated properly: rest length 4 in S'")
print(f" rear end at S-event {show(rear)}, front end at S-event {show(front)}: both at S-time 0")
print(f" length in S = {front[1] - rear[1]} = 4 / gamma = {L / g}; measured on events simultaneous in S")Expected outcome
Two clocks, each slow:
C' reads 4 at S'-event (4, 0) = S-event (5, 3): in S, time 5 has passed, C' shows 4
C reads 4 at S-event (4, 0) = S'-event (5, -3): in S', time 5 has passed, C shows 4
B and B~ are different events: True
Proper time is what every frame agrees on:
O to B: in S 16, in S' 16 (each = 4^2)
O to B~: in S 16, in S' 16 (each = 4^2)
Simultaneity is frame-relative: two events at S-time 0
E1 = (0, 0), E2 = (0, 5): S' times 0 and -15/4; simultaneous in S', False
Length contraction, stated properly: rest length 4 in S'
rear end at S-event (0, 0), front end at S-event (0, 16/5): both at S-time 0
length in S = 16/5 = 4 / gamma = 16/5; measured on events simultaneous in SThe two “slow clock” statements are about different events, B and B̃, and each leans on its own frame’s synchronisation. Proper time between O and each event is 16 = 4² in both frames: that is the frame-independent fact. Two events at S-time 0 are 15/4 apart in S′. A rod of rest length 4 is 16/5 = 4/γ long in S, measured on events simultaneous in S.
Mechanism and limitations
Documented: Chapter 17 of the book sets out the mathematics; this program is a self-contained demonstration of it, not one of the laboratory’s recorded investigations.
Observed: the output above, produced by running the program exactly as shown.
Not shown:
- Exact arithmetic at one speed; the general formulas are the subject of the next chapter.
- Nothing physical is measured; this is the mathematics of the Lorentz model, in units with c = 1.
Related worked example: Chapter 4 .
Challenge this result
Copy this into the AI assistant of your choice, or work through it yourself. Check any finding against the recorded evidence.
Examine the two-clock computation at v = 3/5. Check both inverse boosts by
hand, confirm that B and B̃ are different events, and compute the proper time
between O and each. Explain why "each clock runs slow" is not a contradiction,
and say which synchronisation convention each comparison uses.
Chapter: https://programmer.ie/books/math/17-chapter/
Example: https://programmer.ie/examples/math/17-chapter/
Program: https://github.com/ernanhughes/math/blob/main/notebooks/math/programs/17-simultaneity.py
Distinguish what the record shows from what you infer. If you cannot open a link, ask me for the material; do not invent it.Canonical source and the program .
Understand this example
Copy this prompt into your AI tool. No code runs here.
Apply this example
Copy this prompt into your AI tool. No code runs here.