Chapter 10 of 22Part II: Networks and Communication
Finding Yourself on Planet Earth
Each project below is tailored to a specific algorithm and scientific question from Chapter 10, with concrete inputs, verifiable numerical outputs, boundary cases, and links to the related lab and pioneer.
Project 1 of 3 · v1-c10-p01Foundational · ~20 min
Speed-of-Light Time-of-Flight Ruler
Lab activity: A. Turn a clock into a ruler · Related code: block-01.js · Pioneer: View profile
Real-World Problem: GPS satellites orbit 20,200 km above Earth, so measuring distance requires turning nanoseconds into meters.
Scientific Question: How sensitive is a light-speed distance measurement to microsecond and nanosecond timing errors?
Objective: Convert radio travel times into orbital distances using c = 299,792,458 m/s and compute clock-error drift.
Hypothesis to Test: A 1-microsecond clock offset causes ~299.79 meters of range error, while 1 nanosecond causes ~0.30 meters.
Step-by-Step Implementation
Define exact speed of light c = 299792458 m/s.
Compute range d = c * travelTime for satellite travel times around 67–85 ms.
Compute distance error for 1 ns, 1 μs, and 1 ms clock offsets.
Compute daily drift if Einstein's ~38 μs/day relativistic correction were omitted.
Concrete Input: Signal travel time = 0.06738 seconds; test clock bias Δt = 1 μs, 10 ns, and 38 μs/day (relativity).
Expected Output: Distance = 20,199,996 m; 1 μs error = 299.79 m; 38 μs relativistic drift = 11,392 m/day.
Test Cases: Δt = 1e-6 s -> 299.792458 m; Δt = 38e-6 s -> ~11.39 km.
Boundary Condition: Negative travel time indicates receiver clock is lagging behind satellite clock (negative bias).
Common Mistake to Avoid: Using km/s instead of m/s without converting units consistently.
Interpreting Results: Extreme precision in timing is what makes satellite navigation physically possible.
Show Hint, Extension Challenge & Reflection
Hint: Review the worked example and equation in Chapter 10 before testing the boundary case: Negative travel time indicates receiver clock is lagging behind satellite clock (negative bias).
Extension Challenge: Calculate how many milliseconds a signal takes from a satellite directly overhead (20,200 km) vs. near the horizon (~25,800 km).
Reflection Question: Why is GPS one of the most direct everyday verifications of Einstein's general and special relativity?
Scientific Question: How does iterative refinement converge on an unknown receiver position from noisy satellite ranges?
Objective: Solve for a mystery receiver point from simulated satellite coordinates and measure residual error.
Hypothesis to Test: Minimizing the sum of squared range residuals converges to the true receiver coordinates when satellite geometry is spread across the sky.
Step-by-Step Implementation
Start from an initial guess (0, 0) and compute predicted distances to each satellite.
Compute residuals (predicted − measured) and step opposite the gradient.
Log position error at each iteration until residual < 0.001.
Test clustering all satellites in one quadrant and observe slower/noisier convergence.
Concrete Input: 4 simulated satellites with exact ranges to hidden receiver (12, -5).
Expected Output: Converges within < 0.01 units of (12, -5) in under 20 iterations.
Test Cases: Exact ranges -> residual < 1e-4; Noisy ranges (±5 m) -> bounded least-squares estimate.
Common Mistake to Avoid: Forgetting to handle zero distance (division by zero when guess lands exactly on a satellite).
Interpreting Results: Real GNSS chips run linearized least-squares (Gauss-Newton) or Kalman filters continuously.
Show Hint, Extension Challenge & Reflection
Hint: Review the worked example and equation in Chapter 10 before testing the boundary case: Too-large step sizes diverge; normalize step size by satellite count.
Extension Challenge: Add a 3rd coordinate (altitude z) and verify convergence with 4 satellites.
Reflection Question: How did Gladys West's geodetic Earth-shape modeling make accurate global GPS coordinates possible?
Lab activity: C. Fix an imperfect clock · Related code: block-03.js · Pioneer: View profile
Real-World Problem: Smartphones contain inexpensive quartz clocks that drift by milliseconds, yet GPS needs nanosecond accuracy.
Scientific Question: How does adding a 4th satellite allow the receiver to solve for both position AND its own clock error Δt?
Objective: Introduce an unknown clock bias into simulated pseudoranges and recover both exact position and Δt.
Hypothesis to Test: A constant clock bias shifts all pseudoranges equally; adjusting Δt until all circles meet at one point recovers both true position and exact clock error.
Step-by-Step Implementation
Add a hidden constant offset b = c * Δt to all simulated satellite distances.
Observe that naive trilateration fails to intersect cleanly when b != 0.
Include b as an unknown variable in the solver and adjust (x, y, b) together.
Confirm both true coordinates and exact clock offset b are recovered.
Concrete Input: True position (10, 15), unknown receiver clock bias equivalent to +4.0 distance units on all 4 pseudoranges.
Expected Output: Recovered position = (10.00, 15.00) and clock bias = +4.00 units.
Test Cases: b = +4.0 -> recovered within 0.01; b = -2.5 -> recovered within 0.01.
Boundary Condition: With only 2 satellites in 2D (or 3 in 3D), position and clock bias cannot be separated uniquely.
Common Mistake to Avoid: Applying random independent errors instead of a shared clock bias across all satellites.
Interpreting Results: Because all satellites synchronize to GPS system time, one extra measurement turns a cheap phone clock into an atomic-grade reference.
Show Hint, Extension Challenge & Reflection
Hint: Review the worked example and equation in Chapter 10 before testing the boundary case: With only 2 satellites in 2D (or 3 in 3D), position and clock bias cannot be separated uniquely.
Extension Challenge: Sweep b from -10 to +10 and plot the minimum residual curve to visualize the unique global minimum.
Reflection Question: How did Roger Easton and Bradford Parkinson's atomic-clock architecture make passive consumer receivers possible?