Consider a multinomial trial with outcomes \(1,2, \ldots, k\) and respective
probabilities \(p_{1}, p_{2}, \ldots, p_{k} .\) Let ps denote the \(\mathrm{R}\)
vector for \(\left(p_{1}, p_{2}, \ldots, p_{k}\right) .\) Then a single random
trial of this multinomial is computed with the command multitrial (ps), where
the required \(\mathrm{R}\) functions are: \({ }^{2}\)
(a) Compute 10 random trials if \(\mathrm{ps}=\mathrm{c}(.3, .2, .2, .2, .1)\).
(b) Compute 10,000 random trials for ps as in (a). Check to see how close the
estimates of \(p_{i}\) are with \(p_{i}\).