Optimal Rescue Path for a Lifeguard on a Flowing River
Problem
A lifeguard stands on one bank of a river flowing at 4 m/s. A person is drowning 50 m downstream from a point directly opposite the lifeguard. The lifeguard can run along the bank at 6 m/s and swim in still water at 3 m/s.
Explanation
We model a classic lifeguard rescue optimization problem in a flowing river and visualize the possible rescue paths.
Problem Setup
- The river flows horizontally with speed (to the right).
- A lifeguard stands on one bank at point .
- A drowning person is located at point , which is 50 m downstream from the point directly across the river from .
- The lifeguard can:
- Run on the bank at .
- Swim in still water at .
Let’s define a coordinate system:
- Put the lifeguard at the origin: on the near bank.
- The river flows along the x-axis, to the right.
- The opposite bank is at , where is the river width.
- The point directly opposite the lifeguard on the far bank is .
- The drowning person is at .
The lifeguard chooses a landing point on the opposite bank at . The strategy is:
- Run along the bank from to some point on the near bank.
- Swim across to reach point , letting the current carry them.
- Reach the drowning person at (horizontal alignment on the far bank).
In many textbook variants, one simplifies this to: run along the near bank to some point, then swim directly toward the drowning person, or run to an optimal point on the near bank, then swim to the person.
In this visualization we:
- Let you set the river width and downstream distance (50 m in the statement, but adjustable).
- Let you adjust the lifeguard’s running speed, swimming speed, and river current.
- Let you select a landing point on the far bank where the lifeguard aims to arrive when swimming.
- Compute and show the effective velocity vector of the lifeguard while swimming (their swim direction plus the river’s current).
- Compute and display an approximate total rescue time for a chosen strategy.
Mathematical Model (for the visualization)
Let:
- River width: (meters).
- Downstream offset of victim: (meters), default .
- Running speed: .
- Swimming speed (in still water): .
- River current speed: (positive to the right).
- Chosen target point on far bank: .
1. Running Phase
We assume the lifeguard runs along the near bank from to some chosen point . In this visualization, for simplicity, we link running and swimming points so that they run to a near-bank point with the same x-coordinate as where they intend to land on the far bank:
- Run distance:
- Run time:
2. Swimming Phase
When the lifeguard enters the water at , they aim their swimming direction at relative to the water. Their velocity relative to water is a vector of magnitude pointing straight upward (toward the opposite bank in our model).
- Swimming velocity (relative to water):
- River velocity:
- Effective velocity (relative to ground):
The vertical distance to cross is , so the swim time is
During this swim, the lifeguard is carried horizontally by the current an amount
So if they start at on the near bank, they will arrive at
For the drowning person at , we want ideally
3. Total Rescue Time
In the simplified model where the lifeguard aims straight across (perpendicular to banks):
- Run time: .
- Swim time: .
Total time:
With current, the main issue becomes choosing so that the horizontal drift brings the lifeguard near the victim’s x-position . This visualization lets you tune and see how well the landing location matches the drowning person.
What You Can Explore
With the widgets below, you can:
- Change river width and downstream distance .
- Adjust running speed, swimming speed, and current speed.
- Drag the target x-position on the far bank and see:
- The run path along the near bank.
- The swim path across the river.
- The river current vector and the effective motion of the lifeguard.
- The landing point relative to the drowning person.
- An estimate of total time and distance split between running and swimming.
Geometrically, this is closely related to Snell’s law in optics and the calculus of variations: finding paths that minimize total travel time when speeds differ in regions (running vs swimming) and when there’s a "drift" (river current).
Use the sliders to see how the optimal landing point shifts when:
- The current gets stronger.
- The lifeguard can run faster or swim faster.
This builds the intuition that: to save time, the lifeguard tends to run more along the bank (faster medium) when swimming is slow or current is strong, and tends to swim a more direct path when swimming is relatively fast.