binomial distribution in r given mean and variance code example Example: variance of binomial distribution Var(X)=np(1-p)