A club serves dinner to members only. They are seated at 12-seat tables. The manager observes over a long period of time that 95 percent of the time there are between six and nine full tables of members, and the remainder of the time the numbers are equally likely to fall above or below this range. Assume that each member decides to come with a given probability p, and that the decisions are independent. How many members are there? What is p?
This set up tells us quite a bit about our distribution, which we can use to extrapolate the number of members n and the probability p of any given member showing up on any given night.
The attendance of someone attending can be thought of as a success in a Bernoulli trial. As such, the number of successes can be modeled by the following:
\[ S_n = \frac{S_n-np}{\sqrt{npq}} \] Where n is the number of trials (the total number of members, because each can decide to go or not go), p is the probability of each individual success (the chance that any one member decides to attend), and q is \(p-1\) (the chance that a given member will not attend).
Given these values, we can calculate the probabilities for certain ranges of successes by the following:
\[ P(i \leq S_n \leq j) \approx NA\left(\frac{i-0.5-np}{\sqrt{npq}},\frac{j + 0.5 - np}{\sqrt{npq}}\right) \] Replacing \(q\) with \((1-p)\) (since both represent the probability of failure):
\[ P(i \leq S_n \leq j) \approx NA\left(\frac{i-0.5-np}{\sqrt{np(1-p)}},\frac{j + 0.5 - np}{\sqrt{np(1-p)}}\right) \] Ordinarily, we might be given probabilities and numbers of trials and be asked to use those to calculate a probability. However, in this case, we are given the probability (95%) for a range of values \(i\) to \(j\) (\(6*12=72\), \(9*12=108\)), and asked to solve for \(n\) and \(p\). We can plug those values in and start to arrive at an answer.
\[ 0.95 \approx NA\left(\frac{71.5-np}{\sqrt{np(1-p)}},\frac{108.5 - np}{\sqrt{np(1-p)}}\right) \] Since the probabilities are equal on both sides of the mean, we can take the \(NA\) for only \(i\) OR \(j\) and consider it to be half of our probability.
\[ 0.475 \approx NA\left(\frac{108.5-np}{\sqrt{np(1-p)}}\right) \] According to the table in Figure 9.4, a Normal Area of 0.475 corresponds roughly to a \(z\) score of 2. Therefore:
\[ 2 = \frac{108.5-np}{\sqrt{np(1-p)}} \] Using Wolfram Alpha, I solved this equation in terms of \(n\):
p = 0
n = 0.5 * (-(2*sqrt(2)*sqrt(2*p^2 - 221*p + 219))/p + 221/p - 4)
I can cycle through different probabilities \(p\) to get the full range of options. Only \(n\) values that equal whole numbers make sense in this context.
n_list <- c()
p_list <- c()
for (i in seq(0,1,by = 0.001)) {
p <- i
p_list <- c(p_list, p)
n_list <- c(n_list, 0.5 * (-(2*sqrt(2)*sqrt(2*p^2 - 221*p + 219))/p + 221/p - 4))
}
np <- data.frame(p_list,n_list)
Now we can see which \(n\)s are closest to whole numbers.
np$n_rounding_error <- round(np$n)-np$n
Technically, the closest result I got to a 0 rounding error for \(n\) was for a probability of \(0.05\), but that is perhaps too close to 0 for contexts like this.
I’ll then settle on my next closest answer, 262 members, each with a 35.5% chance of attending on any given night. As a sense check, let’s plug that back into our probability range formula:
\[ P(72 \leq S_n \leq 108) \approx NA\left(\frac{71.5-262*0.355}{\sqrt{262*0.355*0.645}},\frac{108.5 - 262*0.355}{\sqrt{262*0.355*0.645}}\right) \] Cutting both sides in half since the distribution is symmetrical.
\[ 0.475 \approx NA\left(\frac{108.5 - 262*0.355}{\sqrt{262*0.355*0.645}}\right) \]
((108.5-(262*0.355)) / sqrt(262*0.355*0.645))
## [1] 1.999893
\[ 0.475 \approx NA\left(2\right) \] Looks about right to me!