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.
#Find the probability that a randomly selected person has an IQ greater than 65.
pnorm(65, 100, 15, lower.tail = FALSE)
## [1] 0.9901847
The probability that a randomly selected person has an IQ of greater than 65 is ~ 99%.
#Find the probability that a randomly selected person has an IQ less than 150.
pnorm(150, 100, 15, lower.tail = TRUE)
## [1] 0.9995709
The probability that a randomly selected person has an IQ of less than 150 is ~ 100%.
Assume the same mean and standard deviation of IQ scores that was described in question 1.
#Find the minimum qualifying IQ score to be considered in the top 5%.
qnorm(0.05, 100, 15, lower.tail = FALSE)
## [1] 124.6728
The minimum IQ score to be considered in the top 5% is 124.
#Find the probability that a randomly selected person has an IQ score greater than 110.
pnorm(110, 100, 15, lower.tail = TRUE)
## [1] 0.7475075
The probability that a randomly selected person has an IQ score greater than 110 is ~ 75%.
\[z = \frac{(x - \mu)}{\sigma} \]
#Using the formula provided, find the z-score for an IQ of 140.
(140-100)/15
## [1] 2.666667
The z-score for an IQ score of 140 is ~ 2.67.
Yes. This z-score is 2.67 which is more than 2 standard deviations from the mean, so an IQ score of 140 would be considered unusual.
#Find the probability of getting an IQ greater than 140.
pnorm(140, 100, 15, lower.tail = FALSE)
## [1] 0.003830381
The probability of getting an IQ score greater than 140 is ~ 0.38% or 0%.
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.
#Find the number of questions you expect to answer correctly on average.
(1/5)*15
## [1] 3
If there are 15 multiple choice questions on an exam, when each question has 5 possible choices, and you guess on every question, the number you can expect to answer correctly is 3.
#Find the probability that you get every question correct.
dbinom(15,15,0.2)
## [1] 3.2768e-11
The probability that you get every question correct is ~ 3.28 x 10^-11, or 0.0000000000328, or 0%.
#Find the probability that you get every question incorrect.
dbinom(0,15,0.2)
## [1] 0.03518437
The probability that you get every question incorrect is ~ 3.5%.
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.
#Find the number needed to score exactly 60%
(60*15)/100
## [1] 9
One needs to answer 9 questions correctly in order to score 60%.
#Find the probability of failing, given that a grade of 60% or lower is considered failing.
pbinom(9,15,0.2)
## [1] 0.9998868
If a grade of 60% or lower is considered failing, the probability of you failing is ~ 99.9%, or 100%.
#Find how many you must answer correctly in order to score at least 80%.
(80*15)/100
## [1] 12
In order to score at least 80% and maintain a passing grade, you must answer at least 12 questions correctly.
#Find the probability of maintaining a passing grade, with at least 80%.
1-pbinom(11,15,0.2)
## [1] 1.011253e-06
The probability of scoring at least 80% is ~ 0.00000101, or 0%.
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.
#Given that you schedule 5 employess, find the probability that all 5 show up.
dbinom(5,5,0.8)
## [1] 0.32768
The probability that 5 out of the 5 scheduled employees come to work is ~ 33%.
#Given that you schedule 7 employees, find the probability that at least 5 show up.
dbinom(5:7,7,0.8)
## [1] 0.2752512 0.3670016 0.2097152
#Assign the vectors of 5-7 to "x".
x<-dbinom(5:7,7,0.8)
#Add the proabilities of 5-7.
sum(x)
## [1] 0.851968
Given that you schedule 7 employees, the probability that at least 5 come to work is ~ 85%.
#Find the number of employees you need to schedule to be 99% sure at least 5 come to work.
1-pbinom(4,8,0.8)
## [1] 0.9437184
1-pbinom(4,9,0.8)
## [1] 0.9804186
1-pbinom(4,10,0.8)
## [1] 0.9936306
1-pbinom(4,11,0.8)
## [1] 0.9980346
1-pbinom(4,12,0.8)
## [1] 0.9994188
You need to schedule at least 10 employees in order to be 99% sure at least 5 of them show up.
#Set a seed of 5 to ensure the same numbers are generated continuously.
set.seed(5)
#Generate a random sample of 10,000 numbers from a normal distribution with a mean of 51 and a s.d. of 7. Assign this random sample to "rand_nums".
rand_nums<-rnorm(10000,51,7)
#Create a histogram of that random sample with a title and labels. Be sure the maximum value on the y-axis supports the maximum value on the x-axis.
hist(rand_nums, main = "Random Sample of 10,000 Numbers", xlab = "Frequency of Occurrences", ylab = "Random Numbers", ylim = range(pretty(c(0,3000,500))))
#Generate a table of random values that are below 40.
table(rand_nums<40)
##
## FALSE TRUE
## 9414 586
There are 598 random numbers that fall below 40.
#Find the probability that one of these values is below 40.
pnorm(40,51,7)
## [1] 0.05804157
#Given that there are 10,000 values, find how many fall below 40.
0.0580*10000
## [1] 580
Out of 10,000 random values, given a mean of 51 and a s.d. of 7, I can expect 580 of them to fall below 40.
Yes, out of 10,000 various options, 598 and 580 are reasonably close figures.