Probability

The last passenger gets one of two seats

A hundred passengers board a plane with a hundred seats. The first has lost the boarding pass and sits anywhere; everyone after takes their own seat if it is free and a random free seat if not. The last passenger to board finds their own seat free with probability exactly one half — for a hundred passengers, for two, for any number — and if it is not free, they get the first passenger's seat, never any other. Along the way about four passengers are displaced, and one more than that number is distributed exactly like the number of cycles in a shuffled deck.

Worth reading first: A restaurant and a shuffled deck · The one that hardly ever comes up.

A plane has a hundred seats and a hundred passengers — a seating problem far kinder than the round table where no couple may sit together — each holding a ticket for a different seat, and they board one at a time in the order of their seat numbers. The first passenger has lost their boarding pass and sits in a seat chosen at random. Every passenger after that goes to their own seat; if it is free they sit in it, and if someone is already there they choose one of the remaining free seats at random. What is the probability that the last passenger to board finds their own seat free?

The question circulates as a puzzle because the answer, one half, looks as if it should depend on the number of passengers and does not. The usual argument for it is a single observation, and it is a good one. But the puzzle has more in it than the one number. The way the displacements propagate through the cabin is a small Markov chain; the probability that any particular passenger is displaced has an exact form; and the total number of displaced passengers has a distribution that turns out to be a famous one from a completely different setting.

Every number below is computed exactly, as a fraction, from the chain, and every one is checked against two hundred thousand simulated boardings. The simulations are there to show the exact answers describe what actually happens, and the exact answers are there because a simulation can only ever estimate.

A chain of displacements

The lost boarding pass as a chain. n=8: P(last seat free) = 1/2
Fig. 1 The boarding of eight passengers as a chain whose state is the displaced passenger now choosing. From every state, seat 1 and seat 8 are two of the equally likely choices, so the chain is as likely to end at one as the other.

The structure of the boarding is simpler than its description. At any moment, the passengers who have boarded are all seated, and the free seats are of two kinds: the seats of passengers who have not yet boarded, and possibly seat 1, the first passenger’s own. A displaced passenger — one who finds their seat taken — is the only kind who makes a choice, and the choice is among exactly those free seats. Choosing seat 1 ends the trouble: every later passenger finds their own seat free, because seat 1 was the only seat out of place. Choosing the seat of some later passenger jj makes jj the next displaced passenger, and everyone between boards normally.

So the boarding is a chain that jumps forward through the cabin — a Markov chain in the sense of the rule that forgets where it came from, since where it jumps next depends only on where it is. The figure draws it for eight passengers. Passenger 1 chooses uniformly among all eight seats; a displaced passenger kk chooses uniformly among seat 1 and the seats of passengers k+1k + 1 to 88. The chain ends in one of two ways: someone takes seat 1, and the last passenger sits at home; or someone takes seat 8 before seat 1 has been taken, and the last passenger, arriving to find their seat occupied, has only seat 1 left.

The argument for one half is now visible. At every step of the chain, seat 1 and the last passenger’s seat are both among the free seats, and both are equally likely to be chosen. Any other choice merely moves the chain along and repeats the same situation with fewer options. So whichever of the two special seats is taken first is equally likely to be either, and the last passenger’s seat is free with probability exactly 12\tfrac12. The exact computation in rational arithmetic gives 12\tfrac12 for eight passengers, for a hundred, and for every number checked.

One boarding, seat by seat

One boarding of twenty passengers. seed 3: chooser seats 7,10,20,1; displaced 7,10,20; last in 1
Fig. 2 One boarding of twenty passengers. The curves join each passenger who had to choose to the seat they chose; passengers 7, 10 and 20 are displaced, and the last ends up in seat 1.

The chain is easier to believe when one run of it is drawn. In the boarding shown, passenger 1 chooses seat 7. Passengers 2 to 6 sit in their own seats. Passenger 7 finds their seat taken and chooses seat 10; passengers 8 and 9 sit normally; passenger 10 chooses seat 20; passengers 11 to 19 sit normally; passenger 20, the last, finds seat 20 taken and has only seat 1 left. Three passengers were displaced, and everybody else sat exactly where their ticket said.

