Instructions
- Update the author line at the top to have your name in it.
- You must knit this document to an html file and publish it to RPubs. Once you have published your project to the web, you must copy the url link into the appropriate Course Project assignment in MyOpenMath before 9:00am on the due date.
- Answer all the following questions completely. Some may ask for written responses.
- Use R chunks for code to be evaluated where needed and always comment all of your code so the reader can understand what your code aims to accomplish.
- Proofread your knitted document before publishing it to ensure it looks the way you want it to. Use double spaces at the end of a line to create a line break and make sure text does not have a header label that isn’t supposed to.
- Delete these instructions from your published project.
Purpose
This project will demonstrate your understanding of the normal and binomial probability distributions in R and RStudio.
Question 1
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.
- P(x > 65)
1 - pnorm(65, mean = 100, sd = 15)
## [1] 0.9901847
- P(x < 150)
pnorm(150, mean = 100, sd = 15)
## [1] 0.9995709
Question 2
Assume the same mean and standard deviation of IQ scores that was described in question 2.
- A high school offers a special program for gifted students. In order to qualify, students must have IQ scores in the top 5%. What is the minimum qualifying IQ?
qnorm(0.95, 100, 15)
## [1] 124.6728
- If one person is randomly selected, what is the probability that their IQ score is greater than 125?
pnorm(125, mean = 100, sd = 15)
## [1] 0.9522096
Question 3
- Still using the mean and standard deviation from question 1, what is the z-score for an IQ of 140?
(140 - 100) / 15
## [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. The mean is 100, therefore 140 is more than 2 standard deviation
- What is the probability of getting an IQ greater than 140?
pnorm(140, mean = 100, sd = 15)
## [1] 0.9961696
Question 4
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.
- How many questions do you expect to answer correct on average?
15*.20
## [1] 3
- What is the probability that you get every question correct?
dbinom(x = 15, size = 15, prob = .20)
## [1] 3.2768e-11
- What is the probability that you get every question incorrect?
dbinom(x = 0, size = 15, prob = .20)
## [1] 0.03518437
Question 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.
- How many questions does one need to answer correctly in order score exactly a 60%?
dbinom(x = 9, size = 15, prob = .20)
## [1] 0.0006717597
- If a grade of 60% or lower is considered failing, then what is the probability of you failing?
pbinom(q = 9, size = 15, prob = .20)
## [1] 0.9998868
- If you need a grade of 80% or higher on this quiz to maintain a passing grade, what is the probability of you maintaining that passing grade?
pbinom(q = 12, size = 15, prob = .20, lower.tail = FALSE)
## [1] 5.704909e-08
Question 6
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.
- Suppose you schedule 5 employees, what is the probability that all 5 come to work?
dbinom(x = 5, size = 5, prob = .80)
## [1] 0.32768
- Suppose you schedule 7 employees, what is the probability that at least 5 come to work?
pbinom(q = 5, size = 7, prob = .80, lower.tail = FALSE)
## [1] 0.5767168
- It is really important that you have at least 5 servers show up! How many employees should you schedule in order to be 99% confident that at least 5 show up? Hint: there is no single formula for the answer here, perhaps use some kind of trial and error method, but show all work in an r chunk below.
pbinom(q = 5, size = c(10:20), prob = .80, lower.tail = FALSE) *100
## [1] 96.72065 98.83458 99.60969 99.87544 99.96181 99.98868 99.99674
## [8] 99.99908 99.99975 99.99993 99.99998
12 is the lowest number of employees to schedule in order have 99% confidence