Lambdia

A Snail, a Ten-Foot Pole, and Two Thirds of the Fifth Day

Three feet up each day, one foot back each night, ten feet to climb. Dividing ten by the net two feet a day gives five days, and it charges the snail for a night it never spends. The dawn heights settle the day, the last climb settles the moment, and the closed form the video had no room to voice is a single ceiling function.

A snail climbs a pole 1010 feet tall. During each day it climbs 33 feet, and during each night it slides back 11. It starts at the bottom at dawn. When does it reach the top?

The answer is two thirds of the way through the fifth day, which is 14/314/3 days of elapsed time. Almost everyone says the end of day five, and the interesting thing is that they get there by a method which is correct for the first four days and silently wrong on the fifth.

Where five days comes from

Each full cycle of a day and a night nets

31=2 feet3 - 1 = 2 \text{ feet}
(1)

so ten feet at two feet a day is five days. The division is right, the units are right, and the model behind it is wrong, because it charges the snail for a night it never spends. Once the snail touches the top it is done. There is no fifth night, so the fifth cycle is never completed, so the net rate of two feet a day never applies to it.

A useful way to hear the error: the net-rate model describes the trajectory correctly at dawn, and only at dawn. Between dawns the snail is above its net-rate position, sometimes by as much as three feet, and the finish line is crossed between dawns.

The dawn ladder

Sample the height once a day, at first light, and the sequence is as simple as it gets. Let hkh_k be the height at dawn on day kk, with h1=0h_1 = 0. One full cycle adds 31=23 - 1 = 2, so

hk+1=hk+2hk=2(k1)h_{k+1} = h_k + 2 \quad \Longrightarrow \quad h_k = 2(k-1)
(2)

an arithmetic progression with common difference two. The dawn heights are 0,2,4,6,8,10,0, 2, 4, 6, 8, 10, \dots and the daylight peak of day kk is

hk+3=2k+1h_k + 3 = 2k + 1
(3)

so the peaks are 3,5,7,9,11,3, 5, 7, 9, 11, \dots. Now read off the answer. Day four peaks at 99, which is short. Day five opens at 88 and peaks at 1111, which clears the top. No day before the fifth can finish the job and the fifth does, which fixes the day without any further work.

Two sequences, two jobs

The dawn heights hk=2(k1)h_k = 2(k-1) say where the snail restarts each morning. The daylight peaks 2k+12k+1 say how high it gets before the slide. The first sequence tells you the answer is not four; the second tells you it is five.

The last day has no night

On the morning of day five the snail is at 88 feet and needs 22 more. It has 33 feet of climbing available. Spread the climb evenly across the daylight and the top arrives at

1083=23\frac{10 - 8}{3} = \frac{2}{3}
(4)

of the way through day five's climb. Total elapsed time is therefore

4+23=1434.67 days4 + \frac{2}{3} = \frac{14}{3} \approx 4.67 \text{ days}
(5)

and the reflex answer overshoots by exactly 514/3=1/35 - 14/3 = 1/3 of a day. The fraction in (4) is strictly between 00 and 11, which is what makes the honest answer a moment inside a day rather than the end of one.

Fig. 1 — Five climbs, four nights. The fifth climb crosses the line, so the fifth night never happens.

One caveat on (4), because it is the only place this puzzle can be legitimately argued with. "Two thirds of the way through day five" means two thirds of that day's three-foot climb. If you want it to mean two thirds of the calendar day you have to assume the climb fills the daylight and the daylight fills the day, which the problem never says. The fraction of the climb is 2/32/3 under any reading; the fraction of the clock depends on a detail the puzzle leaves open.

The general pole

Replace the numbers with a height HH, a daily climb cc and a nightly slide ss, with c>sc > s so the snail makes progress at all. Dawn heights become hk=(k1)(cs)h_k = (k-1)(c-s), and the snail finishes on the first day whose dawn satisfies hk+cHh_k + c \ge H. Solving for kk:

D  =  Hccs+1  =  HscsD \;=\; \left\lceil \frac{H-c}{c-s} \right\rceil + 1 \;=\; \left\lceil \frac{H-s}{c-s} \right\rceil
(6)

The two forms are the same number, since (Hc)/(cs)+1=(Hs)/(cs)(H-c)/(c-s) + 1 = (H-s)/(c-s) and the ceiling of a value plus an integer is the ceiling plus that integer. The second form is the one to remember. At H=10H = 10, c=3c = 3, s=1s = 1 it reads 9/2=5\lceil 9/2 \rceil = 5, and the moment inside that day is

elapsed  =  (D1)  +  H(D1)(cs)c\text{elapsed} \;=\; (D-1) \;+\; \frac{H - (D-1)(c-s)}{c}
(7)

which returns 14/314/3 here. Equation (6) was deliberately kept off screen in the video: reading a ceiling function out loud costs more narration than it is worth in under a minute, and a symbol nobody voices is a symbol viewers stop watching over. It belongs in writing.

Fig. 2 — The naive H/2 is never an underestimate. It lands on the right day whenever H is even, which is exactly why the ten-foot version fools people.

Fig. 2 shows the error is systematic. The staircase (H1)/2\lceil (H-1)/2 \rceil never rises above the line H/2H/2, so the net-rate answer is never too small. For even HH the two agree on the day, which is the whole reason the ten-foot version is such a good trap: the reflex names the right day and the wrong moment inside it, and being half right is far more convincing than being wrong. For odd HH the reflex misses the day too, and the snail crosses exactly at dusk, since equation (7) then returns a fraction of one. At H=11H = 11 the answer really is the end of day five.

Where the closed form stops working

Equation (6) needs two conditions, and both are worth stating because they are the sort of thing an interviewer will probe.

First, c>sc > s. If the snail climbs no more than it slides it either finishes on day one, when HcH \le c, or never, and the quotient in (6) is meaningless or negative.

Second, H>sH > s. Below that the ceiling goes negative and (6) returns zero or less, which is not a day. The failure is not in the algebra but in the model: a pole shorter than one night's slide is finished before the first night is reached, and the formula was built by counting nights. Everywhere in the band s<Hcs < H \le c the formula correctly returns day one, which covers the whole no-night regime, so the only real exclusion is the degenerate HsH \le s.

The trap has a name and a large family

This is an off-by-one error dressed as a rate problem. The general shape: a process repeats a cycle, the cycle has a forward part and a backward part, and the process stops mid-cycle. Any model that charges every cycle in full will overshoot by exactly the unspent backward part.

The same structure turns up in a bacterial culture that is harvested the moment it crosses a threshold, in a debt that is paid off partway through a billing period, and in loops that check their exit condition in the middle of the body rather than at the end. The fix is always the same and it is not a formula. Ask what happens on the last iteration, separately, before you divide anything.

Sources and further reading

Every number above was checked before publication two ways: symbolically, and by a step-by-step walk that moves the snail on a grid of 100,000100{,}000 steps per day and knows no formula at all. The walk and equation (6) were then compared across 11201120 parameter triples, with HH from 11 to 4040 and every s<c7s < c \le 7, and they agreed on all of them.

Commentaires · 0

Sois le premier à commenter.