Lambdia

3.6 Flips, Not 4, and the Beautiful Argument That Says Otherwise

A pebble climbing four boxes on coin flips needs 18/5 flips on average, and the two-line renewal argument that gives 4 is wrong. Its premise is true, since half of all games really do end on flip two, but the non-finishing half is two different states: tails-tails sends the pebble home while heads-heads leaves it on box 3, one flip from the exit and worth only 14/5.

Four boxes stand in a row and a pebble sits in the first one. Flip a fair coin. Heads moves the pebble forward one box, tails forward two. If a move would carry it past box 4, the pebble goes back to box 1 instead. The game stops the moment the pebble lands exactly on box 4. How many flips does that take on average?

There is a two-line argument for this problem that produces the answer 4, and it is good enough that it has been printed as the solution. It is wrong. The answer is 18/5=3.618/5 = 3.6. What makes the problem worth an article rather than a footnote is that the wrong argument is not a slip. Every sentence in it is true except the one nobody writes down.

The argument that gives 4

Group the flips into rounds of two. From box 1 there are four equally likely two-flip outcomes. Heads then tails puts the pebble on box 4, since 1+1+2=41 + 1 + 2 = 4. Tails then heads also puts it on box 4. So a round finishes the game with probability 1/21/2, and that number is exactly right.

Now the shortcut. If half of all rounds finish, the game takes two rounds on average, so it takes four flips. Written as an equation, with EE the average number of flips from the start:

E=2+12EE=4E = 2 + \tfrac{1}{2}\,E \quad\Longrightarrow\quad E = 4
(1)

You pay two flips no matter what, and with probability 1/21/2 you find yourself starting over. That is the renewal argument, and for a great many problems it is the fastest correct route there is. Roll a die until a six appears and the same reasoning gives E=1+56E=6E = 1 + \tfrac{5}{6}E = 6, which is the truth.

The failed round does not start over

Look at the other two outcomes. Tails then tails moves the pebble to box 3 and then tries to move it to box 5, which overshoots, so the pebble goes back to box 1. That half of the failure really is a fresh start. Heads then heads is different: the pebble walks to box 2 and then to box 3, where it is one heads away from finishing. It kept its progress.

Fig. 1 — After two flips the pebble is in one of three situations, not two. The shortcut treats the bottom two rows as the same row.

So equation (1) charges the pebble a full fresh start for an outcome that left it one flip from the door. It over-prices half of the failures. The answer it returns is too big, and the error turns out to be exactly 2/52/5 of a flip.

When a round really renews

A round-based equation of the form E=L+(1q)EE = L + (1-q)E, where LL is the length of a round and qq the chance it finishes, is valid only if every non-finishing outcome returns the process to the state it started from. Any outcome that keeps partial progress must be priced separately, at its own expected cost.

Three unknowns instead of one

The reliable route is to stop thinking about rounds and give every position its own unknown. Write EkE_k for the average number of flips still needed when the pebble sits in box kk, so E4=0E_4 = 0. One flip is spent, and then the pebble is somewhere new:

E1=1+12E2+12E3,E2=1+12E3,E3=1+12E1E_1 = 1 + \tfrac{1}{2}E_2 + \tfrac{1}{2}E_3, \qquad E_2 = 1 + \tfrac{1}{2}E_3, \qquad E_3 = 1 + \tfrac{1}{2}E_1
(2)

The middle equation loses a term because tails from box 2 lands on box 4 and ends the game. The right-hand equation is the interesting one: tails from box 3 would reach box 5, so the pebble is sent home and pays E1E_1 all over again. Box 2 is the only place where an overshoot is impossible, which is why the restart arrow in this problem only ever leaves box 3.

Substitute E3=1+E1/2E_3 = 1 + E_1/2 into E2E_2 to get E2=32+E1/4E_2 = \tfrac{3}{2} + E_1/4, then feed both into the first equation: E1=94+38E1E_1 = \tfrac{9}{4} + \tfrac{3}{8}E_1, so 58E1=94\tfrac{5}{8}E_1 = \tfrac{9}{4}.

