Chapter 3 Distributions Of Random Variables

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

a) Z> -1.13

print ("12.92 is percentile for Z = -0.5  ")
## [1] "12.92 is percentile for Z = -0.5  "
paste( "Result is 69.15-30.85 ",100-12.92,"%")
## [1] "Result is 69.15-30.85  87.08 %"
normalPlot(bounds=(c(-1.13,Inf)))

b)Z < 0.18

print(" 0.18 will be in 57.14% ")
## [1] " 0.18 will be in 57.14% "
normalPlot(bounds=(c(-Inf,0.18)))

c)Z > 8

normalPlot(bounds=(c(8,Inf)))

d) |Z| < 0.5

print("-0.5 < Z < 0.5 ")
## [1] "-0.5 < Z < 0.5 "
print ("30.85 percentile for Z = -0.5  ")
## [1] "30.85 percentile for Z = -0.5  "
print ("69.15 percentile for Z = 0.5 ")
## [1] "69.15 percentile for Z = 0.5 "
paste( "Result is 69.15-30.85 ",  69.15-30.85 , "%")
## [1] "Result is 69.15-30.85  38.3 %"
normalPlot(bounds=(c(-0.5,0.5)))

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: The finishing times of the Men, Ages 30 - 34 group has a mean of 4313 seconds with a standard deviation of 583 seconds. The fiishing 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.

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

men N(\(\mu\) = 4313, \(\sigma\) = 583)

women N(\(\mu\)= 5261, \(\sigma\) = 807)

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

Leo

Z_Leo <- (4948-4313)/583
Z_Leo
## [1] 1.089194

Mary

Z_Mary <- (5513-5261)/807
Z_Mary
## [1] 0.3122677

According to Leo’s Z score his time was 1.09 standard deviations above the mean. Mary’s Z score suggest that her time was 0.31 standard deviations above the mean.

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

Mary Ranked higher in her group her z score was 0.31 while Leo’s Z score was 1.09 . In this case I believe that mary ranked higher because a lower z score means she was among the few people who finished faster.

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

Leo finished faster than 86.21% of his group.

pnorm(1.09)
## [1] 0.8621434

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

Mary finished faster than 62.17% of her group.

pnorm(0.31)
## [1] 0.6217195

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

The Z scores would stay the same. However the percentiles would change if the distribution was not normal. So the answers to parts d and e would be different if the distributions of finishing times were not nearly normal.

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

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

summary(female_height)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   54.00   58.00   61.00   61.52   64.00   73.00
hist(female_height,xlab = "Height of Female College Student in cm", main = "Histogram For Female Height")

qqnormsim(female_height)

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.

pnorm(61.52+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

Based on the information it does not seem as thought the heights follow the 68-95-99.7% rule

Answer

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

hist(female_height, probability = TRUE)
x <- 50:75
y <- dnorm(x = x, mean = 61.52, sd = 4.58)
lines(x = x, y = y, col = "blue")

qqnorm(female_height)
qqline(female_height)

sim_norm <- rnorm(n = length(female_height), mean = 61.52, sd = 4.58)

Answer

I don’t think it follows a normal distribution. The data points are close to the line in the qq plot but there is also outliers on the top end and the bottom end that are pretty far away from the line. I think it is close to a normal distribution but not quite normal distribution.

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?

Using the pgeom function we get the follwoing results

pgeom(10-1,0.02)
## [1] 0.1829272

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

Using the pgeom function we get the follwoing results

1-pgeom(100,0.02)
## [1] 0.1299672

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

Mean

\(\mu\)=1/p so the answer is 1/0.02

trials before the first success

\(\mu\)= 50

Standard Deviation

\(\sigma\)=sqrt((1-p)/p^2)

\(\sigma\)= 49.4974747

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?

Mean

\(\mu\)=1/p so the answer is 1/0.05

trials before the first success

\(\mu\)= 20

Standard Deviation

\(\sigma\)=sqrt((1-p)/p^2)

\(\sigma\)= 19.4935887

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

Based on the answer to c and d if we increase the probability the value of the mean and the standard deviation will decrease. So, in the case when the probability was lower the mean was 50 but when probability increased the mean decreased. Similarly for the standard deviation first when probability was lower it was 49.497 but when probability increased the value for Standard deviation became 19.493.

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

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

P(having a boy)=0.51 , n=3 and k=2 we will use dbinom function and plug in the values

dbinom(2,3,0.51)
## [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.Confirm that your answers from parts (a) and (b) match.

BBG BGB GBB

#
probability = (0.51^2)*0.49*3
probability
## [1] 0.382347

The values I got for a and b are the same.

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

I think that the apporach from Part b where you have to use the addition rule for disjoint it will be more tedious because of the number of scenerios and it will just be hard to draw all the combinations.

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?

#WE will use the choose function to calculate this 
paste ("P(making 3rd successful serve on 10th try)=",choose(9,2)*0.15^3*0.85^7)
## [1] "P(making 3rd successful serve on 10th try)= 0.0389501162261719"

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

The answer is 0.15 since each serve is independant so the probability of the 10th attempt will be same as the previous 9.

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

It seems as though parts a and b are quite similar in terms of having success in the 10th serve. However, if we read the question carefully we can understand that they are quite different in part a the question is referring to the number of successes however in part b the question is asking about what is the probability that she makes a successful serve on 10th try. Since, all events are indepenedant a succesfull server on 10th try would be same as any other try.