Solution (source code)

= Solution

Under <independence>, the cell <probability> is the product of its row and column probabilities. Estimate these by the sample proportions. If $R_i,C_j$ are row and column totals and $N$ is the grand total, the fitted <expected count> is
$$
\boxed{E_{ij}=\frac{R_iC_j}{N}.}
$$
Here the row totals are $123,76,163,90$, the column totals $304,65,83$, and $N=452$. For example $E_{11}=123\cdot304/452=82.72566\ldots$, rounding to 82.73 as printed. The other entries follow identically.