1. Home
  2. Explore
  3. Mathematics
  4. Probability Distributions: Bernoulli & Binomial

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Probability Distributions: Bernoulli & Binomial

Bernoulli and Binomial Random Variables

Bernoulli Random Variable

A Bernoulli random variable is the simplest possible random variable. It models a single trial with exactly two outcomes: success or failure.

  • The variable XXX can only take two values: 000 (failure) or 111 (success).

  • The probability of success is denoted by ppp, so P(X=1)=pP(X=1) = pP(X=1)=p.

  • The probability of failure is q=1−pq = 1 - pq=1−p, so P(X=0)=1−p=qP(X=0) = 1 - p = qP(X=0)=1−p=q.

  • The range of XXX is {0,1}\{0, 1\}{0,1}.

Definition: A Bernoulli random variable XXX has P(X=1)=pP(X = 1) = pP(X=1)=p and P(X=0)=1−pP(X = 0) = 1-pP(X=0)=1−p, where 0≤p≤10 \leq p \leq 10≤p≤1. The two outcomes are often called “success” and “failure.”

Common Examples

  • Coin flip: Let success = heads. For a fair coin, p=12p = \frac{1}{2}p=21​.

  • Dice roll: Let success = rolling a six. Then p=16p = \frac{1}{6}p=61​.

  • Manufacturing: Let success = a good part. Then ppp is the probability that a part is good.

  • Binary mask in computing: A matrix of independent Bernoulli random variables can randomly black out pixels in an image.

In every case, the event of interest is defined by the problem, and ppp may be any number between 0 and 1 — it does not have to be 12\frac{1}{2}21​.


Binomial Random Variable

A binomial random variable arises when we perform nnn independent Bernoulli trials and count the total number of successes.

  • Let B1,B2,…,BnB_1, B_2, \dots, B_nB1​,B2​,…,Bn​ be independent Bernoulli random variables, each with the same success probability ppp.

  • Define X=B1+B2+⋯+BnX = B_1 + B_2 + \cdots + B_nX=B1​+B2​+⋯+Bn​.

  • Then XXX is a binomial random variable with parameters nnn (number of trials) and ppp (probability of success on each trial).

Notation: X∼Binomial(n,p)X \sim \text{Binomial}(n, p)X∼Binomial(n,p) means XXX follows a binomial distribution with nnn trials and success probability ppp.

Probability Mass Function

The probability of observing exactly kkk successes in nnn independent Bernoulli trials is:

P(X=k)=(nk)pkq n−k,where q=1−p,k=0,1,…,n.P(X = k) = \binom{n}{k} p^k q^{\,n-k}, \quad \text{where } q = 1-p, \quad k = 0, 1, \dots, n.P(X=k)=(kn​)pkqn−k,where q=1−p,k=0,1,…,n.

Explanation of the formula:

  • (nk)\binom{n}{k}(kn​) counts the number of ways to arrange kkk successes among nnn trials (combinatorial factor).

  • pkp^kpk is the probability that those kkk specific trials are successes.

  • q n−kq^{\,n-k}qn−k is the probability that the remaining n−kn-kn−k trials are failures.

  • Because the trials are independent, the probabilities multiply.

This formula is a direct consequence of the binomial theorem: (p+q)n=∑k=0n(nk)pkqn−k=1(p+q)^n = \sum_{k=0}^n \binom{n}{k} p^k q^{n-k} = 1(p+q)n=∑k=0n​(kn​)pkqn−k=1, which confirms that the probabilities sum to one.


Examples and Verification

Small Case: n=2n = 2n=2

Compute all probabilities for X∼Binomial(2,p)X \sim \text{Binomial}(2, p)X∼Binomial(2,p).

  • k=0k = 0k=0: Only way is both failures. P(X=0)=q⋅q=q2P(X=0) = q \cdot q = q^2P(X=0)=q⋅q=q2.

  • k=1k = 1k=1: Two orders: (success, failure) or (failure, success). P(X=1)=pq+qp=2pqP(X=1) = p q + q p = 2pqP(X=1)=pq+qp=2pq.

  • k=2k = 2k=2: Both successes. P(X=2)=p⋅p=p2P(X=2) = p \cdot p = p^2P(X=2)=p⋅p=p2.

Check that the probabilities sum to one:

q2+2pq+p2=(q+p)2=12=1.q^2 + 2pq + p^2 = (q + p)^2 = 1^2 = 1.q2+2pq+p2=(q+p)2=12=1.

The coefficients 1,2,11, 2, 11,2,1 are the third row of Pascal’s triangle.

Small Case: n=3n = 3n=3 (Recommended Exercise)

For n=3n=3n=3, the probabilities are:

  • P(X=0)=q3P(X=0) = q^3P(X=0)=q3

  • P(X=1)=3pq2P(X=1) = 3 p q^2P(X=1)=3pq2 (three ways: success on first, second, or third trial)

  • P(X=2)=3p2qP(X=2) = 3 p^2 qP(X=2)=3p2q

  • P(X=3)=p3P(X=3) = p^3P(X=3)=p3

The coefficients 1,3,3,11, 3, 3, 11,3,3,1 come from Pascal’s triangle. Verify that these sum to (p+q)3=1(p+q)^3 = 1(p+q)3=1.

Larger Example: 12 Dice Rolls

Let success = rolling a six on a fair die. Then p=16p = \frac{1}{6}p=61​, q=56q = \frac{5}{6}q=65​, and n=12n = 12n=12. Define XXX as the number of sixes in 12 rolls. Then X∼Binomial(12,16)X \sim \text{Binomial}(12, \frac{1}{6})X∼Binomial(12,61​).

The probability of exactly three sixes is:

P(X=3)=(123)(16)3(56)9.P(X=3) = \binom{12}{3} \left(\frac{1}{6}\right)^3 \left(\frac{5}{6}\right)^9.P(X=3)=(312​)(61​)3(65​)9.

This value can be computed with a calculator or software. The formula is far simpler than enumerating all 2122^{12}212 possible sequences.


Limiting Behavior: Approximations for Large nnn

For large nnn, the binomial distribution can be approximated by two other classic distributions, depending on the values of npnpnp and nqnqnq.

Normal Approximation

If npnpnp and nqnqnq are both sufficiently large (say, both ≥5\geq 5≥5), then the binomial distribution is well approximated by a normal distribution with:

  • Mean: μ=np\mu = npμ=np

  • Standard deviation: σ=npq\sigma = \sqrt{npq}σ=npq​

X  ∼approx  N(np,npq)X \;\overset{\text{approx}}{\sim}\; \mathcal{N}(np, \sqrt{npq})X∼approxN(np,npq​)

This is a direct consequence of the Central Limit Theorem. The binomial distribution’s shape becomes symmetric and bell‑shaped as nnn grows.

Poisson Approximation

If npnpnp is small (rare events) or nqnqnq is small (rare failures), the binomial distribution is well approximated by a Poisson distribution with parameter λ=np\lambda = npλ=np (when ppp is small) or λ=nq\lambda = nqλ=nq (when qqq is small, redefining success). More precisely, if nnn is large and ppp is small, then:

X  ∼approx  Poisson(λ=np).X \;\overset{\text{approx}}{\sim}\; \text{Poisson}(\lambda = np).X∼approxPoisson(λ=np).

The Poisson distribution is useful for modeling the number of occurrences of rare events in a large number of independent trials.

These two limiting cases (normal and Poisson) will be studied in detail in subsequent lectures.

Key takeaway: The Bernoulli and binomial distributions form the foundation for many real‑world models, from coin flips and quality control to the normal and Poisson distributions that arise from their large‑sample limits.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent