Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is a neat little problem that I was discussing today with my lab group out at lunch. Not particularly difficult but interesting implications nonetheless

Imagine there are a 100 people in line to board a plane that seats 100. The first person in line realizes he lost his boarding pass so when he boards he decides to take a random seat instead. Every person that boards the plane after him will either take their "proper" seat, or if that seat is taken, a random seat instead.

Question: What is the probability that the last person that boards will end up in his/her proper seat.

Moreover, and this is the part I'm still pondering about. Can you think of a physical system that would follow this combinatorial statistics? Maybe a spin wave function in a crystal etc...

share|cite|improve this question
To make an analogy between this puzzle and a physical system, you would need to think of some system where particles or objects have "assigned locations" (separate from their actual location). This is not typically the case in physics, which usually concentrates only on how things actually are, and the dynamics of how things change. – Matt Feb 28 '15 at 11:45
Thank you for using "his/her" at least once in the problem statement. The prose on this page is pretty male-biased otherwise. – Greg Martin May 26 at 18:02

10 Answers 10

up vote 44 down vote accepted

This is a classic puzzle!

The answer is that the probability that the last person ends in up in his proper seat is exactly $\frac{1}{2}$

The reasoning goes as follows:

First observe that the fate of the last person is determined the moment either the first or the last seat is selected! This is because the last person will either get the first seat or the last seat. Any other seat will necessarily be taken by the time the last guy gets to 'choose'.

Since at each choice step, the first or last is equally probable to be taken, the last person will get either the first or last with equal probability: $\frac{1}{2}$.

Sorry, no clue about a physical system.

share|cite|improve this answer
This is a good intuitive way to think about it. A formal proof is too heavy for a over-a-cup-of-coffee discussion, this is just right. I'll give you the credit since nobody seems to want to take a shot at the physical application – crasic Sep 29 '10 at 8:23

Here is a rephrasing which simplifies the intuition of this nice puzzle.

Suppose whenever someone finds their seat taken, they politely evict the squatter and take their seat. In this case, the first passenger keeps getting evicted (and choosing a new random seat) until, by the time everyone else has boarded, he has been forced by a process of elimination into his correct seat.

This process is the same as the original process except for the identities of the people in the seats, so the probability of the last boarder finding their seat occupied is the same.

When the last boarder boards, the first boarder is either in his own seat or in the last boarder's seat, which have both looked exactly the same (i.e. empty) to the first boarder up to now, so there is no way the poor first boarder could be more likely to choose one than the other.

share|cite|improve this answer
This answer also gives an intuitive explanation for the nice result in Byron Schmuland's answer: When the $k$th passenger reaches the plane, there are $n-(k-1)$ empty seats. If the first passenger stands up, he will see that he is in an arbitrary one of $n-k+2$ seats, all of which have looked the same to him so far. So there is a $\frac{1}{n-k+2}$ chance that, when seated, he is occupying the $k$th passenger's seat. – Matt Aug 19 '14 at 2:22

Let's find the chance that any customer ends up in the wrong seat.

For $2\leq k\leq n$, customer $k$ will get bumped when he finds his seat occupied by someone with a smaller number, who was also bumped by someone with a smaller number, and so on back to customer $1$.

This process can be summarized by the diagram $$1\longrightarrow j_1\longrightarrow j_2\longrightarrow\cdots\longrightarrow j_m\longrightarrow k.$$
Here $j_1<j_2<\cdots <j_m$ is any (possibly empty) increasing sequence of integers strictly between $1$ and $k$. The probability of this sequence of events is $${1\over n}\times{1\over(n+1)-j_1}\times {1\over(n+1)-j_2}\times\cdots\times{1\over(n+1)-j_m}.$$

Thus, the probability that customer $k$ gets bumped is $$p(k)={1\over n}\sum\prod_{\ell=1}^m {1\over(n+1)-j_\ell}$$ where the sum is over all sets of $j$ values $1<j_1<j_2<\cdots <j_m<k$. That is, \begin{eqnarray*} p(k)&=&{1\over n}\sum_{J\subseteq\\{2,\dots,k-1\\}}\ \, \prod_{j\in J}{1\over (n+1)-j}\cr &=&{1\over n}\ \,\prod_{j=2}^{k-1} \left(1+{1\over (n+1)-j}\right)\cr &=&{1\over n}\ \,\prod_{j=2}^{k-1} {(n+2)-j\over (n+1)-j}\cr &=&{1\over n+2-k}. \end{eqnarray*}

In the case $k=n$, we get $p(n)=1/2$ as in the other solutions. Maybe there is an intuitive explanation of the general formula; I couldn't think of one.

Added reference: Finding your seat versus tossing a coin by Yared Nigussie, American Mathematical Monthly 121, June-July 2014, 545-546.

