Question 1

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 percentage is 8.85%
  2. \(Z > 1.48\) The percentage is 6.94%
  3. \(-0.4 < Z < 1.5\) The percentage is 58.9%
  4. \(|Z| > 2\) The percentage is 4.55%
## Loading required package: shiny
## Loading required package: openintro
## Loading required package: airports
## Loading required package: cherryblossom
## Loading required package: usdata
## Loading required package: ggplot2
## Loading required package: markdown
## 
## Welcome to CUNY DATA606 Statistics and Probability for Data Analytics 
## This package is designed to support this course. The text book used 
## is OpenIntro Statistics, 4th Edition. You can read this by typing 
## vignette('os4') or visit www.OpenIntro.org. 
##  
## The getLabs() function will return a list of the labs available. 
##  
## The demo(package='DATA606') will list the demos that are available.
## 
## Attaching package: 'DATA606'
## The following objects are masked from 'package:openintro':
## 
##     calc_streak, present, qqnormsim
## The following object is masked from 'package:utils':
## 
##     demo

## Warning in distribution_plot(fun = dnorm, mean = mean, sd = sd, cv = cv, : cv
## should have one value for tails = "two.sided"

Question 2

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, Ages 30 - 34”: N(mu = 4313, sigma = 583) “Women, Ages 25- 29”: N(mu = 5261, sigma = 807)

  1. What are the Z-scores for Leo’s and Mary’s finishing times? What do these Z-scores tell you?
meanmen <- 4313
sdmen <- 583
Leo <- 4948
z_Leo <- (Leo - meanmen)/sdmen
z_Leo
## [1] 1.089194
meanwomen <- 5261
sdwomen <- 807
Mary <- 5513
z_Mary <- (Mary - meanwomen)/sdwomen
z_Mary
## [1] 0.3122677

Both Leo and Mary finished behind the mean for their age and gender groups. Leo’s time was 1.089 deviations above the mean time for his age and gender group. This means that he was 1.089 deviations slowwer than the mean. Mary’s time was 0.312 deviations above the mean for her age and gender. This means that she was .312 deviations slower than the mean.

  1. Did Leo or Mary rank better in their respective groups? Explain your reasoning.

Mary ranked better in her group because her z-score is lower which means that she was closer to the mean than Leo. (d) What percent of the triathletes did Leo finish faster than in his group?

1 - pnorm(z_Leo)
## [1] 0.1380342

Leo finished faster than 13.8% of the other triathletes.

  1. What percent of the triathletes did Mary finish faster than in her group?
1 - pnorm(z_Mary)
## [1] 0.3774186

Mary finished faster than 37.74% of the other triathletes 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.

If the distributions were not nearly normal, the answers would likely change. Depending on the skewness of the distribution, mean may provide an inaccurate picture of the distribution. Additionally, the z score is based on normal distributions. If the distribution was not normal, the z score would be inaccurate.

Question 3

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.

68 – 1 deviation 95 – 2 deviations 99.7 – 3 deviations

mean_height <- mean(heights)
sd_height <- sd(heights)
length(heights[x>=mean_height - sd_height & x <= mean_height + sd_height])/length(heights)
## [1] 0.68
length(heights[x>=mean_height - (2*sd_height) & x <= mean_height + (2*sd_height)])/length(heights)
## [1] 0.96
length(heights[x>=mean_height - (3*sd_height) & x <= mean_height + (3*sd_height)])/length(heights)
## [1] 1

The distribution is nearly normal and roughly follows the 68-95-99.7 rule.

  1. Do these data appear to follow a normal distribution? Explain your reasoning using the graphs provided below. Based on the two plots, the data looks like it follows a normal distribution. In the first, the curve overlaid on the histogram appears to be closely matched with the data from the histogram. The second plot appears much more obvious that it is normally distributed. the scatterplot follows the fit line very closely.
DATA606::qqnormsim(heights)

Question 4

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? Probability of 9 functioning transistors followed by one with a defect: 1.667%
prob_defect <- .02
q <- 1 - prob_defect
prob_defect*(q^9)
## [1] 0.01667496
  1. What is the probability that the machine produces no defective transistors in a batch of 100?
(q^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 expected value would be the mean, less one (average amount of transistors produced before the first defect).

mean <- 1/prob_defect
sd <- sqrt(q/(prob_defect^2))
mean - 1
## [1] 49
sd
## [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?

Similarly, 19 would be expected before the first defect.

prob_defect <- .05
q <- 1 - prob_defect
mean <- 1/prob_defect
sd <- sqrt(q/(prob_defect^2))
mean - 1
## [1] 19
sd
## [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 of the wait time until success. They have an inverse relationship.

Question 5

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.
dbinom(2, 3, prob = .51)
## [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.

B,B,G/B,G,B/G,B,B – Assuming each boy is not unique and gender is all that matters.

b <- .51
g <- 1-b

b*b*g + b*g*b + g*b*b
## [1] 0.382347

A and B do in fact match.

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

Part B would have 56 combinations entered manually while part a would just be one line.

choose(8,3)
## [1] 56
dbinom(3,8,prob = .51)
## [1] 0.2098355

Question 6

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? Negative binomial distribution: 7 failures before 3 successes
dnbinom(7, 3, prob = .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?

The probability of an individual serve is independent of previous trials. This means that the probability of success on the tenth serve is 0.15. The outcomes of the first nine serves are known, so they have no impact on the tenth.

  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?

In case (a) the outcome of the first nine serves is not known. There are many different possibilities that could lead to the tenth serve. In case (b), there is only one path that was taken to get to the ninth serve. Because the outcome is known, it has no impact on the tenth serve.