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.
area under the curve 8.9%
pnorm(-1.35)
## [1] 0.08850799
normal_plot(mean = 0, sd = 1, cv = c(-1.35), tails = "less" )
area under the curve 6.9%
1 - pnorm(1.48)
## [1] 0.06943662
normal_plot(mean = 0, sd = 1, cv = c(1.48), tails = "greater" )
area under the curve 58.9%
pnorm(1.5) - pnorm(-0.4)
## [1] 0.5886145
normal_plot(mean = 0, sd = 1, cv = c(-0.4,1.5), tails = "no" )
area under the curve 4.6%
pnorm(-2) + 1 - pnorm(2)
## [1] 0.04550026
normal_plot(mean = 0, sd = 1, cv = c(-2,2), tails = "two.sided" )
## Warning in distribution_plot(fun = dnorm, mean = mean, sd = sd, cv = cv, : cv
## should have one value for tails = "two.sided"
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.
Men - N(\(\mu\) = 4313 \(\sigma\) = 538) Women - N(\(\mu\) = 5261 \(\sigma\) = 807)
## [1] 1.089194
## [1] 0.3122677
Leo z score = 1.089 Mary z score = 0.312
## [1] 0.8619658
## [1] 0.6225814
Mary did better with respect to her group. For Mary only 62.3% of the competitors had a better time compared to 86.2% for Leo.
## [1] 0.1380342
13.8% of the competitors in Leo’s age group had a better time.
## [1] 0.3774186
37.7% of the competitors had a better time than Mary
yes - i could see the situation of elite athletes posted really fast times skewing the distribution left. Then it would be difficult to predict the percentages of observations using a normal distribution
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} \]
yes - the height approximates the distribution rules for a normal distribution
height_df <- data.frame( height = 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 <- mean(height_df$height)
std <- sd(height_df$height)
n <- length(height_df$height)
# calc number of observations 1 standard deviation from the mean
hb <- 1 * std + mean
lb <- -1 * std + mean
height_df %>%
filter(height > lb, height < hb) %>%
summarise(
count = n(),
percent = count / n
)
# calc number of observations 2 standard deviation from the mean
hb <- 2 * std + mean
lb <- -2 * std + mean
height_df %>%
filter(height > lb, height < hb) %>%
summarise(
count = n(),
percent = count / n
)
# calc number of observations 3 standard deviation from the mean
hb <- 3 * std + mean
lb <- -3 * std + mean
height_df %>%
filter(height > lb, height < hb) %>%
summarise(
count = n(),
percent = count / n
)
no - based on the graph it appears that the data is right skewed
ggplot(data = height_df , aes(x = height)) +
geom_histogram(bins = 20)
# Use the DATA606::qqnormsim function
qqnormsim(dat = height_df$height)
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.
prob <- 0.02
n <- 10
prob * (1-prob)^(n-1)
## [1] 0.01667496
1.7%
prob <- 0.02
n <- 100
(1 - prob)^n
## [1] 0.1326196
13.3%
p <- 0.02
k <- 1
k/p
## [1] 50
(((1-p)/p^2))^.5
## [1] 49.49747
average transistors before defect 50 standard deviation 49.5
p <- 0.05
k <- 1
k/p
## [1] 20
(((1-p)/p^2))^.5
## [1] 19.49359
average transistors before defect 20 standard deviation 19.5
as expected the increased probability reduces the number of transistores produced before you would expect a defect. It also reduces the variability of the process.
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.
p <- 0.51
n <- 3
k <- 2
factorial(n) / factorial(k) / factorial(n-k) *p^k * (1-p)^(n-k)
## [1] 0.382347
38.2%
yes the answers from a and b are equal
b <- .51
g <- 1 - b
b*b*g + b*g*b + g*b*b
## [1] 0.382347
p <- 0.51
n <- 8
k <- 3
factorial(n) / factorial(k) / factorial(n-k)
## [1] 56
to use the approach in b we would need to identify all the different permutations of 3 out of 8 kids being boys. the calculation of all 56 permutations that would be required
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.
p <- 0.15
n <- 9
k <- 2
factorial(n) / factorial(k) / factorial(n-k) *p^k * (1-p)^(n-k) * p
## [1] 0.03895012
3.9%
15%
in part b we are assuming that the she has already successfully served 2 balls into the court and we are only concerned with the probably of a successful 10th serve. Since the serves are independent we can ignore the events that happended before the 10th attempt