share|cite|improve this answer
may i ask 2 questions, 1: how could I get $\sum_{J\subseteq\{2,\dots,k-1\}} \prod_{j\in J}{1\over (n+1)-j} = \prod_{j=2}^{k-1} \left(1+{1\over (n+1)-j}\right)$? 2. the bumping may not start from customer 1, it could start from anyone. e.g. the diagram could be $5\longrightarrow j_1\longrightarrow j_2\longrightarrow\cdots\longrightarrow j_m\longrightarrow k$ if the first person in the line (lost his ticket) seats at seat #5. right? – athos Oct 1 '13 at 1:18
1. $\prod_{i\in I}(1+x_i)=\sum_{J\subseteq I}\prod_{j\in J}x_j$ – Byron Schmuland Oct 1 '13 at 12:13
2. No, any bumping can be traced back to passenger 1. – Byron Schmuland Oct 1 '13 at 12:14
thank you for your explanation. for point 1, after drawing it out i finally understand it. but for point 2, could you please elaborate a bit more? scenario A: the first person in the line bumped into seat #1, customer #1 then bumped into seat #5, this is $1\longrightarrow j_1=5\longrightarrow j_2\longrightarrow\cdots\longrightarrow j_m\longrightarrow k$; Scenario B: the first person in the line bumped into seat #5, customer #5 then bumped on, this is $j_1=5\longrightarrow j_2\longrightarrow\cdots\longrightarrow j_m\longrightarrow k$ -- these are 2 different scenarios right? – athos Oct 1 '13 at 15:05
+1 for the reference! here's a link to it – Matt Aug 19 '14 at 2:09

This analysis is correct, but not complete enough to convince me. For example, why is the fate of the last person settled as soon as the first person's seat chosen? Why will any other seat but the first person's or the last person's be taken by the time the last person boards?

I had to fill in the holes for myself this way...

The last person's fate is decided as soon as anybody chooses the first person's seat (nobody is now in a wrong seat, so everybody else gets their assigned seat, including the last person) or the last person's seat (the last person now won't get their correct seat). Any other choice at any stage doesn't change the probabilities at all.

Rephrasing... at each stage, either the matter gets settled and there is a 50/50 chance it gets settled each way for the last person's seat, or the agony is just postponed. The matter can thus be settled at any stage, and the probabilities at that stage are the only ones that matter -- and they are 50/50 no matter what stage. Thus, the overall probability is 50/50.

share|cite|improve this answer

I don't really have the intuition for this, but I know the formal proof. This is equivalent to showing that the probability that in a permutation of $[n]$ chosen uniformly at random, two elements chosen uniformly at random are in the same cycle is $1/2$. By symmetry, it's enough to show that the probability that $1$ and $2$ are in the same cycle is $1/2$.

There are many ways to show this fact. For example: the probability that $1$ is in a cycle of length $k$ is $1/n$, for $1 \le k \le n$. This is true because the number of possible $k$-cycles containing $1$ is ${n-1 \choose k-1} (k-1)! = (n-1)!/(n-k)!$, and the number of ways to complete a permutation once a $k$-cycle is chosen is $(n-k)!$. So there are $(n-1)!$ permutations of $[n]$ in which $1$ is in a $k$-cycle. Now the probability that $2$ is in the same cycle as $1$, given that $1$ is in a $k$-cycle, is $(k-1)/(n-1)$. So the probability that $2$ is in the same cycle as $1$ is $$ \sum_{k=1}^n {k-1 \over n-1} {1 \over n} = {1 \over n(n-1)} \sum_{k=1}^n (k-1) = {1 \over n(n-1)} {n(n-1)\over 2} = 1/2. $$

Alternatively, the Chinese restaurant process with $\alpha = 0, \theta = 1$ generates a uniform random permutation of $[n]$ at the $n$th step; $2$ is paired with $1$ at the second step with probability $1/2$. This is a bit more elegant but requires some understanding of the CRP.

share|cite|improve this answer

Let P(n) denote the probability of the last passenger getting his seat if we begin with n passengers.

Consider the simple case for just 2 seats:

P(2) = 1/2 {first boarder picks his own seat with 1/2 probability}

For n seats: (i) With 1/n probability, the passenger picks the seat of the first passenger, the n'th seat from the end (in which case the last passenger would definitely get his seat). (ii) With 1/n probability, the current passenger picks the seat of the last passenger, first seat from the end (and now, the last passenger can definitely not get his own seat). (iii) Otherwise, the passenger picks some other seat (say #i from the end) among the n-2 remaining seats (with probability 1/n), continuing the dilemma. The problem now reduces to the initial problem with i seats.

Therefore, P(n) = (1/n * (1)) + (1/n * (0)) + Sum {(1/n) * P(i), 2 < i < n};

            = 1/n + 1/n {Sum P(i), 2 < i < n }    --(1)

