The Ladybug's Last Number
A MoMath Mindbender suggested by Richard Stanley: a ladybug starts on the 12 of a clock face and steps to a random neighbour at each strike until she has visited every number. The last new number is the 6 with probability 1/11, because on a cycle every vertex other than the start is equally likely to be last, and the 6 sitting opposite the 12 counts for nothing.
Problem
A ladybug alights on the 12 of a cuckoo clock. Whenever the clock strikes, she moves randomly to a neighbouring number, so the first time, she moves to the 1 or the 11 with equal probability. Suppose the ladybug continues this process until she has been to all of the numbers at least once. What is the probability that the last new number she visits is 6?
Credit: Peter Winkler, Monthly Mindbenders, National Museum of Mathematics, January 2026, problem suggested by Richard Stanley.
Setting it up
Label the numbers , writing for the 12 and reading all arithmetic modulo . The clock face is then the cycle , and the ladybug performs a simple random walk on it from . Everything below works on for any : the clock is the case , and the 6 is the vertex .
What has been seen is always a block
At every moment the set of numbers already visited is a block of consecutive numbers containing the start. This holds at the outset, when the set is . Suppose it holds now. The ladybug stands somewhere in the block, and her next step lands on a neighbour: either on a number already in the block, which changes nothing, or on a fresh number, which can only happen when she is standing at one end of the block and steps outward, extending it by one. Either way the visited set is again a block. Induction does the rest.
To be last is to be surrounded
Fix a target with neighbours and . Then
One direction is immediate: if is last then in particular and came earlier. For the other, suppose and have both been visited while has not. At that moment the visited set is a block containing , and but avoiding , so it sits inside the arc running from round to the long way, which is exactly the complement of . A block of consecutive numbers that lies in that arc and contains both of its ends is the whole arc. So every number except has been visited, and is last.
Cutting the cycle at the target
The only ways into are through and . Until the moment she first steps onto , therefore, the ladybug is walking on the path obtained by deleting from the cycle, which has vertices. Number its positions with , so that position is and position is . This path is not reflecting at its ends: from or the ladybug steps onto with probability , and that ends the question.
Let be the first time she stands on or on . She cannot have visited by time , since reaching requires standing on an end first. (If happens to neighbour the start, then the start is itself an end and .) So at time she is at one end of the path, is untouched, and the surviving question is whether she reaches the far end before slipping into .
Suppose she is at ; the case of is the mirror image. Write The next strike sends her to with probability , which fails, and inward to position with probability . From position the walk is an ordinary gambler’s ruin on : starting at , the chance of reaching before is , so from she reaches first with probability and returns to first with probability . A return to leaves her exactly as she was, with still unvisited, so the same applies again. Hence and rearranging gives , that is,
The same value comes out of the mirrored case. Since the two cases exhaust the possibilities at time ,
Nothing about survived the calculation. On , with the ladybug starting at the 12,
Why the position of the 6 does not matter
The general statement is worth recording, since the clock is only an instance of it.
Proposition. Let a simple random walk on the cycle start at a vertex and run until every vertex has been visited. Each of the other vertices is the last new vertex with probability .
The eleven probabilities on the clock face add to , as they must, and the 12 is never last because it is where the ladybug began. A quick sanity check at the small end: on a triangle, the walk’s first step picks one of the two non-start vertices and the other is last, so each is last with probability .
The surprise is that the distance from 12 to 6 plays no part, and the proof shows precisely where that distance goes. It decides which neighbour of the target the ladybug meets first, and nothing else: the race from that neighbour, the long way round to the other one and without falling into en route, is worth from either end.
There is a plainer way to feel it. A number next to the start, say the 1, has one of its neighbours visited for free at time zero, but the walk must then make its way almost the whole distance round the face to the 2, and every time it comes back to the 12 or arrives at the 2 it risks stepping onto the 1 and spoiling the attempt. A number opposite the start, like the 6, gets no free neighbour, but neither of its two neighbours is far away. Being distant helps a number get surrounded from the near side and hurts it on the far side, and the ruin calculation is the statement that the two effects cancel exactly, not approximately. That the 6 sits diametrically opposite the 12 is a red herring, and a good one.
| Quantity | Value |
|---|---|
| , any | |
| general cycle , any vertex other than the start |
Computational verification
The argument is short enough to be suspicious, and its one delicate step, that a block of visited numbers containing both neighbours of must already be everything but , is exactly the sort of claim a simulation can embarrass. So the check throws the theory away: walk the clock face by the rules, stop on the strike that completes the set, and record which number that was. What matters in the output is not the single figure for the 6 but the flatness of the whole profile.
import numpy as np
rng = np.random.default_rng(20260116)
N, n, TARGET = 200_000, 12, 6
def last_new(): # walk from the 12 until every number is seen
pos, seen = 0, {0}
while len(seen) < n:
pos = (pos + 2*int(rng.integers(0, 2)) - 1) % n
seen.add(pos)
return pos # the number reached on the covering strike
counts = np.zeros(n, dtype=int)
for _ in range(N):
counts[last_new()] += 1
p = counts / N
print(f"P(last = 6) = {p[TARGET]:.4f} 1/11 = {1/11:.4f}")
print("profile 1..11 = " + " ".join(f"{x:.4f}" for x in p[1:]))
print(f"widest gap across the eleven = {p[1:].max() - p[1:].min():.4f}")
# P(last = 6) = 0.0914 1/11 = 0.0909
# profile 1..11 = 0.0896 0.0919 0.0906 0.0912 0.0907 0.0914 0.0908 0.0910
# 0.0903 0.0914 0.0913
# widest gap across the eleven = 0.0023
With walks the standard error on each entry is about , so a spread of across eleven numbers is what a flat profile looks like from this distance. No number on the face is favoured, and the 6 least of all.