This project will demonstrate your understanding of the normal and binomial probability distributions in R and RStudio.
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 that a randomly selected person has an IQ score greater than 65
1-pnorm(65 , mean= 100, sd = 15)
## [1] 0.9901847
The probability of selecting a person whith IQ < 65 is 99%
# Probability that a randomly selected person has an IQ score less than 150
pnorm(150 , mean = 100, sd = 15 )
## [1] 0.9995709
The probability of selecting person with IQ < 150 is 99%
Assume the same mean and standard deviation of IQ scores that was described in question 2.
# Found minimum qualifying IQ.
qnorm(0.95, mean = 100,sd= 15)
## [1] 124.6728
the minimum qualifying IQ is 125
# Probability of one person's IQ > 125
1-pnorm(125, 100, 15)
## [1] 0.04779035
The probability of selecting one person with IQ greater than 125 is 4%
# Find the Z-score for an IQ of 140 with mu = 100, sd = 15
(140 - 100)/ 15
## [1] 2.666667
The z-score for an IQ of 140 with mu = 100 and sd = 15 is 2.67
Yes, IQ af 140 is unusual because the standard deviation is 2.67 which is more then two.
# probability of IQ > 140.
1-pnorm(140, 100, 15)
## [1] 0.003830381
The probability of getting an IQ greater than 140 is 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.
# Expected average (mean)
0.2*15
## [1] 3
The expected average is three correct anwers.
# Getting 15/15 correct.
dbinom (15, 15, 0.2)
## [1] 3.2768e-11
The probability of getting 100% correct is 0.0000000000327
# Getting 0/15 correct.
dbinom(0 , 15, 0.2)
## [1] 0.03518437
The propability of getting everything incorrect is 3%
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.
# Getting exactly 60% correct.
(0.6 * 15)
## [1] 9
To get 60% 0f the test correct. there will have to be 9 answers right.
# Probability of getting 60% correct or lower
pbinom(9, 15, .2)
## [1] 0.9998868
To have a test grade of 60% or lower, the propability of failing this test is 99%.
# Probability of passing the quiz with 80% or more,ie x = 12 or more correct.
1- pbinom(q = 11,size = 15,prob = .2)
## [1] 1.011253e-06
the probability of maintaining a passing grade with 80% and more is 0.00000101%
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.
# probability of getting all five employees to come to work.
dbinom( 5, 5, .8)
## [1] 0.32768
the probability to have at least 5 employees comeing to work, from 5 employees scheduled is 33%
# probability of gettig at least 5 employees to come to work.
1-pbinom( 4, 7 , .8)
## [1] 0.851968
the probability to have at least 5 employees comeing to work, from 7 employees scheduled is 85%.
# Employees schedule, 99% confident Gtting 5 servers at least.
1-pbinom(4, 10, .99)
## [1] 1
1-pbinom(4 , 9, .99)
## [1] 1
1-pbinom(4, 8, .8)
## [1] 0.9437184
1-pbinom(4, 9 , .8)
## [1] 0.9804186
1-pbinom(4, 10, .8)
## [1] 0.9936306
We have to schedule 10 employees in order to be 99% cofident that at least 5 people show up.