Solution (source code)

= Solution

Use the <Pearson chi-squared test of homogeneity> for two multinomial samples. Under equal preference distributions, estimate the common probabilities from pooled counts, giving $(1/4,1/4,1/2)$. With row totals forty and sixty, the expected table is
$$
E=\begin{pmatrix}10&10&20\\15&15&30\end{pmatrix}.
$$
The <Pearson chi-squared statistic for contingency tables> is
$$
\begin{aligned}
X^2&=\frac4{10}+\frac1{10}+\frac9{20}+\frac4{15}+\frac1{15}+\frac9{30}\\
&=\frac{19}{12}\simeq1.58333.
\end{aligned}
$$
There are $(2-1)(3-1)=2$ degrees of freedom, after fitting the common category probabilities. All expected counts exceed five. Thus
$$
\boxed{p=e^{-19/24}\simeq0.4531.}
$$
At five percent, \b[do not reject the common preference distribution]. These data are consistent with that hypothesis; failure to reject does not prove equality. This conclusion differs from part a because a common nonuniform distribution, especially an overall preference for chocolate, is allowed here.