Standard normal distribution \(N(\mu = 0, \sigma = 1)\).
\(P(Z > -1.13) = \text{87.1%}\)
1 - pnorm(-1.13)
## [1] 0.8707619
normalPlot(bounds = c(-1.13, Inf))
\(P(Z < 0.18) = \text{57.1%}\)
pnorm(0.18)
## [1] 0.5714237
normalPlot(bounds = c(-Inf, 0.18))
\(P(Z > 8) = 6.66 \cdot 10^{-16}\)
1 - pnorm(8)
## [1] 6.661338e-16
normalPlot(bounds = c(8, Inf))
\(P(|Z| < 0.5) = \text{38.3%}\)
pnorm(0.5) - pnorm(-0.5)
## [1] 0.3829249
normalPlot(bounds = c(-0.5, 0.5))
Let’s use the following notation for the two groups:
M30 = Men, Ages 30-34 = group 1
W25 = Women, Ages 25-29 = group 2
M30: \(N(\mu = 4313, \sigma = 583)\)
W25: \(N(\mu = 5261, \sigma = 807)\)
Leo: \(Z_1 = (4948 - 4313) / 583 = 1.089\)
Mary: \(Z_2 = (5513 - 5261) / 807 = 0.312\)
Leo finished 1.09 standard deviations above (slower than) the mean of the M30 group, while Mary finished 0.31 standard deviations above (slower than) the mean of the W25 group.
m1 <- 4313
s1 <- 583
m2 <- 5261
s2 <- 807
t1 <- 4948
t2 <- 5513
(z1 <- (t1 - m1) / s1)
## [1] 1.089194
(z2 <- (t2 - m2) / s2)
## [1] 0.3122677Mary ranked better in her group, since she was only 0.31 standard deviations slower than the W25 mean finishing time, whereas Leo was 1.09 standard deviations slower than the M30 mean finishing time of his group.
Leo finished faster than 13.8% of the M30 group:
\(P(Z > 1.089) = 1 - P(Z < 1.089) = 1 - 0.862 = 0.138\)
pnorm(z1)
## [1] 0.8619658
1 - pnorm(z1)
## [1] 0.1380342Mary finished faster than 37.7% of the W25 group:
\(P(Z > 0.312) = 1 - P(Z < 0.312) = 1 - 0.623 = 0.377\)
pnorm(z2)
## [1] 0.6225814
1 - pnorm(z2)
## [1] 0.3774186If the distributions of finishing times for M30 and W25 are not nearly normal, but the mean and standard deviations are the same as above, then:
Answer to part (b) would not change, since the Z-scores are just computed from the means and standard deviations of the distributions, which are assumed not to change.
Answer to part (c) would not change, since the Z-scores still indicate the “normalized” distance from the means of the distributions, even if the distributions are not normal.
Answers to parts (d) and (e) would change, since they depend on the shape of the respective distributions for M30 and W25.
Sample with \(n=25\), \(m = 61.52\) and \(s = 4.58\).
ht <- 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)
( n <- length(ht) )
## [1] 25
( m <- mean(ht) )
## [1] 61.52
( s <- sd(ht) )
## [1] 4.583667
Yes, the heights approximately follow the 68-95-99.7% rule:
Proportion within +/- 1sd: 68%
Proportion within +/- 2sd: 96%
Proportion within +/- 3sd: 100%
( prop1 <- sum( (ht >= m - s) & (ht <= m + s) ) / n )
## [1] 0.68
( prop2 <- sum( (ht >= m - 2 * s) & (ht <= m + 2 * s) ) / n )
## [1] 0.96
( prop3 <- sum( (ht >= m - 3 * s) & (ht <= m + 3 * s) ) / n )
## [1] 1Yes, since the histogram of heights is unimodal and approximately symmetric, and it approximately follows the shape of the superimposed normal distribution. Furthermore, the normal probability plot is approximately a straight line, other than a couple of outliers at the extreme ends of the left and right tails. Given \(n\), \(m\), and \(s\), the normal probability plot for the actual data appear similar to those for simulated samples of \(n=25\) drawn from the a normal distribution with mean \(m\) and standard deviation \(s\).
qqnorm(ht)
qqline(ht)
qqnormsim(ht)
Geometric distribution with \(P(\text{defect}) = p = 0.02\).
Probability of wait time till first defect (success) = 10th trial:
\((1-p)^9 \cdot p = \text{1.67%}\)
p <- 0.02
(1-p)^9 * p
## [1] 0.01667496Probability of wait time till first defect > 100th trial:
\((1-p)^{100} = \text{13.26%}\)
(1-p)^100
## [1] 0.1326196Mean wait time till first defect and standard deviation:
\(\mu = 1 / p = 50\) trials
\(\sigma = \sqrt{\frac{1-p}{p^2}} = 49.5\) trials
1 / p
## [1] 50
sqrt( (1-p) / p^2)
## [1] 49.49747Now that \(p = 0.05\), the mean wait time till first defect and standard deviation become:
\(\mu = 1 / p = 20\) trials
\(\sigma = \sqrt{\frac{1-p}{p^2}} = 19.5\) trials
p <- 0.05
1 / p
## [1] 20
sqrt( (1-p) / p^2 )
## [1] 19.49359Increasing the probability of an event (2% \(\rightarrow\) 5%) means that the event occurs more frequently, which has two effects:
the mean wait time decreases
the variability in wait time decreases, i.e., the standard deviation decreases.
This can be seen in the graph below showing the geometric distribution of wait times for \(p = \text{2%}\) and \(p = \text{5%}\).
library(ggplot2)
p1 <- 0.02
p2 <- 0.05
x <- 0:100
y1 <- dgeom(x, p1)
y2 <- dgeom(x, p2)
df1 <- data.frame(n = x, p = y1, group = "2%")
df2 <- data.frame(n = x, p = y2, group = "5%")
df <- rbind(df1, df2)
ggplot(df) + geom_bar(aes(x=n+1, y=p, fill = group), stat = "identity", position = "dodge") +
labs(x="Number of Trials", y="Probability", title="Geometric distribution of wait time till 1st success") +
geom_vline(aes(xintercept = 50), col = "red") + geom_vline(aes(xintercept = 20), col = "blue")
Binomial distribution with \(p = 0.51\) and \(n = 3\).
Probability of \(k=2\) boys:
\(P(k=2) = \frac{3!}{2! 1!} p^2 (1-p) = 3 \cdot 0.51^2 \cdot 0.49 = \text{38.2%}\)
p <- 0.51
3 * p^2 * (1-p)
## [1] 0.382347Possible scenarios for \(k=2\) boys out of \(n=3\) children:
| Scenario | 1st Child | 2nd Child | 3rd Child |
|---|---|---|---|
| 1 | G | B | B |
| 2 | B | G | B |
| 3 | B | B | G |
There are 3 scenarios for 2 boys and 1 girl out of 3 children. Each scenario is equally likely and has the same probability:
\(P(\text{scenario}) = p^2 (1-p) = \text{12.7%}\)
p^2 * (1-p)
## [1] 0.127449
Since the 3 scenarios are disjoint, the probability of 2 boys and 1 girl is the sum of the three scenario probabilities:
\(P(\text{2 boys, 1 girl}) = P(\text{scenario 1}) + P(\text{scenario 2}) + P(\text{scenario 3}) = 3 * p^2 (1-p) = \text{38.2%}\)
3 * p^2 * (1-p)
## [1] 0.382347If we change the problem to \(n = 8\) children and \(k = 3\) boys, then the approach from part (b) would require laying out \(\frac{8!}{3! 5!} = 56\) scenarios. On the other hand, we know that the scenarios are each disjoint and have the same probability of occurring, so we can use the approach from part (a):
\(P(k=3, n=8) = \frac{8!}{3! 5!} p^3 (1-p)^5 = 56 \cdot 0.51^3 \cdot 0.49^5 = \text{21.0%}\)
56 * p^3 * (1-p)^5
## [1] 0.2098355Negative binomial distribution with \(P(\text{successful serve}) = p = 0.15\)
Probability of \(k=3^{rd}\) successful serve on \(n=10^{th}\) attempt:
\(P(k=3, n=10) = \frac{9!}{2! 7!} p^3 (1-p)^7 = 36 \cdot 0.15^3 \cdot 0.85^7 = \text{3.9%}\)
p <- 0.15
36 * p^3 * (1-p)^7
## [1] 0.03895012Each serve is assumed to be an independent and identically distributed Bernoulli random variable, so \(P(\text{10th serve is successful} | \text{2 successful serves in first 9 attempts}) = P(\text{successful serve}) = p = 0.15\)
Part (a) refers to the unconditional probability of reaching the 3rd successful serve on the 10th attempt, which includes all possible scenarios, i.e., all scenarios of reaching 2 succesful serves in 9 attempts followed by a successful serve on the 10th attempt. On the other hand, part (b) refers to the conditional probability of a successulf serve on the 10th attempt given that 2 serves were successful in the first 9 attempts:
\(P(\text{10th serve is successful} | \text{2 successful serves in first 9 attempts}) = P(\text{successful serve}) = p\)
The two probabilities are related since:
\[P(\text{3rd success on 10th serve}) = P(\text{success on 10th serve} | \text{2 successes on first 9 serves}) \cdot P(\text{2 successes on first 9 serves})\] \[ = P(\text{successful serve}) \cdot P(\text{2 successes on first 9 serves}) = p \cdot \frac{9!}{2! 7!} p^2 (1-p)^7 = \frac{9!}{2! 7!} p^3 (1-p)^7\]