Uniform Distribution

punif ()

Examples:

a.Find P(X<4.8)

punif(4.8, 3,10)

b.Find P(X> 7.2)

Option 1:

punif(7.2,3,10, lower.tail = FALSE)

Option 2:

1-punif(7.2,3,10)

c.Find P(4<X< 8)

punif(8, 3,10) - punif(4,3,10)

qunif()

Examples:

a.Find the value of b such that, P(X<b) = 0.45

qunif(0.45, 3,10)

b.Find the value of b such that, P(X > b) = 0.4

qunif(1~0.4, 3,10)

Normal distribution

pnorm()

Examples:

a.P(Z<0.5) where Z is a standard normal random variable (Standard normal random variable has mean 0 and standard deviation 1).

pnorm(q = 0.5, mean = 0, sd = 1)

b.P(Z>0.7) where Z is a standard normal random variable.

Option 1: 1-P(Z<0.7)

pnorm(q = 0.7, mean = 0, sd = 1, lower.tail = FALSE)

Option 2: Use the argument “lower.tail = FALSE”

pnorm(q = 0.7, mean = 0, sd = 1, lower.tail = FALSE)

c.Calculate P(0.2<Z<0.5)

pnorm(0.5) - pnorm(0.2)

qnorm()

Example

1.Suppose that percentage grades in a large Calculus class follow a Normal distribution with a mean of 64 and a standard deviation of 12. What proportion of students fail this course (i.e., receive a grade below 50)?

If we let X represent the grade of a random student selected from this course, then we know that X∼N(64,12). To solve this question, we have to calculate P(X<50)

pnorm(q = 50, mean = 64, sd = 12)

2.Suppose that students in the bottom 10% of grades in this class are required to take a remedial math course before re-attempting the calculus course. What is the grade cutoff to receive this email?

To solve this problem, we are looking to find the value x such that P(X<x)=0.10

qnorm(p = 0.1, mean = 64, sd = 12)

3.Percentage grades in a statistics class follow a normal distribution with mean 65.5 and standard deviation 14.5.

What proportion of students in the class receive percentage grades between 60 and 70? i.e. P(60<X<70)

pnorm(70, 65.5, 14.5)-pnorm(60, 65.5, 14.5)

4.The professor decides to assign a grade of A+ to the students with the top 8% of the grades, and a grade of A to the next best 12%. What is the minimum percentage a student needs to earn a grade of A? (i.e. you need to find the value of x such that P(X < x)= 0.80 or P(X > x)= 0.20).

qnorm(0.8, 65.5, 14.5)

Practice Questions

  1. Speeds of a hockey player’s slapshots follow a uniform distribution on the interval from 54 to 67 miles per hour. What proportion of the player’s slapshots are faster than 61.8 mph?

1~punif(61.8,54,67)

  1. A variable X follows a uniform distribution on the interval from 37 to 84. If we know that \(P(48.2 \leq X \leq b) = 0.2872\), then what is the value of b? (Hint: cumulative probability to b should equal (0.2383 + 0.2872 = 0.5255)

qunif(0.5255,37,84)

Daily sales at a hotdog cart follow a normal distribution with mean $470 and standard deviation $70.

  1. What is the probability that the sales on a randomly selected day are at least $467? Use two different R commands to find this probability.

pnorm(q = 467, mean = 470, sd = 70, lower.tail = FALSE)

  1. On what proportion of days are the sales between $428 and $474?

pnorm(q = 474, mean = 470, sd = 70) - pnorm(q = 428, mean = 470, sd = 70)

  1. On only 20% of days, the sales are greater than what?

qnorm(0.80, mean = 470, sd = 70)