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.
library(DATA606)
## Loading required package: shiny
## Loading required package: openintro
## Please visit openintro.org for free statistics materials
##
## Attaching package: 'openintro'
## The following objects are masked from 'package:datasets':
##
## cars, trees
## Loading required package: OIdata
## Loading required package: RCurl
## Loading required package: bitops
## Loading required package: maps
## Loading required package: ggplot2
##
## Attaching package: 'ggplot2'
## The following object is masked from 'package:openintro':
##
## diamonds
## 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, 3rd Edition. You can read this by typing
## vignette('os3') 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 object is masked from 'package:utils':
##
## demo
library(ggplot2)
normalPlot(bounds = c(-Inf,-1.35))
pnorm(-1.35)
## [1] 0.08850799
8.86 % of area
normalPlot(bounds = c(1.48,Inf))
1-pnorm(1.48)
## [1] 0.06943662
6.95 % of area
normalPlot(bounds = c(-0.4,1.5))
pnorm(1.5)-pnorm(-0.4)
## [1] 0.5886145
58.9 % of area (d) \(|Z| > 2\)
normalPlot(bounds = c(-2,2), tails = TRUE)
pnorm(-2)*2
## [1] 0.04550026
4.55 % of aea
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, Ages 30 - 34: N(μ=4313,σ=583) Women, Ages 25 - 29: N(μ=5261,σ=807)
mean_m <- 4313
sd_m <-583
mean_w <- 5261
sd_w <-807
z_leo <-(4948-mean_m)/sd_m
z_leo
## [1] 1.089194
z_mary<-(5513-mean_w)/sd_w
z_mary
## [1] 0.3122677
JR Answer: Leo’s Z score is 1.089194 Mary’s Z score is 0.3122677 Leo is 1.089 SD longer then average Mary is 0.312 SD longer then average
MRank <-pnorm(z_mary)
MRank
## [1] 0.6225814
LRank <- pnorm(z_leo)
LRank
## [1] 0.8619658
0.8619658
0.6225814
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} \]
fheight <- 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(fheight)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 54.00 58.00 61.00 61.52 64.00 73.00
mean_fheight <- 61.52
sd_fheight <- 4.58
#68 view
normalPlot(mean = 61.52, sd = 4.58, bounds = c((mean_fheight-sd_fheight), (mean_fheight+sd_fheight)), tails = FALSE)
#95 view
normalPlot(mean = 61.52, sd = 4.58, bounds = c((mean_fheight-2*sd_fheight), (mean_fheight+ 2*sd_fheight)), tails = FALSE)
# 99.7 view
normalPlot(mean = 61.52, sd = 4.58, bounds = c((mean_fheight-3*sd_fheight), (mean_fheight+3*sd_fheight)), tails = FALSE)
JR Answer: They do follow the heights approximately according to the 68-95-99.7 rule
Answer: It does follow a normal distribution but for the skewness in the tails - especially the rigth skew as clearly seen in the qq plot (right side)
# Use the DATA606::qqnormsim function
qqnormsim(fheight)
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.
defct<- 0.98*0.98*0.98*0.98*0.98*0.98*0.98*0.98*0.98*0.02
defct
## [1] 0.01667496
JR Answer; 0.01667496 chance of a defect in first 10.
nodefct <- .98^100
nodefct
## [1] 0.1326196
JR Answer: 0.1326196 probabiity of no defectin 100
mean <- 1/.02
mean
## [1] 50
sd <- sqrt((1-.02)/(0.02)^2)
sd
## [1] 49.49747
JR Answer: Expect to get a defect after 50 produced transistors. The SD is 49.49747
mean2 <- 1/.05
mean2
## [1] 20
sd <- sqrt((1-.05)/(0.05)^2)
sd
## [1] 19.49359
JR Answer: This second machine should produce a defect at 20 transistors.
JR Answer: The increase in the probability of defect caused a decrese in mean and SD.
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.
prob2boys <- dbinom(2,3,0.51)
prob2boys
## [1] 0.382347
JR Answer: 0.382347 is the prob of having 2 boys
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.
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).
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.