R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

##Question 1
# Part (a)
mean_X <- 170
sd_X <- 30
X_threshold <- 230

z_score <- (X_threshold - mean_X) / sd_X
prob_exceed_230 <- 1 - pnorm(z_score)

# Part (b)
n <- 300
p <- prob_exceed_230
boys_exceed_8 <- 1 - pbinom(7, size = n, prob = p)

# Print results
cat("Probability (X > 230):", prob_exceed_230, "\n")
## Probability (X > 230): 0.02275013
cat("Probability (at least 8 boys exceed 230):", boys_exceed_8, "\n")
## Probability (at least 8 boys exceed 230): 0.374928
##Question 2
# Given data
mean_X <- 50
sd_X <- 5
X_lower <- 42
X_upper <- 52

# Calculate z-scores
z1 <- (X_lower - mean_X) / sd_X
z2 <- (X_upper - mean_X) / sd_X

# Calculate probabilities
prob_between_42_52 <- pnorm(z2) - pnorm(z1)

# Print result
cat("Probability (42 < X < 52):", prob_between_42_52, "\n")
## Probability (42 < X < 52): 0.6006224