[Practice 2 · Hard] Consider a sequence of \(n\) independent Bernoulli trials, where the probability of success in each trial is \(p\). Let \(X\) be the random variable representing the number of successes in these \(n\) trials. Thus, \(X \sim \text{Binomial}(n, p)\). We are given a dataset of \(N\) observed values \(\{x_1, x_2, \dots, x_N\}\) for \(X\), where each \(x_i\) is an observed count of successes from \(n\) trials. The observed data are: [3, 4, 2, 5, 4, 3, 2, 4, 5, 3]. If we assume that \(n=5\) (the number of trials for each observation is fixed at 5), find the value of \(p\) that maximizes the likelihood of observing this dataset. Then, compute the maximum likelihood estimate (MLE) of the probability of success, \(p\), and round your answer to two decimal places.
The random variable \(X\) follows a Binomial distribution: \(X \sim \text{Binomial}(n, p)\). The probability mass function (PMF) of the Binomial distribution is given by \(P(X=k | n, p) = \binom{n}{k} p^k (1-p)^{n-k}\), where \(k\) is the number of successes.
We are given \(n=5\) and a dataset of \(N=10\) observations: \(\{x_1, x_2, \dots, x_{10}\} = \{3, 4, 2, 5, 4, 3, 2, 4, 5, 3\}\).
The likelihood function for this dataset, given \(p\), is the product of the PMFs for each observation:
\(L(p | \{x_i\}) = \prod_{i=1}^{N} P(X=x_i | n, p) = \prod_{i=1}^{10} \binom{5}{x_i} p^{x_i} (1-p)^{5-x_i}\)
To find the MLE of \(p\), we typically work with the log-likelihood function, which simplifies the product into a sum:
\(\ell(p) = \log L(p) = \sum_{i=1}^{10} \log \left( \binom{5}{x_i} p^{x_i} (1-p)^{5-x_i} \right)\)
\(\ell(p) = \sum_{i=1}^{10} \left( \log \binom{5}{x_i} + x_i \log p + (5-x_i) \log (1-p) \right)\)
\(\ell(p) = \sum_{i=1}^{10} \log \binom{5}{x_i} + \left(\sum_{i=1}^{10} x_i\right) \log p + \left(\sum_{i=1}^{10} (5-x_i)\right) \log (1-p)\)
The term \(\sum_{i=1}^{10} \log \binom{5}{x_i}\) is a constant with respect to \(p\) and can be ignored for maximization.
Let \(S = \sum_{i=1}^{10} x_i\) be the total number of successes in the dataset, and \(T = \sum_{i=1}^{10} (5-x_i) = 10 \times 5 - \sum_{i=1}^{10} x_i = 50 - S\) be the total number of failures.
So, \(\ell(p) \approx S \log p + T \log (1-p)\).
To find the MLE, we take the derivative of \(\ell(p)\) with respect to \(p\) and set it to zero:
\(\frac{d\ell}{dp} = \frac{S}{p} - \frac{T}{1-p} = 0\)
\(\frac{S}{p} = \frac{T}{1-p}\)
\(S(1-p) = Tp\)
\(S - Sp = Tp\)
\(S = Tp + Sp\)
\(S = p(T+S)\)
\(p = \frac{S}{T+S}\)
We know that \(T+S = \sum_{i=1}^{10} (5-x_i) + \sum_{i=1}^{10} x_i = \sum_{i=1}^{10} (5-x_i+x_i) = \sum_{i=1}^{10} 5 = 10 \times 5 = 50\).
Now, let's calculate \(S\), the sum of the observed successes:
\(S = 3 + 4 + 2 + 5 + 4 + 3 + 2 + 4 + 5 + 3 = 35\).
Therefore, the MLE of \(p\) is:
\(\hat{p} = \frac{S}{nN} = \frac{35}{5 \times 10} = \frac{35}{50} = \frac{7}{10} = 0.70\).
The maximum likelihood estimate of \(p\) is 0.70.
Let's check the second derivative to confirm it's a maximum:
\(\frac{d^2\ell}{dp^2} = -\frac{S}{p^2} - \frac{T}{(1-p)^2}\). Since \(S>0\), \(T>0\), \(p \in (0,1)\), the second derivative is negative, confirming a maximum.
Common Misconception:
A common mistake might be to incorrectly calculate the sum of successes or failures, or to use the wrong formula for the MLE of a binomial proportion, such as simply averaging the proportions of successes in each trial (which is not applicable here as \(n\) is fixed). For example, if one made an arithmetic error and got \(S=30\), then \(\hat{p} = 30/50 = 0.60\). If \(S=37.5\) (an impossible sum, but for illustration of error), \(\hat{p}=37.5/50 = 0.75\). If \(S=30\), \(\hat{p}=30/50=0.6\). If \(S=33.5\), \(\hat{p}=33.5/50=0.67\).