Question: # Estimate the probability using Monte Carlo simulation set.seed ( 1 2 3 ) # For reproducibility monte _ carlo _ prob < - sum

# Estimate the probability using Monte Carlo simulation
set.seed(123) # For reproducibility
monte_carlo_prob <- sum(abs(rnorm(10000))<1)/10000
# Print the estimated probability
print(monte_carlo_prob)
# Calculate the exact probability using pnorm
exact_prob <- pnorm(1)- pnorm(-1)
# Print the exact probability for comparison
print(exact_prob)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!