3.2 Area under the curve, Part II.

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

Standard normal distribution is listed as the probability in each plot below.

  1. \(Z>-1.13\)
#I decided to use shadeDist to plot and calculate.
require(fastGraph)

shadeDist(-1.13, axes=FALSE,lower.tail = FALSE, col=c("black","lightgrey"))

  1. \(Z<0.18\)
shadeDist(0.18, axes=FALSE,lower.tail = TRUE, col=c("black","darkred"))

  1. \(Z>8\)
shadeDist(8, axes=FALSE,lower.tail = FALSE, col=c("black","darkred"))

  1. \(Z<0.5\)
shadeDist(.5, axes=FALSE,lower.tail = TRUE, col=c("black","darkgray"))

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.\[N(\mu=4313,\sigma=583)\]
\[N(\mu=5261,\sigma=807)\]

  1. What are the Z-scores for Leo’s and Mary’s finishing times?
Leo_Z<--round((4948-4313)/583,3)
Mary_Z<--round((5513-5261)/807,3)

Leo’s Z-score is -1.089, while Mary’s Z-score is -0.312.

What do these Z-scores tell you?
Both performed worse than the mean, which implies that 50% of any randomly chosen contestant or either group would have finished faster. Leo underperformed, by estimation, 85% of randomly chosen men in the sample.

  1. Did Leo or Mary rank better in their respective groups? Explain your reasoning.
    Mary ranked better in her group than Leo did in his, as implied by her higher Z-score.

  2. What percent of the triathletes did Leo finish faster than in his group?
    Leo finished faster than 13.8% of his fellow competitors.

shadeDist(Leo_Z, axes=FALSE,lower.tail = TRUE, col=c("black","lightgrey"))

  1. What percent did Mary finish faster than in her group?
    Mary finished faster than 37.8% in her group.
shadeDist(Mary_Z, axes=FALSE,lower.tail = TRUE, col=c("black","darkgray"))

  1. If the distributions of finishing times are not nearly normal, would your answers to parts(b) - (e) change? Explain your reasoning.
    Analyses would need to be reassessed for non-normal distributions; percentiles and other statistics would very likely change.

3.18 Heights of female college students.

  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.
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)

Mean height is 61.52 inches with \(\sigma =\) 4.58 inches. Tests for each standard deviation are below.

Ztest<-mean(hgt)+sd(hgt)
Ztest2<-mean(hgt)+(2*sd(hgt))
Ztest3<-mean(hgt)+(3*sd(hgt))

68 == round(100-(2*pnorm(Ztest,mean(hgt),sd(hgt),lower=FALSE)*100),0)
## [1] TRUE
95 == round(100-(2*pnorm(Ztest2,mean(hgt),sd(hgt),lower=FALSE)*100),0)
## [1] TRUE
99.7 == round(100-(2*pnorm(Ztest3,mean(hgt),sd(hgt),lower=FALSE)*100),1)
## [1] TRUE
  1. Do these data appear to follow a normal distribution? Explain your reasoning using the graphs below.
    The data appear to be skewed right and approximately normally distributed. The QQ plot confirms.
hist(hgt, freq=F, col ="lightblue",xlim=c(min(hgt),max(hgt)),ylim=c(0,.15),breaks=length(unique(hgt)))
curve(dnorm(x, 61.52, 4.58),min(hgt),max(hgt), add=T, col="darkred")

qqnorm(hgt)
qqline(hgt)

With mean 61.52 and median 61 we see that the distribution is approximately normal. qqnormsim below confirms; the simulated normal distributions match our QQ plot in number of deviations from the line.

##qqsimnorm from Lab 3
sim_norm <- rnorm(n = length(hgt), mean = mean(hgt), sd = sd(hgt))
qqnorm(sim_norm)
qqline(sim_norm)

qqnormsim(hgt)

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.

  1. What is the probability that the 10th transistor produced is the first with a defect?
firstdef<-((1-.02)^9)*.02

With independent trials, the probability that the 10th transistor will be defective is 0.016675 or 1.7%.

  1. What is the probability that the machine produces no defective transistors in a batch of 100?
nodef<-(1-.02)^100

With independent trials, the probability that a batch of 100 transistors will be non-defective is 0.1326196 or 13.3%.

  1. On average, how many transistors would you expect to be produced before the first with a defect?
    I would expect \(\frac{1}{.02}\) or 50 transistors to be produced before the first defect appears.
    What is the standard deviation?
    \(\sigma=\sqrt \frac{1-.02}{.02^2}=\) 49.5.

  2. 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?
    I would expect \(\frac{1}{.05}\) or 20 transistors to be produced before the first defect appears.
    What is the standard deviation?
    \(\sigma=\sqrt \frac{1-.05}{.05^2}=\) 19.49.

  3. 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?
    An increase in probability of failure implies a reduction in standard deviation and mean.

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.

  1. Use the binomial model to calculate the probability that two of them will be boys.
p_boy<-.51
n_child<-3
n_boy<-2
p_2boys<-(factorial(n_child)/(factorial(n_boy)*factorial(n_child-n_boy)))*(p_boy^n_boy)*((1-p_boy)^(n_child-n_boy))

The probability that two of the children will be boys is 0.38.

  1. Write out all possible orderings of 3 children, 2 of whom are boys.
child_0<-data.frame(expand.grid(child1 = c("B","G"), child2 = c("B","G"),
            child3 = c("B","G")))
library(tidyverse)
child_0$comb<-paste(child_0$child1,child_0$child2,child_0$child3)
child_0$comb
## [1] "B B B" "G B B" "B G B" "G G B" "B B G" "G B G" "B G G" "G G G"

Use these scenarios to calculate the same probability from part (a) but using the addition rule for disjoint outcomes.

child_0$prob1<-ifelse(child_0$child1 == "B", .51, .49)
child_0$prob2<-ifelse(child_0$child2 == "B", .51, .49)
child_0$prob3<-ifelse(child_0$child3 == "B", .51, .49)

child_0$totprob<-format(child_0$prob1*child_0$prob2*child_0$prob3,scientific=F)


print(child_0[c("comb","totprob")],rownames=NULL)
##    comb  totprob
## 1 B B B 0.132651
## 2 G B B 0.127449
## 3 B G B 0.127449
## 4 G G B 0.122451
## 5 B B G 0.127449
## 6 G B G 0.122451
## 7 B G G 0.122451
## 8 G G G 0.117649

Confirm that your answers from parts (a) and (b) match.

There are four distinct probability values in the table above; two, BBB and GGG, do not satisfy the conditions described. Finding the sum of the other two distinct probabilities yields 0.38 for two boys and a girl and 0.37 for two girls and a boy. The probabilities agree.

  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 described in a would be less tedious due to the fact that it does not require contemplation of the combinations and the sums of their respective probabilities.

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.

  1. What is the probability that on the 10th try she will make her 3rd successful serve?
p<-.15
n<-10
k<-3
p_3rdon10th<-(factorial(n-1)/(factorial(k-1)*factorial(n-k)))*(p^k)*((1-p)^(n-k))

The probability is 0.04.

  1. Suppose she has made two successful serves in nine attempts. What is the probability that her 10th serve will be successful?
    The serves are independent, so the probability is 15%.

  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? Probability for success in each serve is constant, which differs from the probability that a specific combination of successes and failures occurs.