
There are 100 seats on a plane. If each of the 100 passengers randomly take a seat, how many people will have his/her own seat on average?
There is a classic way to solve this problem, which is to decompose a (complicated) random variable into a sum of simple random variables. This is an important trick. See this post for the use of this trick to calculate the covariance of observastions in two categories in a multinomial distribution.
Let’s generalize this problem to assume that there are seats and passengers. Let , , where is an indicator function. ’s are exchangeable, which means that for a fixed (), any subset of with elements has the same distribution. Specially, it’s easy to see that
So we have
Let , which is the number of passengers taking their own seats. From above results we know that
\begin{align} Var\left( X_n\right) &= Var\left( \sum_{i=1}^nY_i\right) =\sum_{i=1}^n Var(Y_i)+\sum_{i\ne j}Cov(Y_i,Y_j) \nonumber \newline &= nVar(Y_1)+n(n-1)Cov(Y_1,Y_2) \nonumber \newline &= n\frac{n-1}{n^2}+n(n-1)\frac{1}{n^2(n-1)}=1. \nonumber \end{align}
Surprisingly, both the mean and the variance of is 1, which suggests that we can predict , i.e. the number of integers that have the same position as their original position very well.
The above solution is elegant. However, I’d like to try to solve this problem using my preferred universal procedure. Let and , , be as defined above. Conditioning on gives us a recursive/differtial equation. If (with probability ), i.e., the first passenger sits on its seat, then ; It’s a little tricky when (with probability ), i.e., the first passenger sits on other people’s seat. Assume the first passenger takes () passenger’s seat. If we pretend that seat 1 is the passenger’s seat, then we have . However, seat 1 is not passenger’s seat, and we cannot count it into . Let . We only miss count by extra 1 when , so when we have $E_k\sim\text{Bernoulli}(\frac{1}{n-1})$. So using the conditional expectation formula, we have
where . This is the simplest recursive/differential equation. Anyone can immediately see that $EX_n=1, \forall n\ge1$ is the solution to this recursive/differential equation.