The picture shows two facts that the puzzle’s statement hides. First, the displacements form a single chain: there is never more than one displaced passenger at a time, because each one is created only by the choice of the previous one. Second, everyone who is not on the chain sits in their own seat. The final seating differs from the correct one by a single cycle — seat 1 taken by passenger 7, seat 7’s passenger in seat 10, seat 10’s in seat 20, and passenger 20 in seat 1. That cycle is what the chain draws, and its length is the number of displaced passengers plus one.

That observation is the key to everything that follows. The last passenger’s seat ends up in one of only two places: occupied by its owner, or by somebody on the chain, in which case its owner is the last link and takes seat 1. No third outcome is possible, since every other seat has been claimed by the time the last passenger boards.

Who finds their seat taken

Who finds their seat taken. 2: exact 0.0100 sim 0.0103; 50: exact 0.0192 sim 0.0189; 90: exact 0.0833 sim 0.0832; 99: exact 0.3333 sim 0.3329; 100: exact 0.5000 sim 0.5014
Fig. 3 For a hundred passengers, the probability that passenger k finds their seat taken, exactly 1/(n − k + 2), with the simulated share on each bar. It is one in a hundred for the second passenger and one in two for the last.

The symmetry that gave one half for the last passenger works for any passenger. When passenger kk boards, their seat is taken exactly if the chain has jumped to it, and before that moment, at every step, the seats of passengers k,k+1,…,nk, k+1, \ldots, n and seat 1 were all equally likely to be the next one taken. Passenger kk’s seat is displaced if it is taken before seat 1 and before any of the seats from k+1k + 1 to nn that would have stopped the chain from reaching it — which, by the same symmetry, amounts to kk’s seat being the first of the n−k+2n - k + 2 seats {1,k,k+1,…,n}\{1, k, k+1, \ldots, n\} to be chosen. The probability is 1/(n−k+2)1/(n - k + 2).

The figure plots it for a hundred passengers. The second passenger is displaced with probability 1100\tfrac{1}{100}, exactly the chance that passenger 1 chose seat 2. The fiftieth is displaced with probability 152\tfrac{1}{52}, the ninetieth 112\tfrac{1}{12}, the ninety-ninth 13\tfrac13, and the last 12\tfrac12. Most of the risk is concentrated in the last few passengers, because the chain, once started, tends to move forward in large jumps and to finish near the back. The dots are the shares of 200,000 simulated boardings in which each passenger was displaced, and they sit on the bars within the statistical noise.

Adding the probabilities gives the expected number of displaced passengers: ∑k=2n1n−k+2=12+13+⋯+1n=Hn−1\sum_{k=2}^{n} \frac{1}{n-k+2} = \tfrac12 + \tfrac13 + \cdots + \tfrac1n = H_n - 1, where HnH_n is the harmonic number of order nn. For a hundred passengers that is about 4.19. The harmonic number is the signature of a process in which, at each of nn stages, an event of probability 1/j1/j can happen — the same signature as in how long until every one turns up, where collecting the last of nn coupons takes nHnn H_n draws.

The distribution of the count

How many passengers are displaced. mean 4.1874; P: 0.0100,0.0518,0.1259,0.1930,0.2112,0.1767,0.1182,0.0651,0.0302; sim 0.0102,0.0519,0.1269,0.1928,0.2104,0.1760,0.1190,0.0653,0.0299
Fig. 4 The exact distribution of the number of passengers displaced in a boarding of a hundred, against 200,000 simulated boardings. Its mean is H100−1H_{100} - 1, and one more than the count is distributed exactly like the cycles of a random shuffle of a hundred.

