# A Problem dealing with the Binomial Distribution

Below is my solution to a problem from a text book. I do not have confidence that my solution is right. I feel like I am missing something. Am I?
Thanks,
Bob
Problem:
An airline finds that $5$ percent of the persons making reservations on a certain flight will not show up for that flight. If the airline sells $160$ seats tickets for a fight with only $155$ seats, what is the probability that a seat will be available for every person holding a reservation and planning on flying.
First realize that we have a binomial distribution with $n = 160$, $p = 0.95$ and $q = 0.05$. We are going to approximate that with a normal distribution. \begin{eqnarray*} u &=& np = 160(0.95) = 152 \\ \sigma^2 &=& npq = 0.95(0.05)(160) =7.6 \\ \sigma &=& 2.75681 \\ \end{eqnarray*} Observe that $155$ is $1.08821$ standard deviations above the mean. We then run the following command in R: pnorm(1.08821) and got $0.8617488$. We conclude the probability that all the passengers will have seats is $0.8617488$. The book gets $0.8980$. We will now do the problem again using Yates's correction.
This time we ask what is the probability that we have $155.5$ passengers or less. Now we are $1.26991$ standard deviations above the mean. We then run the following command in R: pnorm(1.26991) and got $0.0.89794$ which matches the answer in the book.

• Apart from using an approximation when it was unnecessary (the exact answer can be found with relatively low effort) and when using the approximation not immediately using "Yate's Correction" from the beginning, your answer is acceptable. Arguably, an approximation using the normal distribution however is not appropriate due to the small numbers involved. – JMoravitz Aug 11 '18 at 22:31
• The exact answer can be calculated as such and is closer to $0.90614607\dots$. This could even done by hand with a pocket calculator running the sum from the other direction and subtracting away from one as such. – JMoravitz Aug 11 '18 at 22:37
• Unexplained down-votes nothwithstanding, Answer by @KeyFlex is a reasonable attempt to verify the work OP is asking about. – BruceET Aug 11 '18 at 23:56

There is a precise answer, you do not need to estimate. Note that using normal distribution instead of the binomial one is an approximation which is very accurate under some conditions, of course, but still, not better that the precise answer. Although the problem did not state this, I guess we may assume that customers decide to show up or not independently from each other. This is not realistic: if I book a flight with my wife for our honeymoon, then we both show up or we both don't, normally. Anyway, without the independence assumption, we have nothing.

So as you correctly put, $p=0.95$, $n=160$, and then the number $X$ of people showing up has distribution $X\sim Binom(160, 0.95)$.

The question is $P(n\leq 155)$. To simplify the calculation, we should compute the complement probability: $P(n> 155)= P(n=156) + P(n=157) + P(n=158) + P(n=159) + P(n=160)= \binom{160}{156}\cdot 0.95^{156}\cdot 0.05^4 + \binom{160}{157}\cdot 0.95^{157}\cdot 0.05^3 + \binom{160}{158}\cdot 0.95^{158}\cdot 0.05^2 + \binom{160}{159}\cdot 0.95^{159}\cdot 0.05^1 + \binom{160}{160}\cdot 0.95^{160}\cdot 0.05^0$.

• If I had a dime for every time I made this stupid mistake... Thanks a lot, fixed. – A. Pongrácz Aug 11 '18 at 22:43
• In addition to the independence assumption, we also tacitly assume that the airline has a "large number of persons who regularly book flights" which allows us to model this as sampling with replacement. If our airline only operates in the middle of nowheresville with population 160, then we would be sampling without replacement and we would have had exactly eight people not showing up for the flight. – JMoravitz Aug 11 '18 at 22:49

Let's try this using standard notation: The number of people who show for the flight is $X \sim \mathsf{Binom}(n = 160, p = .95).$

Thus, on average, the number who show is $$\mu = E(X) = np = 160(0.95) = 152.$$ So if the average number always show up, there will always be room for everyone.

However, the number actually showing up for any one flight is variable: specifically, $\sigma^2 = Var(X) = np(1-p) = 7.68$ and $$\sigma = SD(X) = \sqrt{np(1-p)} = 2.75681.$$ Roughly speaking, it isn't unlikely for a binomial random variable to be as much as $2\sigma$ on either side of the mean. So the number of people actually showing for a particular flight might be between 146 and 175, which means sometimes 155 seats won't be enough to accommodate everyone who shows.

The exact probability that everyone showing gets a seat is $P(X \le 155) = 0.9061.$ This probability can be computed exactly: using the PDF formula for the binomial distribution (as shown by @APongracz), or using software (as commented by @JMoravitz)--either a statistical calculator or software program such as R. (The result from R is shown below.)

pbinom(155, 160, .95)
## 0.9061461

The answer can also be approximated using the normal distribution $\mathsf{Norm}(\mu = 152, \sigma = 2.7568).$ This can be done directly in software or by standardizing and using printed normal tables. (Roughly as in the deleted answer; using normal tables may require some rounding and thus give a slightly different answer.)

pnorm(155.5, 152, 2.75681)
## 0.8978835

By any of the methods, the probability of being able to accommodate everyone who shows is about 0.90.\$ (On about 10% of these flights there might be announcements asking if some people with reservations are willing to take the next flight in exchange for some sort of 'bribe'.)

In the figure below, the exact binomial probability is the sum of the heights of the vertical bars to the left of the vertical broken line, and the normal approximation is the area under the normal curve to the left of that line. The normal curve does not exactly match the binomial bars, so you can only expect about two places of accuracy from the normal approximation.