[Math] Expected number of passengers for the flight

binomial-coefficientsmathematicaprobabilitystatistics

One of the interview questions that I was asked was :

The small commuter plane has 30 seats. The probability that any
particular passenger will not show up for a flight is 0.1, independent
of other passengers.

Design a function to get largest m value such that expectedshow[m] =
expected number of passengers showing up if 30 + m tickets are sold
for a flight and expectedshow[m] ≤ 30.

I could not think of a way to approach this question. Can somebody explain it ?

Best Answer

If $n$ tickets are sold, then the expected number of passengers that will show is $0.9n$, by linearity of expectation.

However, in this problem the variable is not $n$, but $m$, where $n=30+m$. Hence the number of expected passengers that will show is $0.9(30+m)$. Now consider those values of $m$ that make this at most 30; choose the largest. You should get $$\frac{30}{0.9}-30=3.\overline{3}$$ Most likely the interviewer is looking for the floor of this, namely $m=3$.