Project 35: Sampling Distribution of P-Hat

Intro Problem: Suppose you were to guess on every question of a 100-question multiple choice test where each question has 5 answer choices (A, B, C, D, E).  What is the probability you answer less than 30% of the questions correctly?

The sampling distribution of p-hat is approximately normal with mean .2 and standard deviation sqrt(.2*.8/100) = .04.

Project 35: Variables 'p', 'x', and 'n' have been initialized.  There are also working methods called called normalcdf and invNorm

p is the population proportion or true proportion (.2 in the example above)

x is the number of successes (30 in the example above)

n is the number of trials or the sample size (100 in the example above)

Review projects 2-5 if you need a reminder of how normalcdf and invNorm work.

Task: Appropriately initialize the values for 'z' and 'prob' where z represents the number of standard deviations that p-hat is away from the mean and prob represents the probability of obtaining a random p-hat less than the one obtained.

Example: If p = .2, x = 30, n = 100 then z should be 2.5 and prob should be .9983.

**If your code works for 5 test cases, you can enter your e-mail address

Universal Computational Math Methods:

pow(5,2) returns 25.0

abs(-3.0) returns 3

sqrt(49.0) returns 7.0