Area under the curve, Part I. (4.1, p. 142) What percent of a standard normal distribution \(N(\mu=0, \sigma=1)\) is found in each region? Be sure to draw a graph.

  1. \(Z < -1.35\)
# .0885
normalPlot(0, 1, bound=c(-Inf, -1.35))

(b) \(Z > 1.48\)

# .0694
normalPlot(0, 1, bound=c(1.48, Inf))

(c) \(-0.4 < Z < 1.5\)

# .589
normalPlot(0, 1, bound=c(-0.4, 1.5))

(d) \(|Z| > 2\)

# 0.046
#normalPlot(0, 1, bound=c(-2, 2), tails = FALSE)
normalPlot(0, 1, bound=c(-2, 2), tails = TRUE)

print(1 - .954)
## [1] 0.046

Triathlon times, Part I (4.4, p. 142) 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:

Remember: a better performance corresponds to a faster finish.

  1. Write down the short-hand for these two normal distributions.
# Men: N(4313, 583)
# Women: N(5261, 807)
  1. What are the Z-scores for Leo’s and Mary’s finishing times? What do these Z-scores tell you?
# higher number/time => slower/worse. Flip sign for interpretability
LeoZ = (4313 - 4948)/583
MaryZ = (5261 - 5513)/807
print(LeoZ)
## [1] -1.089194
print(MaryZ)
## [1] -0.3122677
# The Z score tells me that leo is more negative standard deviations (-1.089) away from the mean
# This means that compared to other men, he did worse than Mary did compared to other women
# (-.312).
# The Z-score is the normalized version of their raw scores (raw finish times in seconds)
  1. Did Leo or Mary rank better in their respective groups? Explain your reasoning.
# Leo ranked worse compared to Mary since he is -1.089 standard deviations away
# from the mean. Mary is only -.312 standard deviations away from the mean.
# They both did worse than average in their gender groups.
  1. What percent of the triathletes did Leo finish faster than in his group?
normalPlot(4313, 583, bounds = c(4948, Inf))

# He was faster than 13.8% of others in his group. Remember that plot should be
# flipped about x-axis for interpretability as higher times are worse/slower
  1. What percent of the triathletes did Mary finish faster than in her group?
normalPlot(5261, 807, bounds = c(5513, Inf))

# She was faster than 37.7% of others in her group. Remember that plot should be
# flipped about x-axis for interpretability as higher times are worse/slower
  1. If the distributions of finishing times are not nearly normal, would your answers to parts (b) - (e) change? Explain your reasoning.
# If the finishing times are not nearly normal, the answers would most likely change for parts b-e
# The normal probability distribution has specific equations/formulas to calculate these percents
# with Z-scores, and if these distributions are not nearly normal, I do not expect the calculated
# numbers to hold. Normality could be checked for with histograms and QQ plots.

Heights of female college students Below are heights of 25 female college students.

\[ \stackrel{1}{54}, \stackrel{2}{55}, \stackrel{3}{56}, \stackrel{4}{56}, \stackrel{5}{57}, \stackrel{6}{58}, \stackrel{7}{58}, \stackrel{8}{59}, \stackrel{9}{60}, \stackrel{10}{60}, \stackrel{11}{60}, \stackrel{12}{61}, \stackrel{13}{61}, \stackrel{14}{62}, \stackrel{15}{62}, \stackrel{16}{63}, \stackrel{17}{63}, \stackrel{18}{63}, \stackrel{19}{64}, \stackrel{20}{65}, \stackrel{21}{65}, \stackrel{22}{67}, \stackrel{23}{67}, \stackrel{24}{69}, \stackrel{25}{73} \]

  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.
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(heights)
## [1] 61.52
sd(heights)
## [1] 4.583667
rbound_68 = 1*4.58 + 61.52
rbound_68
## [1] 66.1
lbound_68 = 61.52 - 1*4.58
lbound_68
## [1] 56.94
print('1 standard deviation:')
## [1] "1 standard deviation:"
sum(heights > lbound_68 & heights < rbound_68)/length(heights) # 68%
## [1] 0.68
rbound_95 = 2*4.58 + 61.52
rbound_95
## [1] 70.68
lbound_95 = 61.52 - 2*4.58
lbound_95
## [1] 52.36
print('2 standard deviation:')
## [1] "2 standard deviation:"
sum(heights > lbound_95 & heights < rbound_95)/length(heights) # 96%
## [1] 0.96
rbound_99 = 3*4.58 + 61.52
rbound_99
## [1] 75.26
lbound_99 = 61.52 - 3*4.58
lbound_99
## [1] 47.78
print('3 standard deviation:')
## [1] "3 standard deviation:"
sum(heights > lbound_99 & heights < rbound_99)/length(heights) # 100%
## [1] 1
# heights approximately follows since it is 68-96-100 at 1/2/3 standard deviations
  1. Do these data appear to follow a normal distribution? Explain your reasoning using the graphs provided below.

# Use the DATA606::qqnormsim function

Defective rate. (4.14, p. 148) 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?
.98**9 * .02
## [1] 0.01667496
  1. What is the probability that the machine produces no defective transistors in a batch of 100?
.98**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?
# geometric
# on average expect 1/.02 = 50 transistors
1/.02
## [1] 50
# standard devation = sqrt((1-p)/(p**2)) = 49.49747
sqrt((1-.02)/(.02**2))
## [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?
# geometric
# on average expect 1/.05 = 20 transistors
1/.05
## [1] 20
# standard devation = sqrt((1-p)/(p**2)) = 19.49
sqrt((1-.05)/(.05**2))
## [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 the event decreases the mean and standard deviation of wait time
# until success

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.

  1. Use the binomial model to calculate the probability that two of them will be boys.
nchoosek(3,2)*(.51**2)*(.49**1)
## [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 = (.51**2)*(.49**1) = 0.127449
# bgb = (.51**2)*(.49**1) = 0.127449
# gbb = (.51**2)*(.49**1) = 0.127449
(.51**2*.49) * 3
## [1] 0.382347
# it matches with a)
  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).
# The approach from part b is more tedious because we need to write a probability out for each
# way to have 3 boys in 8 kids. Part a) simplifies this with the nCk portion.
nchoosek(8,3)*(.51**3)*(.49**5)
## [1] 0.2098355

Serving in volleyball. (4.30, p. 162) 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?
# 10th shot is 3rd success:
nchoosek(9,2)*(.15**3)*(.85**7)
## [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?
# we are told her serves are independent, so 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?
# we are told her serves are independent. The previous successes/failures have no impact
# on the probaility of her next success if they are independent. Thust the probability
# of her next success is still 15%