* do-file for Supplementary Exercise 5.59 of IPS7e version 13 /* works also with version 14 */ * binomial distribution * P(463<=X<=523) = P(X<=523) - P(X<=462) display binomial(1006,523,.49) display binomial(1006,462,.49) display binomial(1006,523,.49) - binomial(1006,462,.49) * normal approximation of binomial probability display normal((523+0.5-1006*.49)/sqrt(1006*.49*.51)) - normal((463-0.5-1006*.49)/sqrt(1006*.49*.51)) * direct normal approximation of distribution of p_hat display normal((0.52-0.49)/sqrt(.49*.51/1006)) - normal((0.46-0.49)/sqrt(.49*.51/1006))