Solution (source code)

= Solution

For observed counts $O_j$ and null expected counts $E_j=np_j$, the <Pearson chi-squared goodness-of-fit test> uses
$$
X^2=\sum_{j=1}^k\frac{(O_j-E_j)^2}{E_j}.
$$
When the null cell probabilities are specified and the expected counts grow, its limiting null distribution is
$$
\boxed{X^2\ \xrightarrow{d}\ \chi^2_{k-1}}.
$$
Here $k=6$, so the <limit> is $\chi^2_5$.