# number of times the simulation will run.
B <- 1000
set.seed(1)
# Get the highest score from each random distribution of 10,000 people.
highest_val <- replicate(B, {
rd_10000 <- sample(rnorm(10000,15,100), B)
max(rd_10000)
})
hist(highest_val)
I want to use the rnorm to generate a random distribution of 10,000 values with a given average and standard deviation to obtain the max value from a supplied vector by repeating it 1000 times