Problem 19.1 Easy Free

Maximum Likelihood for a Binomial

Let X∼Bin(12,p)X \sim \mathrm{Bin}(12,p) for some 0<p<10<p<1. Find the value of pp that maximises P[X=8]\mathbb{P}[X=8].

Work it out, then compare with the answer.

SolutionShow the worked solution

Key idea. The binomial coefficient does not depend on pp, so it is enough to maximise log⁡(p8(1−p)4)\log\bigl(p^8(1-p)^4\bigr).

We have

P[X=8]=(128)p8(1−p)4,\mathbb{P}[X=8]=\binom{12}{8}p^8(1-p)^4 ,

and (128)\binom{12}{8} is a positive constant. The logarithm is strictly increasing, so we may maximise

ℓ(p)=8log⁡p+4log⁡(1−p),0<p<1.\ell(p)=8\log p+4\log(1-p),\qquad 0<p<1 .

Differentiating,

ℓ′(p)=8p−41−p=8(1−p)−4pp(1−p)=8−12pp(1−p).\ell'(p)=\frac{8}{p}-\frac{4}{1-p}=\frac{8(1-p)-4p}{p(1-p)}=\frac{8-12p}{p(1-p)} .

The denominator is positive on (0,1)(0,1). Hence ℓ′(p)>0\ell'(p)>0 for p<23p<\tfrac23 and ℓ′(p)<0\ell'(p)<0 for p>23p>\tfrac23.

So ℓ\ell increases up to p=23p=\tfrac23 and decreases afterwards. The point p=23p=\tfrac23 is therefore the unique global maximiser on (0,1)(0,1). At this point

P[X=8]=495⋅28312=1408059049≈0.238.\mathbb{P}[X=8]=495\cdot\frac{2^8}{3^{12}}=\frac{14080}{59049}\approx 0.238 .
p=23\boxed{p=\tfrac{2}{3}}

Generalisation. For X∼Bin(n,p)X\sim\mathrm{Bin}(n,p) and an observation 0<k<n0<k<n, the same computation gives

ℓ′(p)=k−npp(1−p).\ell'(p)=\frac{k-np}{p(1-p)} .

The maximum likelihood estimate of pp is therefore the sample proportion p^=k/n\hat p=k/n.