The probability distribution of the number of heads in 3 flips of a fair coin is the binomial distribution with n = 3 and p = , so that
(a) Obtaining uniform random numbers as instructed at the beginning of the Problems section, use the inverse transformation method to generate three random observations from this distribution, and then calculate the sample average to estimate the mean.
(b) Use the method of complementary random numbers [with the same uniform random numbers as in part (a)] to estimate the mean.
(c) Obtaining uniform random numbers as instructed at the beginning of the Problems section, simulate repeatedly flipping a coin in order to generate three random observations from this distribution, and then calculate the sample average to estimate the mean.
(d) Repeat part (c) with the method of complementary random numbers [with the same uniform random numbers as in part (c)] to estimate the mean.