[Math] Calculating the variance for m people and n floors

probability distributions

A building has n floors numbered 1, 2, . . . , n, plus a ground floor G. At the ground floor, m people get on the elevator together, and each gets off at a uniformly random one of the n floors (independently of everybody else). What is the variance of the number of floors the elevator does not stop at? (In fact, the variance of the number of floors the elevator does stop at must be the same (do you see why?) but the former is a little easier to compute.)

This is my attempt at solving this problem, please correct me and give me some guidance on how to continue, Thank you!

Calculating Expected Value

$A_i$ is our indicator variable that the elevator stopped at floor $i$. If it stops at floor $i$ then $A_i=1$ to calculate that we say $$Pr[A_i = 1] = 1 − Pr[\text{no one gets off at i}]$$ $$Pr[A_i = 1] = 1 – (1-\frac{1}{n})^m = 1 – (\frac{n-1}{n})^m$$

If $A$ is the number of floors the elevator stops at, then our expected value would be
$$E[A] = E[A_1 + · · · + A_n] = E[A_1] + · · · + E[A_n]$$
$$E[A] = n [ 1 – (\frac{n-1}{n})^m]$$ (number of floors times the probability the elevator stops at each floor)

Calculating Variance

$$Var(A) = E[A^2] – [E[A]]^2 = np(1-p)$$
A. variance if it does not stop each floor
$$Var(A*) = n [(\frac{n-1}{n})^m][1 – (\frac{n-1}{n})^m] $$
B. variance if it stops at each floor
$$Var(A) = n [1 – (\frac{n-1}{n})^m][(\frac{n-1}{n})^m] $$
therefore
$$Var(A)=Var(A*)$$

(I interpreted the variance formula as the number of floors times the probability it stops at each floor times the probability that it does not stop at each for B and visa versa for A)

Also, is it easier to calculate the variance for the floors the elevator does not stop at because the probability of that is what we use to get the probability it stops at a floor? is there another reason? or am I totally wrong? Thank you so much for your time!

Best Answer

Outline: We change notation a bit, in order to concentrate on the number of floors the elevator does not stop at. Let $X_i=1$ if the elevator does not stop at floor $i$, and let $X_i=0$ otherwise. Then the number $Y$ of floors the elevator does not stop at is $X_1+X_2+\cdots +X_n$.

You know how to find $E(Y)$, so we confine attention to the variance. As is often the case, this is easiest to find by first finding $E(Y^2)$.

Expand $(X_1+X_2+\cdots +X_n)^2$. We get $$\sum_1^n X_i^2 +2\sum_{1\le i\lt j} X_iX_j.$$ The expectation of the $X_i^2$ has already been done, since $X_i^2=X_i$.

For $E(X_iX_j)$, we want to find the probability that $X_i=1$ and $X_j=1$. You know $\Pr(X_i=1)$. To find $\Pr(X_iX_j=1)$, it is enough to find $\Pr(X_j=1|X_i=1)$. This is done in a way similar to the calculation of $\Pr(X_i=1)$. Just one fewer floor.

Related Question