Expected number of wrong seats on plane

combinatoricsexpectationprobabilitypuzzle

Many people will be familiar with the set up of this problem: you have an aeroplane with 100 seats, and 100 passengers who have been allocated unique seats. The first passenger forgets their ticket, and so takes a random seat. The remaining passengers enter the plane. If their seat is empty, they take it. If it is occupied, they take a random seat on the plane.

At this point, the question that is usually asked it "what is the probability that the 100th person gets their allocated seat". This was asked here.

My question is a bit different. By the time all the passengers have boarded what is the expected number of passengers in the wrong seat? I have seen many people ask this as a follow up question to the first on some other online forums, but there doesn't appear to be a convincing answer anywhere.

Attempt:

Looking at smaller sized planes, we can come up with a conjecture than for a plane of size $n$, we have $$\text{expectation}=\begin{cases}1+\frac12+\cdots+\frac1{n-1}&n\text{ is even}\\\frac12+\frac13+\cdots+\frac1n&n\text{ is odd}\end{cases}$$

When trying to compute the expectation for even $n$ as a sum, we get a very complicated expression, of the form $$\frac1n\left(2\sum_{i=1}^{n-1}\frac1i+3\sum_{i\ne j,i,j=1}^{n-1}\frac1{ij}+4\sum_{i\ne j\ne k,i,j,k=1}^{n-1}\frac1{ijk}\cdots\right)$$

How can we derive the result I have conjectured?


$\small\text{Edit:}$

$\small\text{The conjecture was wrong in the odd case – the expectation is always equal to }\small\sum_{i=1}^{n-1}\frac1i\small\text{whether }n\small\text{ is even or odd. (As shown by the answers and @Akababa's comment)}$

Best Answer

Let $X_k$ be the number of incorrect seats occupied by passenger $k$. Obviously $X_k$ is either $0$ or $1$; by this answer we have $$P(X_k=1)=\frac1{n+2-k}\quad\hbox{for $k=2,3,\ldots,n$}\ ;$$ hence $$E(X_k)=0\cdot P(X_k{=}0)+1\cdot P(X_k{=}1)=\frac1{n+2-k}\ .$$ Similarly, $$E(X_1)=\frac{n-1}n=1-\frac1n\ .$$ The total number of passengers in the wrong seat is $T_n=X_1+\cdots+X_n$, and by linearity its expected value is $$E(X_1)+E(X_2)+E(X_3)+\cdots+E(X_n) =\Bigl(1-\frac1n\Bigr)+\frac1n+\frac1{n-1}+\cdots+\frac12\ ,$$ that is, $$E(T_n)=1+\frac12+\cdots+\frac1{n-1}\ ,$$ provided $n>1$.

Related Question