library("ggplot2")Simulation
coin <- c("heads", "tails")
heads <- rep(0, 1000)
for(i in 1:1000){
trials <- sample(coin, size = 100, replace = TRUE)
heads[i] <- length( which(trials == "heads" ) )
}Plot
x = rep(0, 31)
y = rep(0, 31)
for(i in 35:65){
x[i - 34] = i
y[i - 34] = length( which(heads == i ) )
}
results <- data.frame(n = x, heads = y)
ggplot(data=results, aes(x=n, y=heads)) +
geom_bar(stat="identity", fill="steelblue") +
labs( title="1000 Simulations of 100 Coin Tosses", x= " of Heads", y = "Frequency") +
theme_minimal()The graph isn’t highly skewed and it is near symmetrical. I would say that a normal curve may be fitted to this graph.