Week 3 Homework

3.2 (see normalPlot)

What percent of a standard normal distribution N(μ = 0, sigma = 1) is found in each region? Be sure to draw a graph.

  1. Z > -1.13
normalPlot(bounds = c(-1.13,100))

p = 0.871

  1. Z < 0.18
normalPlot(bounds = c(-100,0.18))

p = 0.571

  1. Z > 8
normalPlot(bounds = c(8,1000))

p = 6.66e-16

  1. Abs(Z) < 0.5
normalPlot(bounds = c(-.5,.5))

p = 0.383

3.4

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.

  1. Write down the short-hand for these two normal distributions. Mens race: N(mean = 4313, sigma = 583) Womens race: N(mean = 5261, sigma = 807)

  2. What are the Z-scores for Leo’s and Mary’s finishing times? What do these Z-scores tell you? Leos Z-Score = (4948 - 4313)/583 = 1.089194 Marys Z-Score = (5513 - 5261)/807 = 0.3122677

These scores tell you how many standard deviations leo/marys times differ from the mean (negative z score is below mean, positive is above mean)

  1. Did Leo or Mary rank better in their respective groups? Explain your reasoning. Mary ranked better in her group. In this case, the lower the z-score the better the performance (i.e. lower time to finish).

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

male_mean <- 4313
male_sd <- 583

leo_time <- 4948

normalPlot(mean = male_mean, sd = male_sd, bounds = c(leo_time,100000))

Leo finished faster than 0.138 of his group.

  1. What percent of the triathletes did Mary finish faster than in her group?
female_mean <- 5261
female_sd <- 807

mary_time <- 5513

normalPlot(mean = female_mean, sd = female_sd, bounds = c(mary_time,100000))

Mary finished faster than 0.377 of her group.

  1. If the distributions of finishing times are not nearly normal, would your answers to parts
      1. change? Explain your reasoning.

Absolutely, we’ve been estimating the distribution to be normal, so all the calculations would change if the run times were not normally distributed.

3.18 (use qqnormsim from lab 3)

Below are heights of 25 female college students:

f_hgt <- 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)
f_mean <- mean(f_hgt)
f_sd <- sd(f_hgt)
  1. 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.
#68% is one SD wide of the mean

f_range <- c(f_mean - f_sd, f_mean + f_sd)
f_range
## [1] 56.93633 66.10367
sum(f_hgt > f_range[1] & f_hgt < f_range[2])/length(f_hgt)
## [1] 0.68
#Confirmed, 68% fall within 1 SD

#95% Fall within 2 SD

f_range <- c(f_mean - f_sd*2, f_mean + f_sd*2)
f_range
## [1] 52.35267 70.68733
sum(f_hgt > f_range[1] & f_hgt < f_range[2])/length(f_hgt)
## [1] 0.96
#Confirmed, 96% fall within 2 SD, a close approximation to 95%

#99.7 percent fall within 3 SD
f_range <- c(f_mean - f_sd*3, f_mean + f_sd*3)
f_range
## [1] 47.769 75.271
sum(f_hgt > f_range[1] & f_hgt < f_range[2])/length(f_hgt)
## [1] 1
#In this small sample, 100% fall within 3 SD.
  1. Do these data appear to follow a normal distribution? Explain your reasoning using the graphs provided below.
hist(f_hgt, freq = FALSE)
x <- 50:75
y <- dnorm(x = x, mean = f_mean, sd = f_sd)
lines(x = x, y = y, col = "blue")

qqnorm(f_hgt)
qqline(f_hgt)

Yes, they do appear to follow a normal distrubtion. The histogram stays within the bell curve of the simulated normal distributions, and the QQ plot shows a tight adherances to the normal line (with some outliers that can be seen in normal distributions).

3.22

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.

  1. What is the probability that the 10th transistor produced is the first with a defect?

In this case will be consider a “success” to be finding a defect.

p_success <- .02
n <- 10

#Finding success on the nth trial follows formula (1-p)^n-1 * p

(1 - p_success)^n * p_success
## [1] 0.01634146
  1. What is the probability that the machine produces no defective transistors in a batch of 100?

In this case we will simply find the probability of no success (in this case 1 - .02, or .98), and since these are disjoint we can simply multiply for each trial (in this case 100).

(1-p_success)^100
## [1] 0.1326196
  1. On average, how many transistors would you expect to be produced before the first with a defect? What is the standard deviation?

The average for geometric distributions is 1/p. Standard deviation is sqrt((1-p)/p^2)

average <- 1/p_success
average
## [1] 50
sigma <- sqrt((1-p_success)/p_success^2)
sigma
## [1] 49.49747
  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_success <- .05

average <- 1/p_success
average
## [1] 20
sigma <- sqrt((1-p_success)/p_success^2)
sigma
## [1] 19.49359
  1. Based on your answers to parts (c) and (d), how does increasing the probability of an event affect the mean and standard deviation of the wait time until success?

Increasing the probability of an event decreases the mean and standard deviation.

3.38

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.

  1. Use the binomial model to calculate the probability that two of them will be boys.
p <- .51
n <- 3
k <- 2
choose(n = n, k = k)*p^k*(1-p)^(n-k)
## [1] 0.382347
  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.

BBG BGB GBB

BBG <- p * p * (1-p)
BGB <- p * (1-p) * p
GBB <- (1-p) * p * p

BBG + BGB + GBB
## [1] 0.382347
BBG + BGB + GBB == choose(n = n, k = k)*p^k*(1-p)^(n-k)
## [1] TRUE
  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).

There are 56 ways to choose 3 from 8, so the approach from part (b) would entail calculating outcomes from 56 individual combinations and then combining them. The approach in part (a) is generalized and can produce the same result with a single formula.

3.42

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.

  1. What is the probability that on the 10th try she will make her 3rd successful serve?

For this we will calculate the probability of 2 successes within 9, and then multiply by the probability for an independent successful serve on the 10th.

p <- .15
n <- 9
k <- 2
(choose(n = n, k = k)*p^k*(1-p)^(n-k)) * .15
## [1] 0.03895012
  1. Suppose she has made two successful serves in nine attempts. What is the probability that her 10th serve will be successful?

Because the servers are independent, the probability of a success serve on any given attempt is still 15%.

  1. 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 (a) is asking for 2 successful serves within 9 AND a successful serve on the 10th. Part (b) is asking for the probability of a single successful serve, which is independent of previous serves.