library('utils')
library("RcppParallel")
library("Rcpp")
library("StMoSim")
library("fastGraph")

3.2 Area under the curve, Part II. What percent of a standard normal distribution N(?? =0, ! = 1) is found in each region? Be sure to draw a graph.

mean<- 0 
SD <- 1
x <- seq(-4, 4, length = 1000)
y <- dnorm(x, mean, SD)

a) Z>-1.13

shadeDist(-1.13,lower.tail = FALSE,col = c("black", "blue"))

b) Z < 0.18

shadeDist(0.18, col = c("yellow", "grey"))

C) z>8

shadeDist(8, col = c("green", "grey"),lower.tail = FALSE)

d) |z| < 0.5

shadeDist( c( 0, 0.5 ), , 0, 1, col = c("black", "red"),lower.tail = FALSE )

3.4 Triathlon times, Part I. 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.

a. Write down the short-hand for these two normal distributions.

N(mean,sd); men- N(4313,583) ; women- N(5261,807)

b. What are the Z-scores for Leo’s and Mary’s finishing times? What do these Z-scores tell you?

leo_z<-(4948-4313)/583
leo_z
## [1] 1.089194
mary_z<-(5513-5261)/807
mary_z
## [1] 0.3122677

The score indicates that Mary did much better within her group than Leo with standard deviation of .31 verses 1.09 for Leo

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

Mary rank much better than Leo it has with Low positive standard deviation

d. What percent of the triathletes did Leo finish faster than in his group?

pnorm(leo_z,lower.tail=FALSE)
## [1] 0.1380342

e. What percent of the triathletes did Mary finish faster than in her group?

pnorm(mary_z,lower.tail=FALSE)
## [1] 0.3774186

f. If the distributions of finishing times are not nearly normal, would your answers to parts.(b) - (e) change? Explain your reasoning.

If the curve changed and skewed the answer would change. The distribution would be shifted from the center and the z-score would be effected. Thus, the z-score evaluation might not me be the best for this evaluation since it depends on the mean, where the median would have better result in this case.

3.18 Heights of female college students. Below are heights of 25 female college students.

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

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.

summary(hgt)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   54.00   58.00   61.00   61.52   64.00   73.00
qqnormSim(hgt, nSim=500)

pnorm(61.52+1*4.58,mean=61.52,sd=4.58)
## [1] 0.8413447
pnorm(61.52+2*4.58,mean=61.52,sd=4.58)
## [1] 0.9772499
pnorm(61.52+3*4.58,mean=61.52,sd=4.58)
## [1] 0.9986501

The information above didn’t show that the distribution follows the 68-95-99.7 rules and the distribution seems to be a little bit skewed to the right.

b) Do these data appear to follow a normal distribution? Explain your reasoning using the graphs provided below.

it appear it following normal distribution. The point of the q-q plot fall within the boundries.

3.22 Defective rate. 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.

a. What is the probability that the 10th transistor produced is the first with a defect?

0.98^(10-1)*0.2
## [1] 0.1667496

b. What is the probability that the machine produces no defective transistors in a batch of 100?

0.98^(100)
## [1] 0.1326196

C. On average, how many transistors would you expect to be produced before the first with a defect? What is the standard deviation?

1/.02
## [1] 50

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

1/0.05
## [1] 20

e. Based on your answers to parts (c) and (d), how does increasing the probability of an event aff???ect the mean and standard deviation of the wait time until success?

Increasing the probability of an event will decrease the mean and standard deviation.

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

a) Use the binomial model to calculate the probability that two of them will be boys.

p <- 0.51
k <- 2
n <- 3

fN <- factorial(n)
fK <- factorial(k)
fn_k <- factorial(n-k)

p2_of_3 <- ( fN / (fK * fn_k)) * p^k * (1-p)^(n-k)
p2_of_3
## [1] 0.382347

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

posiible outcomes;

  • boy,boy,girl
  • girl,boy,boy
  • boy,girl,boy
((1-p) * p * p) * 3
## [1] 0.382347

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

Because if requires manual input of the possible combination

3.42 Serving in volleyball. 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.

a. What is the probability that on the 10th try she will make her 3rd successful serve?

choose(9,2)*0.15^3*0.85^7
## [1] 0.03895012

b. Suppose she has made two successful serves in nine attempts. What is the probability that her 10th serve will be successful?

The probability is 15%

  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?

For a, we are determining the probability of success for number of trials; while for b, we are determining the probability of a single event based on previous trials. Thus we have this discrepancy.