<s>[INST] Calculating the following MLE Q. A biased die favours the number 2. It's rolled 4 times and 2 comes up twice. It's rolled again 4 times and 2 comes up once. Calculate the Likelihood and find the MLE.
My working out:
$L(\theta;x) = \binom{8}{3}\theta^3(1-\theta)^5$, then taking the first derivative to find the local maximum $\binom{8}{3}\theta^2(1-\theta)^4(3(1-\theta) - 5\theta)=0 \implies \theta = \frac{3}{8}$ we take the second derivative to check the turning points. $\frac{\partial L(\theta;x)}{\partial \theta}=2\binom{8}{3}\theta(1-\theta)^3(32\theta^2-25\theta+3)$ plugging in for $\theta = \frac{3}{8}$ we finally get $2 \cdot 56 \cdot 3/8 \cdot (2/8)^3(32 \cdot (3/8)^3-25\cdot 3/8 + 3) = -2.06$ therefore, $\theta = \frac{3}{8}$ is a global maximum. Have i derived the MLE correctly?
 [/INST] Your derivative is correct. If we exclude the values $\theta=0$ and $\theta=1$ the equation is
$$3(1-\theta) - 5\theta=0$$
$$3-3\theta - 5\theta=0$$
$$3=8\theta \Rightarrow\theta=\frac38$$
Finally you can evaluate if it is a (local) minimum or (local) maximum. The second derivative is $2 \theta(28 \theta^2 - 21 \theta + 3) (1 - \theta)^3$
</s>