Answer:
Part A) To find P(≤9) for a normal distribution with a mean of 10 and a standard deviation of 4, you can use the `pnorm()` function in R. Here's how you can calculate it and save it as `p2.CDF`:
```R
mean <- 10
sd <- 4
x <- 9
p2.CDF <- pnorm(x, mean, sd)
p2.CDF <- round(p2.CDF, 2)
```
Part B) To find the value such that P(≤) = 0.75 for the same normal distribution, you can use the `qnorm()` function. Here's how you can calculate it and save it as `p2.invCDF`:
```R
p_value <- 0.75
p2.invCDF <- qnorm(p_value, mean, sd)
p2.invCDF <- round(p2.invCDF, 2)
```
Part D) To find P(¯≥14.5) for 1,...,8∼iid(14,4), you can use the `pnorm()` function. First, calculate the mean and standard deviation of the sample mean:
```R
sample_mean <- 14
sample_sd <- 4 / sqrt(8) # Standard error of the mean
```
Now, calculate P(¯≥14.5):
```R
x_bar <- 14.5
p2.d <- 1 - pnorm(x_bar, sample_mean, sample_sd)
p2.d <- round(p2.d, 2)
```
Part E) To generate 500 samples from a standard normal distribution and plot a histogram with the PDF overlaid, you can use the `rnorm()`, `hist()`, and `dnorm()` functions. Here's how you can do it:
```R
# Generate 500 samples from a standard normal distribution
samples <- rnorm(500)
# Create a histogram with density plot
hist(samples, prob = TRUE, main = "Histogram of Standard Normal Distribution")
curve(dnorm(x, mean = 0, sd = 1), add = TRUE, col = "blue")
```
This code will generate a histogram of the 500 samples with the standard normal PDF overlaid in blue.
Explanation: