It’s Halloween time! While trick-or-treating, you encounter a mysterious house in your neighborhood.
You ring the doorbell, and someone dressed as a mathematician answers. (What does a “mathematician” costume look like? Look in the mirror!) They present you with a giant bag from which to pick candy, and inform you that the bag contains exactly three peanut butter cups (your favorite!), while the rest are individual kernels of candy corn (not your favorite!).
You have absolutely no idea how much candy corn is in the bag—any whole number of kernels (including zero) seems equally possible in this monstrous bag.
You reach in and pull out a candy at random (that is, each piece of candy is equally likely to be picked, whether it’s a peanut butter cup or a kernel of candy corn). You remove your hand from the bag to find that you’ve picked a peanut butter cup. Huzzah!
You reach in again and pull a second candy at random. It’s another peanut butter cup! You reach in one last time and pull a third candy at random. It’s the third peanut butter cup!
At this point, whatever is left in the bag is just candy corn. How many candy corn kernels do you expect to be in the bag?
The probability of drawing three peanut butter cups in a row, conditional on there being $k$ candy corn kernels, is $$\mathbb{P} \{ c = 3 \mid k \} = \frac{ 3 }{k + 3 } \frac{ 2}{k + 2} \frac{1}{k+1} = \frac{6}{(k+3) (k+2) (k+1) }.$$ Using Bayes' theorem, we can retrieve the conditional distribution of the number of candy corn kernels conditional on pulling three peanut butter cups in a row, namely, \begin{align*}\mathbb{P} \{ k \mid c = 3 \} &= \frac{ \mathbb{P} \{ c = 3 \mid k \} \mathbb{P} \{ k \} }{ \mathbb{P} \{ c = 3 \} } \\ &= \frac{ \mathbb{P} \{ c = 3 \mid k \} }{ \sum_{\ell = 0}^\infty \mathbb{P} \{ c = 3 \mid \ell \} } \\ &= \frac{ \frac{6}{(k+1)(k+2)(k+3)} }{ \sum_{\ell=0}^\infty \frac{6}{(\ell+1)(\ell+2)(\ell+3)} }\\ &= \frac{1}{M (k+1)(k+2)(k+3)},\end{align*} where $$M = \sum_{\ell=0}^\infty \frac{1}{(\ell +1)(\ell+2)(\ell+3)}.$$
We can calculate the convergent series $M$ by method of partial fractions. Let \begin{align*} \frac{1}{(\ell + 1)(\ell + 2)(\ell + 3)} &= \frac{A}{\ell+1} + \frac{B}{\ell+2} + \frac{C}{\ell+3} \\ &= \frac{ A (\ell + 2) (\ell + 3) + B(\ell + 1)(\ell + 3) + C(\ell + 1)(\ell + 2)}{ (\ell + 1) (\ell+2) (\ell+3) } \\ &= \frac{ (A + B + C) \ell^2 + (5A + 4B + 3C) \ell + (6A + 3B + 2C)}{(\ell+1)(\ell+2)(\ell+3)}.\end{align*} So we have the resulting system of linear equations \begin{align*} A + B + C &= 0 \\ 5A + 4B + 3C &= 0 \\ 6A + 3B + 2C & = 1 \end{align*}, which has solution $A = C = \frac{1}{2}$ and $B = -1.$ Therefore, $$\frac{1}{(\ell + 1) (\ell + 2)(\ell + 3)} = \frac{1}{2} \frac{1}{\ell+1} - \frac{1}{\ell+2} + \frac{1}{2} \frac{1}{\ell+3},$$ so we have \begin{align*} M &= \sum_{\ell = 0}^\infty \frac{1}{(\ell+1)(\ell+2)(\ell+3)} = \lim_{L\to \infty} \sum_{\ell=0}^L \frac{1}{(\ell+1)(\ell+2)(\ell+3)} \\ &= \lim_{L \to \infty} \sum_{ell=0}^L \left( \frac{1}{2} \frac{1}{\ell+1} - \frac{1}{\ell+2} + \frac{1}{2} \frac{1}{\ell+3} \right) \\ &= \lim_{L \to \infty} \frac{1}{2} \left( 1 + \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{L+1} \right) - \left( \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{L+1} + \frac{1}{L+2} \right) + \frac{1}{2} \left( \frac{1}{3} + \cdots + \frac{1}{L+1} + \frac{1}{L+2} + \frac{1}{L+3} \right) \\ &= \lim_{L\to \infty} 1 \cdot \frac{1}{2} + \frac{1}{2} \cdot \left( \frac{1}{2} - 1 \right) + \left( \frac{1}{2} - 1 + \frac{1}{2} \right) \cdot \left( \frac{1}{3} + \cdots + \frac{1}{L+1} \right) + \frac{1}{L+2} \cdot \left(-1 + \frac{1}{2} \right) + \frac{1}{L+3} \cdot \frac{1}{2} \\ &= \lim_{L \to \infty} \frac{1}{2} - \frac{1}{4} + O(L^{-2}) = \frac{1}{4}.\end{align*}
Therefore, we have $$\mathbb{P} \{ k \mid c = 3 \} = \frac{4}{(k+1)(k+2)(k+3)},$$ for $k = 0, 1, \dots,$ so we can calculated the conditional expectation as $$\mathbb{E} \left[ K \mid c = 3 \right] = \sum_{k=0}^\infty k \mathbb{P} \{ k \mid c = 3 \} = 4 \sum_{k=0}^\infty \frac{k}{(k+1)(k+2)(k+3)}.$$ As before, we can solve this series by the method of partial fractions. Here instead of the earlier system of equations, we now want to solve \begin{align*} A + B + C &= 0 \\ 5A + 4B + 3C &= 1 \\ 6A + 3B + 2C &= 0 \end{align*} which has solution $A = -\frac{1}{2},$ $B = 2,$ $C = - \frac{3}{2}.$ Thus the conditional expected number of candy corn kernels given that I drew the three peanut butter cups is \begin{align*}\mathbb{E} \left[ K \mid c = 3 \right] &= 4 \sum_{k=0}^\infty \frac{k}{(k+1)(k+2)(k+3)}\\ &= \lim_{L \to \infty} 4 \left(-\frac{1}{2} + \left( -\frac{1}{2} + 2 \right) \cdot \frac{1}{2} + O(L^{-2}) \right) = 4 \cdot \frac{1}{4} = 1.\end{align*}
No comments:
Post a Comment