Tech Tips: Binomial Distributions

Calculating $P(X=x)$ when $X$ follows a Binomial Distribution

Suppose one wishes to find the binomial probability of seeing exactly $k$ successes in $n$ independent trials, where the probability of success on any one trial is $p$ and the probability of failure is $q = 1-p$. That is to say, we seek $$P(k) = ({}_n C_k) p^k q^{n-k}$$ To do this, one should ...


Calculating Cumulative Probabilities when $X$ follows a Binomial Distribution

Suppose one wishes to fine the cumulative binomial probability of seeing $k$ or fewer successes in $n$ independent trials, where the probability of success on any one trial is $p$ and the probability of failure is $q = 1-p$. That is to say, we seek $$P(X \le k) = P(0) + P(1) + P(2) + \cdots + P(k) = \sum_{0 \le i \le k} ({}_n C_i) p^i q^{n-i}$$ To do this, one should ...


Simulating Random Variables following Binomial Distributions

To generate $m$ realizations of a random variable that follows a binomial distribution, counting the number of successes seen in $n$ independent trials, where the probability of success on any one trial is $p$, ...