Solution (source code)

= Solution

Put $K=nY$. Apart from a factor independent of $p$, the likelihood is
$$
L(p)=p^{nY}(1-p)^{n(1-Y)}.
$$
Thus the <score function> and <Fisher information matrix> are
$$
S(p)=\ell'(p)=n\left(\frac Yp-\frac{1-Y}{1-p}\right)
=\frac{n(Y-p)}{p(1-p)},
\qquad
I(p)=\frac n{p(1-p)}.
$$

The <Newton method> and <Fisher scoring> updates are respectively
$$
p^{(r+1)}=p^{(r)}-\frac{\ell'(p^{(r)})}{\ell''(p^{(r)})},
\qquad
p^{(r+1)}=p^{(r)}+I(p^{(r)})^{-1}S(p^{(r)}).
$$
Since $\widehat p=Y$, initialization at $p^{(0)}=Y$ requires zero steps for either algorithm. Moreover,
$$
p+I(p)^{-1}S(p)=p+\frac{p(1-p)}n\frac{n(Y-p)}{p(1-p)}=Y,
$$
so <binomial-proportion Fisher scoring> reaches the MLE in one step from every interior $p^{(0)}\ne Y$.