Answer:
You should only copy and paste in R (R statistical programming language) the next code to reproduce the histogram below.
Step-by-step explanation:
set.seed(1) # We set a seed to reproduce exactly each step in the future
MEAN <- NULL # We create an empty vector
for(j in 1:1000){ # B. We repeat this process 1000 times using the function "for"
# A. We sample 50 observations from {0, 1} and save it in the object x
x <- mean(sample(x = c(0, 1), size = 50, replace = TRUE))
# C. We compute the mean of the 50 observations and then save it in the object m
m <- mean(x)
# We save the mean m in the vector MEAN
MEAN <- c(MEAN, m)
}
# The 1000 sample means are in the vector MEAN.
# D. We plot the 1000 sample means with help of the function "hist"
hist(MEAN)