Similarly,((n-1)/n)P(n-1) = 1/n + 1/n Sum { P(i) , 2 < i < n-1 }

                      = [ 1/n + 1/n Sum { P(i) , 2 < i < n } ] - 1/n P(n-1) 

   => (n-1)/n P(n-1) = P(n) -1/n P(n-1)
   => P(n) = P(n-1)
   => P(m) = P(n-1) , for all integers m > n-1

Since P(2) = 1/2, Therefore P(m) = 1/2 for all integers m > 2

share|cite|improve this answer

I tried to synthesize the proof for myself from stuff I've read to get rid of all calculations (somehow I found the argument that "each person's choice is 50-50 between good and bad once we throw away the irrelevant stuff" convincing but hard to formalize).

Claim 1: when the last passenger boards, the remaining empty seat will either be his own or the first passenger's.

Proof: If the remaining empty seat belongs to passenger $n \neq 1, 100$, then passenger $n$ should have sat there.

Claim 2: if at any time a passenger other than the final passenger finds her seat occupied, then both the seat assigned to the first and to the final passenger will be free.

Proof: If not, then there is a nonzero probability that after this passenger makes a decision, both the first and last seats will be occupied. This contradicts Claim 1.

Claim 3: There is a bijection between the set of admissible seatings in which the final passenger gets his seat and the set where he doesn't.

Proof: Suppose for an admissible seating $S$ that passenger $n$ is the first to choose one of {first passenger's seat, last passenger's seat}. By claim $2$, there is a unique admissible seating $T$ which agrees with $S$ except that passenger $n$ and the final passenger make the opposite decision ($T$ matches $S$ until passenger $n$ sits, then by Claim 2, $T$ must continue to match $S$ until the final passenger).

share|cite|improve this answer

My answer owes much to what went before , but it works for me. The first person in the queue ( assume he does not sit in his own seat by random chance) displaces one person still in the queue by sitting in their seat . Passengers continue to board in their own seats until the displaced person comes to sit down. His own seat is taken so he in turn displaces someone else who is in the queue. There is always one displaced person in the queue as this cycle continues From here there are only 2 possible outcomes, a) a displaced person randomly choses the first mans seat at which point the cycle of displacement ends and the boarding can then continue to the end person with everyone else including the last man getting their own seat or b) The last mans seat is selected by a displaced person then there is no more displacement until the last man tries to sit down and will find his seat full

Whichever of a ) or b ) happens first will determine whether the last mans seat is available when he comes to board. a) or b) are 2 events determined by random chance therefore each has 50% chance of happening Hence answer = 1/2 or 50%

share|cite|improve this answer
It's not clear to me that $(a)$ and $(b)$ are equally likely, but it seems like a good heuristic. – Michael Albanese Jan 27 at 13:51

It is possible to count the different configurations of interest to calculate the probability directly, by formalizing some of the ideas already presented.

In an allowed configuration, denote a displacement of one or more passengers with the diagram $i\rightarrow j$ whenever passenger $i$ displaces passenger $j$ from their assigned seat ($i < j$).

Suppose C is an allowed configuration with a displacement D of passengers, say, $...i\rightarrow j...$ Clearly i has a predecessor (which can be added to the diagram) or i is passenger 1, since the problem states that only passenger 1 is free to displace passengers without being displaced themselves. Since each predecessor must represent a passenger who boarded earlier, of which there are a finite number, using this argument at most i times, shows that D must begin with passenger 1. By a similar argument, D must have a last passenger which chooses passenger 1’s seat to end the displacement.

If E is a displacement in C, by the same argument it must start with passenger 1, followed by the choices already indicated in D, so that E is the same as D. Clearly, two allowed configurations are the same if and only if their displacements are the same. Additionally, note that a displacement of the form, $\textstyle\ 1\rightarrow i \rightarrow … \rightarrow j$ where {i,…,j} is a subset of {2,…,100} in increasing order, always specifies a valid configuration. Hence,

There is a bijection between the set of allowable configurations and diagrams of the form $1\rightarrow i \rightarrow … \rightarrow j$ where {i,…,j} is a subset of {2,…,100} in increasing order.

Now count configurations by counting the diagrams. Write 1 as the diagram for the null displacement in the configuration where all passengers sit in their assigned seats. Note that this is same as counting all subsets of a two particular sets, so the probability that the final passenger is sitting in their assigned seat is:

$\textstyle \frac{\textrm{Number of all diagrams of the form } 1\rightarrow i \rightarrow … \rightarrow j\textrm{ where {i,…,j} is a subset of {2,…,99} in increasing order}}{\textrm{Number of all diagrams of the form } 1\rightarrow k \rightarrow … \rightarrow l\textrm{ where {k,…,l} is a subset of {2,…,100} in increasing order}} = \frac{2^{98}}{2^{99}} = \frac{1}{2}\\$

share|cite|improve this answer

It's simple only two cases are possible either the 100th person sits on his seat or on 1st persons seat no matter what others do 100th person has only two options so probability is 1/2

share|cite|improve this answer

protected by Zev Chonoles May 27 at 2:46

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.