Chapter 3 - Distributions of Random Variables

Graded: 3.2 (see normalPlot), 3.4, 3.18 (use qqnormsim from lab 3), 3.22, 3.38, 3.42 3.2 Area under the curve, Part II. What percent of a standard normal distribution N(µ = 0, ! = 1) is found in each region? Be sure to draw a graph. (a) Z > !1.13 Z=(x?????)/?? ???1.13=(x???0)/1 x=???1.13.

x=seq(-3,3,length=500)
y=dnorm(x,mean=0,sd=1)
plot(x,y,type="l")
x=seq(-1.13,3,length=100)
y=dnorm(x,mean=0,sd=1)
polygon(c(-1.13,x,3),c(0,y,0),col="lightgrey")
arrows(-1.7,0.08,-1.14,0.0,length=.13)
text(-1.9,0.1,"-1.13")

1-pnorm(-1.13)
## [1] 0.8707619
  1. Z < 0.18
x=seq(-3,3,length=500)
y=dnorm(x,mean=0,sd=1)
plot(x,y,type="l")
x=seq(-3,0.18,length=100)
y=dnorm(x,mean=0,sd=1)
polygon(c(-3,x,0.18),c(0,y,0),col="lightgrey")
arrows(0.6,0.08,0.19,0.0,length=.13)
text(0.6,0.1,"0.18")

pnorm(0.18)
## [1] 0.5714237
  1. Z > 8
x=seq(-3,10,length=500)
y=dnorm(x,mean=0,sd=1)
plot(x,y,type="l")
x=seq(8,10,length=100)
y=dnorm(x,mean=0,sd=1)
polygon(c(8,x,10),c(0,y,0),col="blue")

a <- 1 - pnorm(8)
a
## [1] 6.661338e-16
  1. |Z| < 0.5
x=seq(-3,3,length=500)
y=dnorm(x,mean=0,sd=1)
plot(x,y,type="l")
x=seq(-0.5,0.5,length=100)
y=dnorm(x,mean=0,sd=1)
polygon(c(-0.5,x,0.5),c(0,y,0),col="blue")

pnorm(0.5)
## [1] 0.6914625
pnorm(-0.5)
## [1] 0.3085375

3.4 Triathlon times, Part I. In triathlons, it is common for racers to be placed into age and gender groups. Friends Leo and Mary both completed the Hermosa Beach Triathlon, where Leo competed in the Men, Ages 30 - 34 group while Mary competed in the Women, Ages 25 - 29 group. Leo completed the race in 1:22:28 (4948 seconds), while Mary completed the race in 1:31:53 (5513 seconds). Obviously Leo finished faster, but they are curious about how they did within their respective groups. Can you help them? Here is some information on the performance of their groups: . The finishing times of the Men, Ages 30 - 34 group has a mean of 4313 seconds with a standard deviation of 583 seconds. . The finishing times of the Women, Ages 25 - 29 group has a mean of 5261 seconds with a standard deviation of 807 seconds. . The distributions of finishing times for both groups are approximately Normal. Remember: a better performance corresponds to a faster finish. (a) Write down the short-hand for these two normal distributions. Men, Ages 30 - 34 group: N(??=4313,??=583) Women, Ages 25 - 29 group: N(??=5261,??=807)

  1. What are the Z-scores for Leo’s and Mary’s finishing times? What do these Z-scores tell you?
Leo_Z_score <- (4948-4313)/583
round(Leo_Z_score, 3) 
## [1] 1.089
Mary_Z_score <- (5513-5261)/807
round(Mary_Z_score, 3)
## [1] 0.312

Leo’s z score is 1.089 and Mary’s z score is 0.312, respectively, which means that Leo finished 1.089 standard deviation above his group and mary finished 0.312 standard deviation above hers.

  1. Did Leo or Mary rank better in their respective groups? Explain your reasoning. Mary ranked better, they both finised above their respective group’s mean but Mary’s z score in closer to the mean compared to Leo’s. As you know, in this normal distribution, the closer to the mean is the better.

  2. What percent of the triathletes did Leo finish faster than in his group?

1 - round(pnorm(Leo_Z_score), 3)
## [1] 0.138

Leo finish faster than 13.8% of people in his group.

  1. What percent of the triathletes did Mary finish faster than in her group?
1 - round(pnorm(Mary_Z_score), 3)
## [1] 0.377

Mary finish faster than 37.7% of people in her group.

  1. If the distributions of finishing times are not nearly normal, would your answers to parts (b) - (e) change? Explain your reasoning. The Z-scores would remain the same. The rest of the answers would change, because we can’t calculate probabilities and percentiles using Z-scores for non-normal distributions.

3.18 Heights of female college students. Below are heights of 25 female college students. 1 54, 2 55, 3 56, 4 56, 5 57, 6 58, 7 58, 8 59, 9 60, 10 60, 11 60, 12 61, 13 61, 14 62, 15 62, 16 63, 17 63, 18 63, 19 64, 20 65, 21 65, 22 67, 23 67, 24 69, 25 73 (a) The mean height is 61.52 inches with a standard deviation of 4.58 inches. Use this information to determine if the heights approximately follow the 68-95-99.7% Rule.

