R Studio
and run commands
mean(rnorm(10))
and then
a = 1:10
print(a)
Welcome R - demo.ipynb
and submit commands aboveSimulate proportion of heads in a coin flip. Create a vector with random zeros (tail) and ones (head) with length lengths 10, 100, 1000 and 10000 and for each length calculate proportion of heads. What do you notice with increasing number of coin flips?
Hints: help, runif, mean
rexp
command) and calculate their mean and 20% and 80% quantiles.Hints: rexp, quantile(x, 0.2), for(i in 1:n){...}, rep(0, n)