E1=185=3.6,E2=125,E3=145E_1 = \frac{18}{5} = 3.6, \qquad E_2 = \frac{12}{5}, \qquad E_3 = \frac{14}{5}
(3)

There is the number the shortcut needed and did not have. Box 3 is worth 14/514/5, cheaper than the start at 18/518/5, and keeping a quarter of the probability mass in that cheaper place is what drags the answer below 4.

Repairing the shortcut without abandoning it

The round idea can be saved. Every round is exactly two flips, and after it the pebble has finished with probability 1/21/2, sits in box 3 with probability 1/41/4, or sits in box 1 with probability 1/41/4. Price each branch at its own value:

E1=2+14E1+14E3=2+14185+14145=185E_1 = 2 + \tfrac{1}{4}E_1 + \tfrac{1}{4}E_3 = 2 + \tfrac{1}{4}\cdot\tfrac{18}{5} + \tfrac{1}{4}\cdot\tfrac{14}{5} = \tfrac{18}{5}
(4)

Same round, same two flips, and now the answer agrees with equation (3). Comparing (1) with (4) shows exactly what the shortcut did: it wrote 12E1\tfrac{1}{2}E_1 where the honest bookkeeping wants 14E1+14E3\tfrac{1}{4}E_1 + \tfrac{1}{4}E_3.

How long the game actually runs

Pushing the exact distribution forward in fractions gives the chance that the finishing flip is the second, third, fourth and so on. The game ends on flip two half the time, and the tail decays geometrically after that.

Fig. 2 — The distribution of the finishing flip. Half of all games are over in two flips, which is precisely the true premise the wrong argument was built on.

Summing tPr(T=t)t \cdot \Pr(T = t) over this distribution returns 18/518/5 exactly, which is a check worth doing because it shares no algebra with the linear system. Notice also that the median is 2 while the mean is 3.6. The restart from box 3 is rare and expensive, and it is the whole reason the average sits so far above the typical game.

The answer depends on the rule you read

This problem is unusually sensitive to how the overshoot is phrased, so it is worth being explicit. Three readings, three different answers:

  • An overshoot sends the pebble back to box 1, which is the version above: 18/5=3.618/5 = 3.6.
  • An overshoot is simply forbidden and the pebble stays put, wasting the flip: 33 exactly.
  • The game ends as soon as the pebble reaches or passes box 4: 9/4=2.259/4 = 2.25.

If someone hands you this problem out loud, the overshoot rule is the thing to pin down before writing anything. Two of those three answers are perfectly defensible solutions to a problem you were not asked.

More boxes

With nn boxes and the same rules, the same first-step method gives a system of n1n-1 equations. The value from box 1 climbs unevenly because the restart penalty depends on how the parities line up:

E1(3)=2,E1(4)=185,E1(5)=4611,E1(6)=387,E1(7)=27043,E1(10)=3186341E_1(3) = 2,\quad E_1(4) = \tfrac{18}{5},\quad E_1(5) = \tfrac{46}{11},\quad E_1(6) = \tfrac{38}{7},\quad E_1(7) = \tfrac{270}{43},\quad E_1(10) = \tfrac{3186}{341}
(5)

No round-based shortcut survives any of these, for the same reason it failed at n=4n = 4. What does survive is the method. Name one unknown per state, write one equation per state, and let the algebra find out which states are cheap.

The chain here is an absorbing Markov chain with three transient states, and equation (2) is the standard system for its expected absorption time. Nothing in the derivation needed that vocabulary, which is a good sign about the derivation. But knowing the name is useful, because the moment a problem has more than four or five states the matrix form is faster than hand elimination.

Sources and further reading

Every number here was checked three ways before publication: the exact distribution of the finishing flip in rational arithmetic, the linear system eliminated by hand, and four million seeded plays of the literal rules, which came back at 3.5992.

Comments · 0

Be the first to comment.