The expected number is only one summary of the count, and the whole distribution can be computed exactly by following the chain: from each state, the probability of each eventual number of displacements is an average over the possible next choices, and the recursion runs over at most a hundred states. The figure plots the result as bars, in exact rational arithmetic converted to decimals at the end, with the simulated frequencies as dots. Nobody is displaced with probability 1100\tfrac{1}{100}, which is the chance that passenger 1 happened to pick their own seat. One passenger is displaced with probability 0.0518, two with 0.1259, and the most likely number is four, with probability 0.2112.

These numbers are not new. The probability that a uniformly random permutation of a hundred objects has exactly cc cycles is [100c]/100!\left[{100 \atop c}\right] / 100!, where the bracket is the unsigned Stirling number of the first kind; for one cycle it is 1100\tfrac{1}{100}, for two it is H99/100≈0.0518H_{99}/100 \approx 0.0518. The computation confirms that the probability of dd displaced passengers is exactly the probability that a random permutation of a hundred has d+1d + 1 cycles, for every dd, as equal fractions, not merely as close decimals.

This is the genuinely surprising connection, and it has a short explanation. The number of cycles of a random permutation is a sum of independent events of probabilities 1,12,13,…,1n1, \tfrac12, \tfrac13, \ldots, \tfrac1n, which is how a restaurant and a shuffled deck built a random permutation one element at a time: each newcomer either starts a new cycle, with probability 1/j1/j, or joins an existing one. The boarding has exactly the same structure. Passenger kk is displaced with probability 1n−k+2\tfrac{1}{n-k+2}, and the events turn out to be independent, so the count of displacements, with one added for passenger 1, is a sum of independent events with probabilities 1,12,…,1n1, \tfrac12, \ldots, \tfrac1n. The same law that governs a hundred prisoners and one shuffle — where a random permutation’s cycle structure decides whether all hundred survive — governs how many people on a hundred-seat plane are moved.

Where the last passenger sits

Where the last passenger sits. 2: own 0.497 seat1 0.503; 3: own 0.503 seat1 0.497; 4: own 0.500 seat1 0.500; 5: own 0.498 seat1 0.502; 10: own 0.495 seat1 0.505; 20: own 0.504 seat1 0.496; 50: own 0.504 seat1 0.496; 100: own 0.501 seat1 0.499
Fig. 5 Where the last passenger sits, in 20,000 simulated boardings for each number of passengers from 2 to 100: their own seat or passenger 1’s, and no other ever. The split is one half each at every size.

The answer to the original question can be checked as directly as it can be stated. For each number of passengers from 2 to 100, twenty thousand boardings were simulated and the last passenger’s seat recorded. In every one of the 160,000 boardings the last passenger sat either in their own seat or in seat 1 — no other seat ever occurred — and the share in their own seat is within sampling error of one half at every size: 0.497 for two passengers, 0.500 for four, 0.495 for ten, 0.501 for a hundred. The exact computation gives precisely 12\tfrac12 at every size.

The case of two passengers is the one that makes the answer obvious. Passenger 1 takes one of two seats at random; if it is their own, passenger 2 sits at home; if not, passenger 2 gets seat 1. Half and half. The surprise is that adding ninety-eight passengers in between changes nothing about the last one’s chances. Every additional passenger adds possible paths for the chain, but each path preserves the balance between the two special seats, and the balance is all that the last passenger’s fate depends on.

There is a second way to see it, without the chain. Consider the moment at which the first of the two special seats — seat 1 and seat nn — is taken. Until then both are free, and every chooser treats all free seats alike, so neither has any advantage. If seat 1 goes first, the last passenger sits at home; if seat nn goes first, the last passenger is displaced. A fair coin is tossed between them, though it may take a long time to land.

Symmetry in place of a calculation

The half comes from a symmetry rather than from a sum, and the two kinds of argument behave very differently when the problem changes. A calculation — follow the chain, add up the probabilities of every path — gives the answer for the problem as stated and has to be redone for any variation. A symmetry argument gives the answer for every problem that preserves the symmetry, and says immediately which variations will break it. Here, any rule for displaced passengers that treats seat 1 and the last seat alike, however it treats the others, leaves the last passenger’s chance at one half; any rule that favours one of them moves it.

