Lesson
The theory — Fermat's Principle: the Lifeguard Problem
Fermat's principle: light travels between two points along a path whose travel time is stationary, meaning that a small change in the path makes no first-order change in the time. For a lifeguard who runs at v₁ and swims at v₂, the total time through entry point x is T(x) = √(x² + a²)/v₁ + √((L − x)² + b²)/v₂, and its minimum is where sin θ₁ / v₁ = sin θ₂ / v₂, the angles measured from the line at right angles to the water's edge. For light, v = c/n turns this into Snell's law, n₁ sin θ₁ = n₂ sin θ₂.
What each symbol means
x- where along the water's edge the path crosses it
v_1- speed on the sand
v_2- speed in the water
θ- angle between a leg of the path and the line at right angles to the water's edge
T″- the second derivative of the time at the best point; a miss of Δ costs about ½T″Δ²
- Assumes
- Straight runs at constant speed on each side of a sharp water's edge, no time lost turning or entering the water, and a swimmer who stays put. Pennings lists the same assumptions for Elvis and adds that waves blur the edge and that a corgi runs a little way into the water before swimming.
Problem solved in full
-
A beach with a strip of soft sand 5 steps
The lifeguard from the first preset now has 10 m of soft dry sand to cross, where they run at only 4 m/s, before 10 m of firm sand at 7 m/s and then the water. The swimmer is still 20 m out and 40 m along, and swimming is still 1.5 m/s. What is the fastest time now, and how much does it cost to run the old path across the new beach? Press Straight at the swimmer to check the first step.
-
Without the soft strip, the page finds the best entry point and the best time:
-
With three strips, the fastest path bends at both boundaries, and the slope condition becomes one number shared by every strip, c = sin θ / v. Each strip of depth h is crossed sideways by h tan θ, and the three crossings must add up to the 40 m along the beach. Solving for c:
-
That gives the angle in each strip, from the line at right angles to the boundaries:
-
Each leg is h / cos θ long, and its time is its length over its speed:
-
The old path, through the old entry point at 36.18 m with a straight run across both kinds of sand, spends half its run on the soft strip:
Answer
The fastest path takes 21.03 s. It crosses the soft sand steeply, at 32.75° from straight across, runs most of the way along on the firm sand at 71.23°, and goes into the water 35.86 m along. The old path takes 21.69 s on the new beach, so ignoring the soft strip costs 0.67 s, much more than the 16 ms a one-metre miss costs on the old beach. The straight line now takes 24.41 s. The rule that does the work is the one light obeys crossing layers of glass: sin θ / v is the same in every layer.
-
Learning path
Least time, least action
References (2)
- Elvis the corgi: his running and swimming speeds, the optimal entry point y = x/√((r/s)² − 1) that does not depend on the distance along the beach, and the 35 measured retrieves this page plots: T. J. Pennings, "Do Dogs Know Calculus?", The College Mathematics Journal 34(3), 178–182 (2003).
- Fermat's principle in its modern form, that a small change in the path makes no first-order change in the time; the lifeguard as Feynman's illustration of it; and why the stationary path is the one the light takes, from the phases of neighbouring paths: M. Fowler, "Fermat's Principle of Least Time", lecture 3 of the lecture notes for Graduate Classical Mechanics (Physics 7010), University of Virginia.