What percent of a standard normal distribution N(µ = 0, SD = 1) is found in each region? Be sure to draw a graph.
visualize.norm(stat=-1.35,mu=0,sd=1,section="lower")
The percent of a standard normal distribution is 8.85%.
visualize.norm(stat=1.48,mu=0,sd=1,section="upper")
The percent of a standard normal distribution is 6.94%.
visualize.norm(stat=c(0.4,1.5),mu=0,sd=1,section="bounded")
The percent of a standard normal distribution is 27.8%.
Z >2 and -Z >2 or Z < -2
Finding probability of -2 > Z > 2
visualize.norm(stat=c(-2,2),mu=0,sd=1,section="bounded")
The percent of a standard normal distribution is 95.4%.
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.
#Men Ages 30-40:
men_mean=4313
men_sd=583
#Women Ages 30-34:
women_mean=5261
women_sd=807
Z_score_Leo<-(4948-men_mean)/men_sd
Z_score_Leo
## [1] 1.089194
Z_score_Mary<-(5513-women_mean)/women_sd
Z_score_Mary
## [1] 0.3122677
Z-score is the number of standard deviations from the mean.
Leo’s result is 1.09 standard deviations from the mean while Mary’s results is 0.31 standard deviations from the mean.
Mary ranks better since her result is closer to the median(since mean and median are equal in normal distribution) than Leo’s.
pnorm(Z_score_Leo,lower.tail=FALSE)
## [1] 0.1380342
Leo finished faster than 13.8% of the triathletes.
pnorm(Z_score_Mary,lower.tail=FALSE)
## [1] 0.3774186
Mary finished faster than 37.74% of the triathletes.
Z-scores of not normal distributions are relevant only for analysis in a respective group. We will not be able to compare two people from different groups based on Z-scores of not normal distributions. Also, we will get different results in parts (d) and (e).
Below are heights of 25 female college students.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 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
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)
First, let’s check weather 68.27% lie within one standard deviation.
#mean
mean_heights<-mean(heights)
#standard deviation
sd_heights<-sd(heights)
1-2*pnorm(mean_heights+sd_heights,mean=mean_heights,sd=sd_heights,lower=FALSE)
## [1] 0.6826895
Second, let’s check whether 95.45% lie within two standard deviations.
1-2*pnorm(mean_heights+2*sd_heights,mean=mean_heights,sd=sd_heights,lower=FALSE)
## [1] 0.9544997
Third, let’s check ether 99.73% lie within three standard deviations.
1-2*pnorm(mean_heights+3*sd_heights,mean=mean_heights,sd=sd_heights,lower=FALSE)
## [1] 0.9973002
Based on the resilts above, the heights approximately follow the 68-95-99.7% Rule
hist(heights, probability = TRUE,ylim = c(0, 0.1))
x <- 30:90
y <- dnorm(x = x, mean = mean_heights, sd = sd_heights)
lines(x = x, y = y, col = "blue")
The data is not perfectly symmetric and bell-shaped. Moreover, it’s a little bit right-skewed. The mean should be a little bit greater than the median.
Let’s check.
summary(heights)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 54.00 58.00 61.00 61.52 64.00 73.00
qqnorm(heights)
qqline(heights)
Normal Q-Q Plot shows a slight right-skewed pattern.
In order to answer a question ether data appear to follow a normal distribution or not we have compare normal Q-Q plot of real data with normal Q-Q plot of simulated normally distribute data.
sim_norm <- rnorm(n = length(heights), mean = mean_heights, sd = sd_heights)
qqnorm(sim_norm)
qqline(sim_norm)
I would say that real data and simulated normal data have approximately the same number of points that fall on the line in normal Q-Q plot. Based on that comparison, I would suggest that real data follows normal distribution.
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.
It’s a case of geometric distribution. We’re counting “success”, as finding the defective part. In this case, 9 is the number of failures until we find a defective part.
(1 - 0.02)^9 * 0.02
## [1] 0.01667496
#or
#9 is number of details before defective detail
dgeom(9,0.02)
## [1] 0.01667496
Rate of “success” is 1-0.02. In order to find probability of getting 100 successes we have to multiply success rate by 100 times.
(1-0.02)^100
## [1] 0.1326196
#or
dbinom(0, 100, .02)
## [1] 0.1326196
1/0.02
## [1] 50
What is the standard deviation?
sqrt((1-0.02)/(0.02^2))
## [1] 49.49747
1/0.05
## [1] 20
What is the standard deviation?
sqrt((1-0.05)/(0.05^2))
## [1] 19.49359
As probability increases mean and standard deviation decrease.
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.
#number of cases of getting two boys
num_boys<-2
num_kids<-3
p<-0.51
num_cases<-factorial(num_kids) / (factorial(num_boys)*factorial(num_kids - num_boys))
prob_two_boys <- num_cases*(p^num_boys)*((1-p)^(num_kids-num_boys))
prob_two_boys
## [1] 0.382347
All possible orderings of 3 children: BBB,BBG,BGB,GBB,BGG,GGB,GBG,GGG
There are 8 possible orderings. 3 orderings include 2 boys.
#probability of getting two boys and a girl
0.51*0.51*(1-0.51) # this part is exactly the same as (p^num_boys)*((1-p)^(num_kids-num_boys))
## [1] 0.127449
#multiply probability of getting two boys and a girl by 3 cases
0.51*0.51*(1-0.51)*3 # 3 is exactly the same as factorial(num_kids) / (factorial(num_boys)*factorial(num_kids - num_boys))
## [1] 0.382347
Confirm that your answers from parts (a) and (b) match.
They match.
The approach from part (b) would be more tedious because it will be harder to list and count all cases with 3 boys and 5 girls than cases with 2 boys and a girl.
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 <- 10
k <- 3
#number of cases with 2 successes and 7 failures in 9 first attemps
num_cases <- factorial(n-1)/(factorial(k-1)*(factorial(n-k)))
prob <-num_cases*(p^k)*((1-p)^(n-k))
prob
## [1] 0.03895012
We have to find the probability of getting 2 successes in 9 previous attempts.
p <- 0.15
n <- 10-1
k <- 3-1
#number of cases with 2 successes and 7 failures
num_cases <- factorial(n)/(factorial(k)*(factorial(n-k)))
prob2 <-num_cases*(p^k)*((1-p)^(n-k))
prob2
## [1] 0.2596674
Part (a) calculates the probability that the 10th attempt is a success while two of the former nine attempts are successes. Part (b) calculates the probability that two of the previous nine attempts are successes.
prob in part a = prob in part b*0.15
Let’s check.
prob
## [1] 0.03895012
prob2*0.15
## [1] 0.03895012