A monk walks up a mountain path from dawn to dusk, at any pace he likes, resting and even turning back, and sleeps at the top. The next day he walks down the same path from dawn to dusk, again at any pace he likes.
Was there a time of day at which he was at exactly the same spot on both days?
Measure the day from at dawn to at dusk, and the path from at the foot to at the top, as distance along the path, so that the same spot is the same number. Write for where he is at time on the way up and for where he is on the way down. That is all there is to know about him:
and both are continuous: to get from one place on the path to another he passes through every place in between. Nothing is said about speed, and nothing needs to be.
This is the film's bridge. Plot both walks against the time of day and look at the gap between them,
It is continuous, because both walks are. At dawn , and at dusk . A continuous function that starts below zero and ends above it has to be zero somewhere in between: that is the intermediate value theorem. At that moment .
Look at what the proof used: the four numbers at the ends and the fact that he walks rather than jumps. Resting, dawdling and turning back never come into it.
This is the film's answer. Both walks fill the same hours, so run them on the same day. Two monks set off at dawn, one from the foot and one from the top. At dawn the climber is below the other; at dusk he is above. A path is a line, and there is no way round anyone on a line, so to change order the two must at some moment be in the same place. That moment is one spot at one time of day, and the two monks are the same man on his two days.
It is worth being honest about what is doing the work. "They cannot change order without meeting" is the intermediate value theorem again, applied to the gap between them. The second monk does not bring a new theorem. He brings a picture in which the conclusion cannot be doubted, which is what a proof is for, and he makes clear the one thing the graph hides: the path must be a line (see below, on a field).
The film does not show this one. Look at noon. If he was in the same place at noon on both days, that is the answer. If not, then in one half of the day the climber starts below the descender and ends above him: in the afternoon if at noon he was still below, in the morning if he was already above. Keep that half, and halve it again.
The halves nest, each half as long as the one before, so they close in on a single time . At the start of every one of them the gap is negative and at the end it is positive. Both ends close in on , so by continuity is a limit of negative numbers and of positive numbers at once: it is at most zero and at least zero. So .
This is the proof of the intermediate value theorem itself, and the one step that needs care is the closing in. Nested intervals that shrink to nothing always share a point because the real line has no gaps. The rational numbers do have gaps, and over them the theorem is false: is negative at and positive at and never zero at a fraction.
It is also an algorithm, and it answers route one's complaint. The film says that solving works for one pair of walks at a time. Halving works for every pair at once: not a formula, but a procedure that finds a meeting to any precision you ask for, one binary digit per step.
The film's climb starts quickly, changes its mind 0.330 of the way up and drops back to 0.260, sits on a rock, and then plods to the top. The descent dawdles, stops for a long look at the view, and then hurries home. They meet 0.718 of the way through the day, 0.576 of the way up the path: not at midday, and not halfway.
━ day one, climbing ━ day two, descending ◯ the same place at the same time
Route one's guess, midday and halfway up, is killed by the right-hand pair. Sprint up and then wander, crawl down at a steady pace, and the meeting is at 0.115 of the day, 0.885 of the way up: early, and near the top.
Proof three, run on the film's walks. At each step, look at the middle of the bracket: if the climber is still lower than the descender there, the meeting is later, so keep the second half.
| Between | Look at | Climber | Meeting |
|---|---|---|---|
| 0.000 – 1.000 | 0.500 | lower | later |
| 0.500 – 1.000 | 0.750 | higher | earlier |
| 0.500 – 0.750 | 0.625 | lower | later |
| 0.625 – 0.750 | 0.688 | lower | later |
| 0.688 – 0.750 | 0.719 | higher | earlier |
| 0.688 – 0.719 | 0.703 | lower | later |
| 0.703 – 0.719 | 0.711 | lower | later |
| 0.711 – 0.719 | 0.715 | lower | later |
| 0.715 – 0.719 | 0.717 | lower | later |
| 0.717 – 0.719 | 0.718 | lower | later |
After 10 halvings the meeting is pinned between 0.718 and 0.719 of the day, a bracket 0.0010 wide, and it has the film's 0.718 inside it.
The film ends by throwing three more pairs of walks at the claim, with rests and turn-backs in them. They meet at 0.767, 0.587, 0.441 of the day, at heights 0.846, 0.085, 0.579. The spot moves and the time moves; the meeting does not.
Drag any knot of either walk, or focus one and use the arrow keys, and try to make them miss. The slider puts both days on one day and shows the two walkers on the path at that moment.
| Pair | Meets, through the day | How far up |
|---|---|---|
| The film's two walks | 0.718 | 0.576 |
| Sprint up, crawl down | 0.115 | 0.885 |
| Break it, first try | 0.767 | 0.846 |
| Break it, second try | 0.587 | 0.085 |
| Break it, third try | 0.441 | 0.579 |
At least once, by any of the proofs. Several times is easy: let the descender stop on a rock while the climber passes him, turn back, and pass again. In 4000 random pairs of walks that rest and turn back, 517 (12.9%) met more than once, one of them 7 times. A whole stretch of the day happens when both rest at the same spot at overlapping times: then every moment of the overlap is a meeting. The set of meeting times is always closed, so there is always a first meeting and a last one.
The passes are odd. Count only the meetings where they actually pass each other, where the climber goes from below to above or back again, and not the ones where they touch and part on the same side. He starts below and finishes above, so he passes upwards one more time than he passes downwards, and the total is odd:
| Times they pass each other | Pairs |
|---|---|
| 1 | 3483 |
| 3 | 468 |
| 5 | 47 |
| 7 | 2 |
Exactly once when one walk never turns back and the other never turns back or stops. Then never decreases and always decreases, so the gap is strictly increasing, and a strictly increasing function is zero at most once. Allow both to stop and the meeting can be a stretch; allow either to turn back and it can be several.
Different hours. The film insists that both days run from dawn to dusk. That is a safe way to tell it, but it is more than the proof needs. He lives at the foot and sleeps at the top, so compare the two whole days from midnight to midnight: at the first midnight he is at the foot on day one and at the top on day two, and at the last midnight it is the other way round. Leave late, arrive early, wait at either end: the proof goes through unchanged. The script checks 2000 pairs with random departure and arrival times, and every one meets. What matters is that at every moment of both days he is somewhere on the path.
Two climbs. If he climbs on both days, he is at the foot at dawn and at the top at dusk both times, so the walks meet at the ends and need not meet anywhere else: a fast climb is ahead of a slow one all day. The trick needs opposite ends.
A different path down. Then "the same spot" may not exist. The same path is what turns where he is into a single number.
A field instead of a path. On a square field, two walkers who set off from opposite corners at dawn and swap corners by dusk need not ever stand in the same place: one goes along the bottom edge and up the right, the other along the top and down the left, at the same pace, and they are always on opposite sides. In two dimensions you can go round. That is the step in proof two that the path being a line pays for.
Jumps. If he could vanish in one place and reappear in another, continuity is gone and so is the conclusion. The halfway house is a staircase: a step at a time, on the tick of a clock. Then they either stand on the same step on some tick, or swap across one stair between two ticks, which in continuous time is meeting halfway up it. The gap between them changes by at most two a tick, so to get from negative to positive without being zero it must jump from to , and that is the swap. Allow strides of two and they can miss: on a staircase of two, one goes while the other goes .
| Steps | Ticks | Pairs | Same step | Swap only |
|---|---|---|---|---|
| 1 | 1 | 1 | 0 | 1 |
| 2 | 3 | 9 | 7 | 2 |
| 3 | 4 | 16 | 8 | 8 |
| 3 | 6 | 1,444 | 1,010 | 434 |
| 4 | 6 | 361 | 249 | 112 |
| 4 | 7 | 3,969 | 2,833 | 1,136 |
| 5 | 7 | 676 | 396 | 280 |
Forget day two. On the way up, was there a stretch of exactly half the day in which he climbed exactly half the path?
There always is. Let for between and : the climb in the half-day starting at , minus a half. Then
so and are zero or of opposite signs, and the intermediate value theorem gives a zero between them. On the film's climb it is the half-day from 0.409 to 0.909. The same works for any : the values add up to , so one is at most zero and one at least zero, and there is a zero between them.
And for nothing else. With , take Paul Lévy's walk
with . It starts at the foot and ends at the top, and is small enough that it climbs all day without stopping. Since repeats every , the bracket changes by exactly over any stretch of length , so in every stretch of two-fifths of the day this monk climbs exactly 0.36 of the path, never 0.4. The same formula avoids any length that is not , because is zero only when is a whole number.
| Fraction | For every walk? | A walk that avoids it |
|---|---|---|
| 1/2 | always | — |
| 1/3 | always | — |
| 2/5 | not always | every 2/5 of the day climbs exactly 0.3600 |
| 0.45 | not always | every 0.45 of the day climbs exactly 0.4314 |
| 2/3 | not always | every 2/3 of the day climbs exactly 0.6000 |
| 0.3 | not always | every 0.3 of the day climbs exactly 0.2823 |
This is the universal chord theorem: a continuous function with has a horizontal chord of length for every , and Lévy showed in 1934 that those are the only lengths that are guaranteed.
None of the above is left to the proofs. scripts/monks.mjs reads the film's own monks.json, finds every meeting of every pair of walks the film draws, and asserts that each meets exactly once, where the film puts its flag. The climb is checked to turn back and to rest, and the descent to stop. Then it checks the rest.
A walk is straight between its samples, so the gap between two walks is too, and every meeting is found exactly, not by searching. Each one is tested to be a meeting, the number of passes is compared with the sign changes of the gap at the samples, and halving the day is run on every pair and must land on a meeting.
| Walks | Pairs | Result |
|---|---|---|
| Resting, dawdling and turning back | 4,000 | every pair meets; passes always odd |
| Both strictly climbing or descending | 400 | exactly one meeting each |
| One strictly, one with rests | 400 | exactly one meeting each |
| Leaving and arriving at different hours | 2,000 | every pair meets |
| The lab's walks, dragged in steps of 0.05 | 3,000 | every pair meets; passes always odd |
The staircase is checked for every pair of walks, 6,476 pairs on the mountains in the table above, not for a sample. The universal chord is found exactly on 2,000 random climbs for every up to , and Lévy's walks are checked to climb the same amount over every stretch, and to keep climbing, at 20,000 points each.
The lab runs the functions in site/lib/monks-core.mjs, the same text the script imports, and the script checks the pasted copy against the module on 3,000 pairs of the lab's own walks, half of them dragged to heights in steps of 0.05 so that ties, shared rests and touches turn up: 34 of them meet along a stretch and 489 more than once, and every one meets.
Only trivially. He is at the foot at dawn and at the top at dusk both times, so those are meetings, but there need be none in between: a fast climb stays ahead of a slow one all day. The script's example, one climb halfway up by a tenth of the day and the other by nine-tenths, meets only at dawn and at dusk.
No. Each pair of up and down meets, but at different times. Climb to 0.8 of the way up by 0.2 of the day on day one, walk down at a steady pace on day two, and climb to only 0.2 by 0.8 of the day on day three. Day one meets day two at 0.2 of the day, day three meets it at 0.8, and the two climbs are never together between dawn and dusk.
Yes to the first: it is the universal chord with . Not necessarily to the second: 20 minutes is two-fifths of the run, and a runner on Lévy's schedule covers exactly 3.6 km in every 20-minute stretch, while running forwards the whole time.
The gap is then strictly increasing: if then and , so . It is zero at least once by proof one, and a strictly increasing function cannot be zero twice.