In this question, the notation \(\lfloor x \rfloor\)
denotes the greatest integer less than or equal to \(x\),
so for example \(\lfloor \pi\rfloor = 3\) and \(\lfloor 3 \rfloor =3\).
A bag contains \(n\) balls, of which \(b\) are black. A sample of \(k\) balls is drawn, one after another, at random with replacement. The random variable \(X\) denotes the number of black balls in the sample.
By considering
\[
\frac{\P(X=r+1)}{\P(X=r)}\,,
\]
show that, in the case that it is unique,
the most probable number of black balls
in the sample is
\[
\left\lfloor \frac{(k+1)b}{n}\right\rfloor.
\]
Under what circumstances is the answer not unique?
A bag contains
\(n\) balls, of which \(b\) are black. A sample of \(k\) balls
(where \(k\le b\))
is drawn, one after another, at random without replacement.
Find, in the case that it is unique, the most probable number of black
balls in the sample.
Under what circumstances is the answer not unique?
Solution:
\(\mathbb{P}(X = r) = \binom{k}{r}p^rq^{k-r}\) where \(p = \frac{b}{n}, q = 1-p\).
Therefore
\begin{align*}
&& \frac{\mathbb{P}(X=r+1)}{\mathbb{P}(X=r)} &= \frac{\binom{k}{r+1}p^{r+1}q^{k-r-1}}{\binom{k}{r}p^rq^{k-r}} \\
&&&= \frac{(k-r)p}{(r+1)q} \\
&&&= \frac{(k-r)b}{(r+1)(n-b)}
\end{align*}
Comparing this to \(1\) we find:
\begin{align*}
&& 1 & < \frac{\mathbb{P}(X=r+1)}{\mathbb{P}(X=r)} \\
\Leftrightarrow && 1 &< \frac{(k-r)b}{(r+1)(n-b)} \\
\Leftrightarrow && (r+1)(n-b) &<(k-r)b \\
\Leftrightarrow && rn& < (k+1)b - n \\
\Leftrightarrow && r &< \frac{(k+1)b}{n} - 1\\
\end{align*}
If this equation is true, then \(\mathbb{P}(X=r+1)\) is larger, so \(r_{max} = \left \lfloor \frac{(k+1)b}{n} \right \rfloor\)
Let \(Y\) be the number of black balls in our sample, ie \(\mathbb{P}(Y = r) = \binom{b}{r}\binom{n-b}{k-r}/\binom{n}{k}\), so
\begin{align*}
&& \frac{\mathbb{P}(Y = r+1)}{\mathbb{P}(Y=r)} &= \frac{\binom{b}{r+1}\binom{n-b}{k-(r+1)}/\binom{n}{k}}{\binom{b}{r}\binom{n-b}{k-r}/\binom{n}{k}} \\
&&&= \frac{b-r}{r+1} \frac{k-r}{n-b-k+r+1} \\
&& 1 &< \frac{\mathbb{P}(Y = r+1)}{\mathbb{P}(Y=r)} \\
\Leftrightarrow && (r+1)(n-b-k+r+1) &< (b-r)(k-r) \\
\Leftrightarrow &&r(n-b-k+1)+(n-b-k+1) &< -r(b+k)+bk \\
\Leftrightarrow &&r(n+1) &< bk+b+k+1-n \\
\Leftrightarrow && r &< \frac{(b+1)(k+1)}{n+1} - \frac{n}{n+1}
\end{align*}
Therefore \(r = \left \lfloor \frac{ (b+1)(k+1)}{n+1}\right \rfloor\), it is not unique if \(n+1\) divides \((b+1)(k+1)\)