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.
#Use the pnorm() function to find x
pnorm(65,100,15,lower.tail = FALSE)
## [1] 0.9901847
Here x = .9901
#Use the pnorm() function to find x
pnorm(150,100,15,lower.tail = TRUE)
## [1] 0.9995709
** Here x = .9995 **
Assume the same mean and standard deviation of IQ scores that was described in question 1.
#Use the qnorm() function to find the minimum qualifying IQ
qnorm(.05,100,15,lower.tail = FALSE)
## [1] 124.6728
** The minimum qualifying IQ is 124.7 **
#Use the pnorm() function
pnorm(110,100,15,lower.tail = FALSE)
## [1] 0.2524925
** If one person is randomly selected then the probability of their IQ score being greater than 110 is 25.25% **
# The z-score of an IQ of 140
(140 - 100)/15
## [1] 2.666667
** The z-score for an IQ of 140 is 2.67 **
** Yes, an IQ score of 140 is considered unusual because its standard deviation lies more than two standard deviations from the mean. **
#Use the pnorm() function to find the probabilty of getting an IQ greater than 140
pnorm(140,100,15,lower.tail = FALSE)
## [1] 0.003830381
** The probability of getting a higher IQ score of 140 is .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.
#Multiply the value of each choice to the number of questions to find the expected average.
0.2*15
## [1] 3
** You should expect to get an average of 3 questions right by randomly guessing on each one. **
#Use the dbinom() function to find the probability of getting each question correct
dbinom(15,15,0.2)
## [1] 3.2768e-11
** The probability of getting every question corect is 3.2768e-11 which is very low, practically zero.**
#Use the dbinom() function to find the probability of getting each question incorrect
dbinom(0,15,0.2)
## [1] 0.03518437
** The probability of getting each 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.
#Correct number of question to get an exact score of 60%
0.6*15
## [1] 9
** One must get exactly 9 questions right to get a score 60% **
#Use the pbinom() function to find the probability of failing
pbinom(9,15,0.2)
## [1] 0.9998868
** The probability of you failing for a grade of 60% or lower is 99.99% **
#Use the pbinom() function to find the probability of maintaining a passing grade
pbinom(11,15,0.2,lower.tail = FALSE)
## [1] 1.011253e-06
** The probability of maintaining a passing grade 1.011253e-06, which is practically 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.
#Use the dbinom() function to find this probability
dbinom(5,5,0.8)
## [1] 0.32768
** There is a 32.8% chance of all the employees coming to work. **
#Use the pbinom() function to find the probability of atleast 5 out 7 employees showing up
pbinom(5,7,0.8, lower.tail = FALSE)
## [1] 0.5767168
** The probability of at least 5 employees showing up is 57.7% **
#In orderto be 99% confident that atleast 5 servers show up we need a bigger number that is not close to five such as 10 or 11 maybe 12
#1
pbinom(5,10,0.8,lower.tail = FALSE)
## [1] 0.9672065
#2
pbinom(5,11,0.8,lower.tail = FALSE)
## [1] 0.9883458
#3
pbinom(5,12,0.8,lower.tail = FALSE)
## [1] 0.9960969
** To be 99% confident that 5 servers will show up, I should schedule atleast 12 employees. **
#Generate random sample of 10000 number and store it into object labeled "rand_nums"
rand_nums <- rnorm(10000,51,7)
#Histogram of the random sample
hist(rand_nums)