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\) . The Answer: 12.9%
  2. \(Z > 1.48\) . The Answer: 6.9%
  3. \(-0.4 < Z < 1.5\) . The Answer: 65.5%
  4. \(|Z| > 2\) . The Answer: 97.7%

For (a) \(Z < -1.35\)

x = -1.13

pnorm(x, mean = 0, sd = 1)
## [1] 0.1292381
DATA606::normalPlot(mean = 0, sd = 1, bounds = c(x, 1e+06), tails = TRUE)

For (b) \(Z > 1.48\)

x = 1.48

1 - pnorm(x, mean = 0, sd = 1)
## [1] 0.06943662
DATA606::normalPlot(mean = 0, sd = 1, bounds = c(x, 1e+06), tails = FALSE)

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

x = -0.4
u = 1.5

DATA606::normalPlot(mean = 0, sd = 1, bounds = c(x, u, 1e+06))

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

x = -2
u = 2

DATA606::normalPlot(mean = 0, sd = 1, bounds = c(x, u, 1e+06))


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:

  • The finishing times of the group has a mean of 4313 seconds with a standard deviation of 583 seconds.
  • The finishing times of the 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.

The Answer: For Men between

Leo_race = 4948
men_mean = 4313
men_sd = 583

And Women

Mary_race = 5513
Wo_mean = 5261 
Wo_sd = 807

(b) What are the Z-scores for Leo’s and Mary’s finishing times? What do these Z-scores tell you?

The Answer: for Leo 1.089194 and Mary its 0.3122677. these results tell us Mary score better than Leo since in comparing to her group.

Zscore_leo = (Leo_race - men_mean)/men_sd
Zscore_leo
## [1] 1.089194

And Women

Zscore_Mary = (Mary_race - Wo_mean)/ Wo_sd
Zscore_Mary
## [1] 0.3122677

(c) Did Leo or Mary rank better in their respective groups? Explain your reasoning.

The Answer: Mary score better than Leo since in comparing to her group and her result is is only 0.31 SD from the mean.

(d) What percent of the triathletes did Leo finish faster than in his group?

The Answer: 13.8% Leo finished better than his group.

pnorm(Zscore_leo,lower.tail=FALSE)
## [1] 0.1380342

(e) What percent of the triathletes did Mary finish faster than in her group?

The Answer: 37.8% Mary finished better than her group.

pnorm(Zscore_Mary,lower.tail=FALSE)
## [1] 0.3774186

(f) If the distributions of finishing times are not nearly normal, would your answers to parts (b) - (e) change? Explain your reasoning.

The Answer: There will different results because the Z-score will be normal distribution relevant only in respective groups and its hard to compare different groups of Z-scores for none normal distributions.


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} \]

(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 Answer: The result is different and it does not show it follows 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)
summary(heights)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   54.00   58.00   61.00   61.52   64.00   73.00
mean <- mean(heights)
mean
## [1] 61.52
sd <- sd(heights)
sd
## [1] 4.583667

Using one standard deviation

pnorm(mean+(1*sd),mean=mean,sd=sd)
## [1] 0.8413447

Using two standard deviation

pnorm(mean+(2*sd),mean=mean,sd=sd)
## [1] 0.9772499

Using three standard deviation

pnorm(mean+(3*sd),mean=mean,sd=sd)
## [1] 0.9986501

(b) Do these data appear to follow a normal distribution? Explain your reasoning using the graphs provided below.

The Answer: Yes the histogram is a bell shaped, its follows a normal distribution and the data points on both the chart and the DATA606::qqnormsim charts showes the result are falling on the line.

# Use the DATA606::qqnormsim function
DATA606::qqnormsim(heights)


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.

(a) What is the probability that the 10th transistor produced is the first with a defect?

The Answer: 1.67% is the probability that the 10th transistor produced is the first with a defect

p_faliure <- 0.02
p_sucess <- 0.98

p_sucess^(9) * p_faliure
## [1] 0.01667496

(b) What is the probability that the machine produces no defective transistors in a batch of 100?

The Answer: 13.3% is the probability that the machine produces no defective transistors in a batch of 100

p_sucess^(100)
## [1] 0.1326196
#or
dbinom(0, 100, .02)
## [1] 0.1326196

(c) On average, how many transistors would you expect to be produced before the first with a defect? What is the standard deviation?

The Answer: 50 transistors would you expect to be produced before the first with a defect, and SD is 49.5%.

1/ p_faliure 
## [1] 50
sd <- sqrt((1-0.02)/(0.02^2))
sd
## [1] 49.49747

(d) 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?

The Answer: 20 transistors would you expect to be produced before the first with a defect, and SD is 19.5%.

1/ 0.05 
## [1] 20
sd <- sqrt((1-0.05)/(0.05^2))
sd
## [1] 19.49359

(e) 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?

The Answer: Whenever the probability increases the standard deviation and mean decrease.


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.

The Answer: The probability of having two boys is 38.2%

p <- 0.51
n <- 3
k <- 2

TwoBoys <- choose(n, k) * (1 - p)^(n - k) * p^k

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

The Answer:The result is the same which is 38.2%.

kids <- data_frame(c("BoyGirlBoy", "GirlBoyBoy", "BoyBoyGirl"))
## Warning: `data_frame()` is deprecated as of tibble 1.1.0.
## Please use `tibble()` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
kids$probability <- c(p*(1-p)*p, (1-p)*p*p, p*p*(1-p))

names(kids) <- c("kids", "probability")

sum(kids$probability)
## [1] 0.382347
table (kids)
##             probability
## kids         0.127449
##   BoyBoyGirl        1
##   BoyGirlBoy        1
##   GirlBoyBoy        1

(c) 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 Answer: It will be tedious because there are 56 different possibilities which is very hard.


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.

(a) What is the probability that on the 10th try she will make her 3rd successful serve?

The Answer: The probability of 3rd successful serve on the 10th try is 3.9%

make <- 0.15
miss <- 0.85
k <- 3
n <- 10

choose(n-1, k-1) * (1 - make)^(n - k) * make^k
## [1] 0.03895012

(b) Suppose she has made two successful serves in nine attempts. What is the probability that her 10th serve will be successful?

The Answer: All of the serves are independent so the probability of the 10th serve to be successful is 15%

(c) 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?

The Answer: The serves here are independent and the probability is different because part (a) has no successful tries while part (b) has 2 successful tries in 9 serves.