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.
# Probability when x is more than 65
pnorm(65, mean = 100, sd = 15, lower.tail = FALSE)
## [1] 0.9901847
When x is more than 65 the probability is 99.02%
# Probability when x is less than 150
pnorm(150, mean = 100, sd = 15)
## [1] 0.9995709
When x is less than 150 the probability is 99.96%
Assume the same mean and standard deviation of IQ scores that was described in question 1.
# The minimum qualifying IQ
qnorm(0.05, mean = 100, sd = 15, lower.tail = FALSE)
## [1] 124.6728
The minimum qualifying IQ is approximately 124.67
# Probability of having an IQ score greater than 110
pnorm(110, mean = 100, sd = 15, lower.tail = FALSE)
## [1] 0.2524925
When randomly selected the probability of finding someone with an IQ score greater than 110 is 25.25%
# z-score of an IQ of 140
(140 - 100)/15
## [1] 2.666667
z-score for an IQ of 140 is 2.67
Yes. With a z-score of 2.67, an IQ of 140 is considered unusual.
# Probability of getting an IQ greater than 140
pnorm(140, mean = 100, sd = 15, lower.tail = FALSE)
## [1] 0.003830381
The probability of getting and IQ greater than 140 is 0.38%
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.
# Expected average
0.2*15
## [1] 3
The expected average is 3.
# Probability of getting every question correctly
dbinom(x = 15, size = 15, prob = 0.2)
## [1] 3.2768e-11
# Probability of getting every question incorrectly
dbinom(x = 0, size = 15, prob = 0.2)
## [1] 0.03518437
The probability of getting all the questions incorrectly is 3.52%
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.
# Expected correct answers for a score of exactly 60%
0.6*15
## [1] 9
In order to score exactly 60% someone need to get 9 questions right.
# Probabiity of failing
pbinom(q = 9, size = 15, prob = 0.2)
## [1] 0.9998868
For a grade of 60% or lower, the probability of failing is 99.99%
# Probability of maintaining a passing grade
pbinom(q = 11, size = 15, prob = 0.2, lower.tail = FALSE)
## [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.
dbinom(x = 5, size = 5, prob = 0.8)
## [1] 0.32768
The probability of all 5 employees coming to work is 32.77%
pbinom(q = 4, size = 7, prob = 0.8, lower.tail = FALSE)
## [1] 0.851968
If we schedule 7 employees, the probability of at least 5 employees coming to work is 85.20%
# find the number of employees that should be schedule to work to have 5 of them coming by calcuting with different sizes
pbinom(q = 4, size = 8, prob = 0.8, lower.tail = FALSE)
## [1] 0.9437184
pbinom(q = 4, size = 9, prob = 0.8, lower.tail = FALSE)
## [1] 0.9804186
pbinom(q = 4, size = 10, prob = 0.8, lower.tail = FALSE)
## [1] 0.9936306
10 employees should be scheudled to work if we want 5 emplpoyees to work.
# Generate a random sample and store it into an object called rand_nums
rand_nums <- rnorm(n = 10000, mean = 51, sd = 7)
# Histogram of rand_nums
hist(rand_nums)
# Number of values below 40
table(rand_nums < 40)
##
## FALSE TRUE
## 9440 560
614 values in rand_nums is below 40
# Expected number of values below 40
pnorm(q = 40, mean = 51, sd = 7)
## [1] 0.05804157
pnorm(q = 40, mean = 51, sd = 7) * 10000
## [1] 580.4157