Calculate mean and variance of binomial (#847)