Purpose

In this project, students will demonstrate their understanding of probability and the normal and binomial distributions.


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.

  1. P(x > 65)
#Use the pnorm() function to find x
pnorm(65,100,15,lower.tail = FALSE)
## [1] 0.9901847

Here x = .9901

  1. P(x < 150)
#Use the pnorm() function to find x
pnorm(150,100,15,lower.tail = TRUE)
## [1] 0.9995709

** Here x = .9995 **

Question 2

Assume the same mean and standard deviation of IQ scores that was described in question 1.

  1. 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?
#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 **

  1. If one person is randomly selected, what is the probability that their IQ score is greater than 110?
#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% **

Question 3

  1. Still using the mean and standard deviation from question 1, what is the z-score for an IQ of 140?
# 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 **

  1. 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, an IQ score of 140 is considered unusual because its standard deviation lies more than two standard deviations from the mean. **

  1. What is the probability of getting an IQ greater than 140?
#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%. **

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.

  1. How many questions do you expect to answer correctly on average?
#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. **

  1. What is the probability that you get every question correct?
#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.**

  1. What is the probability that you get every question incorrect?
#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% **

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.

  1. How many questions does one need to answer correctly in order score exactly a 60%?
#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% **

  1. If a grade of 60% or lower is considered failing, then what is the probability of you failing?
#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% **

  1. 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?
#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%. **

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.

  1. Suppose you schedule 5 employees, what is the probability that all 5 come to work?
#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. **

  1. Suppose you schedule 7 employees, what is the probability that at least 5 come 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% **

  1. 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, so maybe use some kind of trial and error method.
#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. **

Question 7

  1. Generate a random sample of 10,000 numbers from a normal distribution with mean of 51 and standard deviation of 7. Store that data in object called rand_nums.
#Generate random sample of 10000 number and store it into object labeled "rand_nums"
rand_nums <- rnorm(10000,51,7)
  1. Create a histogram of that random sample.
#Histogram of the random sample
hist(rand_nums)