In this video we are comparing the probability distribution of binomial random variables to simulation in R. We learn how to generate vectors and matrices, use the for loop and bar plot in R.

R commands and functions:

R commands and functions:

- 1:n - generates a vector of n integers
- matrix(nrow=n,ncol=m) - generates empty matrix of n rows and m columns
- for(i in v){do} - repeats do command for i taking all the values from vector v