The same pattern runs through a good deal of elementary probability, and it is often where intuition goes wrong. In gambler’s ruin, a fair game started halfway between two barriers hits each first with probability one half, by the same reflection; started elsewhere, the answer is linear in the starting point, which is the symmetry applied to a walk that is not centred. In the Monty Hall problem the symmetry between the two closed doors that tempts people to say one half is broken by the host’s knowledge, and the correct answer, two thirds, is what remains when the broken symmetry is accounted for. The boarding puzzle is the opposite case: it looks as if the many passengers in between must break the symmetry, and they do not.

The independence behind the cycle count is a symmetry of the same kind, one step deeper. When the chain stands at passenger kk, its future depends only on which seats are free, and those are seat 1 and the seats from k+1k + 1 on, whatever path led there. So the chain forgets its past, each potential displacement is decided afresh, and the events add up as independently as the coin flips of the coupon collector do in the case of equal chances. The answer to the original puzzle and the identification with permutations are two readings of one fact: that a uniformly random choice among the free seats carries no memory.

What a uniform choice is assuming

The simulations show the exact answers describe the process; the exact computations show the answers are what they are for every size checked. Neither shows why they hold for every number of passengers, which is the symmetry argument — and that argument is the only part of the essay that is a proof. Its key step, that every chooser treats all free seats alike, is an assumption of the model. Real passengers who find their seat taken do not choose uniformly; they choose a nearby seat, or ask the flight attendant, or move the intruder, and any rule that treats seat 1 and the last seat differently breaks the half.

The figures also cannot show independence directly. The identification with cycles of a random permutation is an equality of two finite lists of fractions, checked exactly for a hundred passengers. That the events “passenger kk is displaced” are independent for different kk is what makes it true for every nn, and that requires an argument about the chain — the probability of jumping from kk to jj does not depend on how the chain reached kk — rather than a computation.

Finally, the model fixes the boarding order to match the seat numbers. If passengers board in a random order, the first passenger’s seat is still the only one out of place and the argument carries over, but the passengers’ positions in the queue and their seat numbers become two different things, and the question “who is displaced” has to be asked about one or the other.

Still open: other rules for choosing a seat

The puzzle’s variants are where the open questions lie, and most are about rules that break the symmetry. Suppose each displaced passenger, instead of choosing uniformly, takes the nearest free seat, or the first free seat towards the front; then the chain moves differently, the last passenger’s chance is no longer one half, and in several such variants no simple formula is known. Suppose several passengers have lost their passes, or each passenger independently ignores their ticket with some small probability; then the displacements need not form a single chain, and the analysis becomes one of interacting chains, for which only partial results and computations exist.

There is also a question about the shape of the chain itself. The expected number of displaced passengers grows like ln⁡n\ln n, so on a very large plane a typical boarding displaces only a handful of people. But which handful? The probability 1/(n−k+2)1/(n - k + 2) says the displaced are concentrated near the back, and the cycle analogy says the cycle lengths of a random permutation, scaled by nn, follow the stick-breaking law. Whether the positions of the displaced passengers, scaled by the number of seats, converge to a similarly clean limit, and what it is, is answerable from the independence — it is the kind of question that the identification with cycles turns from a puzzle into a calculation.

A coin between two seats

The last of nn passengers finds their own seat free with probability exactly 12\tfrac12, for every n≥2n \ge 2, and otherwise sits in the first passenger’s seat — never any other. The boarding is a chain of displacements in which, at every step, seat 1 and seat nn are two of the equally likely choices, so whichever is taken first is a fair coin. Passenger kk is displaced with probability 1/(n−k+2)1/(n-k+2), so the expected number displaced is Hn−1H_n - 1, about 4.19 for a hundred; and one more than the number displaced has exactly the distribution of the number of cycles of a random permutation of nn, checked as equal fractions for a hundred passengers and confirmed by 200,000 simulated boardings. The puzzle is a shuffled deck seen from the aisle.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

ExpectationHarmonic numberMarkov chainRandom permutationSimulationStirling numberSymmetry argument