In this project, students will demonstrate their understanding of probability and the normal and binomial distributions.
Assume IQ scores are normally distributed with a mean of 100 and a standard deviation of 15. If a person is randomly selected, find each of the requested probabilities. Here, x, denotes the IQ of the randomly selected person.
mean <- 100
sd <- 15
Zscore <- (65 - mean) / sd
1 - pnorm(Zscore)
## [1] 0.9901847
Zscore2 <- (150 - mean) / sd
1 - pnorm(Zscore2)
## [1] 0.0004290603
Assume the same mean and standard deviation of IQ scores that was described in question 1.
qnorm(1 - 0.05, mean, sd)
## [1] 124.6728
1-pnorm(110 - mean) / sd
## [1] 0.9333333
(140 - mean) / sd
## [1] 2.666667
We mentioned in week 6 that a data value is considered “unusual”
if it lies more than two standard deviations from the mean. Is an IQ of
140 considered unusual?
#yes as it is 2.66 standard deviations away from the mean.
What is the probability of getting an IQ greater than 140?
1 - pnorm(2.67)
## [1] 0.003792562
You are taking a 15-question multiple choice quiz and each question has 5 options (a,b,c,d,e) and you randomly guess every question.
probability_correct <- 1/5
questions <- 15
probability_correct * questions
## [1] 3
(1/5)^15
## [1] 3.2768e-11
(4/5)^15
## [1] 0.03518437
Consider still the 15-question multiple choice quiz that each question has 5 options (a,b,c,d,e) and you randomly guess every question.
15*(60/100)
## [1] 9
fail <- 9
# Probability of guessing a question correctly
probcorrect <- 1/5
# Probability of failing
pbinom(fail, size = questions, prob = probcorrect)
## [1] 0.9998868
pass <- 12
# Probability of passing
1 - pbinom(pass - 1, size = questions, prob = probcorrect)
## [1] 1.011253e-06
Suppose you own a catering company. You hire local college students as servers. Not being the most reliable employees, there is an 80% chance that any one server will actually show up for a scheduled event. For a wedding scheduled on Saturday, you need at least 5 servers.
p <- 0.8
n <- 5
dbinom(n, size = n, prob = p)
## [1] 0.32768
n2 <- 7
# Probability that at least 5 out of 7 servers show up
pbinom(5, size = n2, prob = p, lower.tail = FALSE)
## [1] 0.5767168
desired_prob <- 0.99
# Initialize the number of scheduled employees
scheduled_employees <- 5
# Iterate until we find the desired probability
mean_value <- 51
sd_value <- 7
sample_size <- 10000
randnum <- rnorm(sample_size, mean = mean_value, sd = sd_value)
hist(randnum)
sum(randnum < 40)
## [1] 562
prob_below_40 <- pnorm(40, mean = 51, sd = 7)
prob_below_40 * 10000
## [1] 580.4157