Solution (source code)

= Solution

Under the product constraint the <log-likelihood> separates:
$$
\ell(\alpha,\beta)=\sum_i n_{i.}\log\alpha_i+\sum_jn_{.j}\log\beta_j.
$$
Maximizing the two simplex problems independently gives $\widehat\alpha_i=n_{i.}/N$ and $\widehat\beta_j=n_{.j}/N$. Hence
$$
\boxed{\widehat\theta_{ij}^{\,0}=\frac{n_{i.}n_{.j}}{N^2}.}
$$
The fitted expected cell counts under independence are consequently $N\widehat\theta_{ij}^{\,0}=n_{i.}n_{.j}/N$.