The 68-95-99.7% Rule states: For the normal distributions,68% of the data fall within 1 standard deviation(sd) of the mean, 95% within 2 sd, and 99.7 within 3 sd.

heights <- c(54,55,56,56,57,58,58,59,60,60,60,61,61,62,62,63,63,63,64,65,65,67,67,69,73)
mean <- 61.52
sd <- 4.58

for 68%

a1 <- mean - sd
a2 <- mean + sd
v1 <- pnorm(a2,mean,sd) - pnorm(a1,mean,sd)
v1
## [1] 0.6826895

for 95%

b1 <- mean - 2*sd
b2 <- mean + 2*sd
v2 <- pnorm(b2,mean,sd) - pnorm(b1,mean,sd)
v2
## [1] 0.9544997

for 99.7%

c1 <- mean - 3*sd
c2 <- mean + 3*sd
v3 <- pnorm(c2,mean,sd) - pnorm(c1,mean,sd)
v3
## [1] 0.9973002

From above data, We can say that the heights adhere to the 68-95-99.7 rule.

  1. Do these data appear to follow a normal distribution? Explain your reasoning using the graphs provided below. Yes the data represented by the graphs above appear to follow a normal distribution. It’s a little harder to tell based on the histogram than on the normal probability plot. In the histogram the shape created by the tops of the bars roughly follows the normal curve, but in the normal probability plot, it’s much clearer that the data follows a straight line.

Yes, the data represented by the graphs above appear to follow a normal distribution

3.22 Defective rate. A machine that produces a special type of transistor (a component of computers) has a 2% defective rate. The production is considered a random process where each transistor is independent of the others. (a) What is the probability that the 10th transistor produced is the first with a defect?

p <- .02
n <- 10
P <- (1-p)^(n-1)*p
round(P, 3)
## [1] 0.017

So 0.017 is the probability that the 10th transistor produced is the first with a defect

  1. What is the probability that the machine produces no defective transistors in a batch of 100?
round((1-p)^100, 3)
## [1] 0.133

The probability is 0.133.

  1. On average, how many transistors would you expect to be produced before the first with a defect? What is the standard deviation?
1/p
## [1] 50
sqrt((1-p)/(p^2))
## [1] 49.49747

So we can expect to produce 50 working transistors before making a defective one, with a standard deviation of 49.4975.

  1. Another machine that also produces transistors has a 5% defective rate where each transistor is produced independent of the others. On average how many transistors would you expect to be produced with this machine before the first with a defect? What is the standard deviation?
p <- 0.05
1/p
## [1] 20
sqrt((1-p)/(p^2))
## [1] 19.49359

On 2nd machine in avereage every 20 products will have first defective product. The standard deviation is 19.49359

  1. Based on your answers to parts (c) and (d), how does increasing the probability of an event a???ect the mean and standard deviation of the wait time until success?

Increasing the probability of an event (that is a Bernoulli random variable) makes both the expected value and the standard deviation lower.

3.38 Male children. While it is often assumed that the probabilities of having a boy or a girl are the same, the actual probability of having a boy is slightly higher at 0.51. Suppose a couple plans to have 3 kids. (a) Use the binomial model to calculate the probability that two of them will be boys.

p = .51
P = round(dbinom(2,3,p),3)
P
## [1] 0.382
  1. Write out all possible orderings of 3 children, 2 of whom are boys. Use these scenarios to calculate the same probability from part (a) but using the addition rule for disjoint outcomes. Confirm that your answers from parts (a) and (b) match.

There are three possible orderings of the children. Each with a probability of 0.510.510.49

p_2boys_1girl=0.51*0.51*0.49
p_2boys_1girl
## [1] 0.127449

Boy, Boy, Girl = 0.127449 Boy, Girl, Boy = 0.127449 Girl, Boy, Boy = 0.127449

round(0.127449*3, 3)
## [1] 0.382
  1. If we wanted to calculate the probability that a couple who plans to have 8 kids will have 3 boys, briefly describe why the approach from part (b) would be more tedious than the approach from part (a).

In this approach there are 56 different ways you could have exactly 3 boys out of 8 kids, so you’d have to calculate the probability of having exactly 3 boys and then add it up 56 times.

dbinom(3,8,0.51)
## [1] 0.2098355

probability is 0.2098355

3.42 Serving in volleyball. A not-so-skilled volleyball player has a 15% chance of making the serve, which involves hitting the ball so it passes over the net on a trajectory such that it will land in the opposing team’s court. Suppose that her serves are independent of each other. (a) What is the probability that on the 10th try she will make her 3rd successful serve?

the probability of exactly 2 successes in the first 9 trials

p = 0.15
P = dbinom(2,9,p)

multiply 0.15 (the probability that she will be successful on her 10th try)

round(P * .15,3)
## [1] 0.039

So the probabilty is 0.039

  1. Suppose she has made two successful serves in nine attempts. What is the probability that her 10th serve will be successful? The probability that her 10th serve will be successful is still 0.15 because the trials are independent.

  2. Even though parts (a) and (b) discuss the same scenario, the probabilities you calculated should be different. Can you explain the reason for this discrepancy? Part (b) only asks about the probability of the 10th trial whereas part (a) asks about the joint probability of all of the first 10 trials.