← Back to list

🎲Bernoulli vs Binomial: One Trial or Many? -> Part 2

In Part 1, we spent time moving between two worlds — the data world and the probability world. We looked at what data tells us, how we…

Anurupa Karmakar · 2026-01-07 03:25 · 51 claps · 5.9 min read
#binomial-distribution #bernoulli-distribution #probability #statistics #mathematics
Open on Medium ↗
Wiki topics: 📐 · Mathematics ⚖️ · Law & Justice

🎲Bernoulli vs Binomial: One Trial or Many? -> Part 2

Pic Credit: Gemini nano banana

Pic Credit: Gemini nano banana

In Part 1, we spent time moving between two worlds — the data world and the probability world. We looked at what data tells us, how we summarize it, and how familiar ideas like mean and variance reappear when we talk in terms of random variables and expectations.

With that foundation in place, it becomes much smoother to understand Bernoulli and Binomial distributions.

To begin with, both of them are discrete probability distributions.

Sounds hard already, right? Let’s slow down and unpack what that phrase actually means.

Discrete refers to random variables that can take only a finite or fixed set of outcomes. For example, when we throw a die, the outcomes are fixed:

— — — — — — — — — — — — — [1, 2, 3, 4, 5, 6] — — — — — — — — — — — — —

There are no in-between values — you either get a 3 or you don’t, or you either get a 6 or you don’t. You can’t get 3 and 6 both at the same time.

Probability tells us how much each outcome contributes — in other words, how likely each outcome is.

And finally, distribution describes the shape formed by these outcomes along with their probabilities. It’s the overall picture of how probability is spread across all possible values.

Figure 1: Untangling a discrete probability distribution.

Figure 1: Untangling a discrete probability distribution.

A Few Terms We Need First

Before jumping into Bernoulli and Binomial distributions, we need to agree on a few basic terms. These words show up everywhere, and once they’re clear, everything else becomes much easier.

Figure 2: Illustrates the relationship between trials, outcomes, and runs.

Figure 2: Illustrates the relationship between trials, outcomes, and runs.

Trial

A trial is a single action or process that produces an outcome.

Think of it as one attempt:

  • Tossing a coin once
  • Asking one user a yes/no question

Each trial gives one outcome.

Outcomes: Success and Failure

In the context of Bernoulli and Binomial distributions, each trial has only two possible outcomes:

  • Success
  • Failure

But here’s an important point:

Success and failure do not mean “good” or “bad.”

They simply depend on what you are interested in measuring.

For example, suppose you have 10 capsules and you randomly pick one:

If your interest is in expired capsules, then

  • Success = capsule is expired
  • Failure = capsule is active

If your interest is in active capsules, then

  • Success = capsule is active
  • Failure = capsule is expired

The labels change based on the question you’re asking — the underlying experiment stays the same.

Experiment / Runs

An experiment (or runs) refers to how many times the trial is performed.

  • One capsule check → one trial
  • Checking 10 capsules → 10 runs of the same trial
  • Tossing a coin 100 times → 100 runs of the trial

This distinction becomes especially important when we move from Bernoulli (one trial) to Binomial (many trials).

With these terms in place, we’re ready to see how Bernoulli models a single trial, and how Binomial naturally extends this idea to multiple runs of the same trial.

👉 Let’s move on.

Where Bernoulli and Binomial Differ

Imagine my friend owns a light bulb factory, and I want to check whether bulbs are defective or working.

Each time I pick up a bulb and test it:

  • Success = bulb is defective (if that’s what we are interested in)
  • Failure = bulb is working

Testing one bulb is one trial. Testing many bulbs is many trials

Figure 3: Bernoulli vs Binomial.

Figure 3: Bernoulli vs Binomial.

Bernoulli: One Trial

Imagine a factory that produces boxes (Figure 4). After testing a large number of boxes over time, the factory finds that roughly 20% of them are defective. So, p = 0.2 This means that if we were to inspect 100 boxes, we would expect around 20 of them to be defective — though the exact number may vary.

Figure 4: A factory producing boxes with a defective rate of 20% (p=0.2)

Figure 4: A factory producing boxes with a defective rate of 20% (p=0.2)

Now, to make things precise, we’ll translate this story into numbers.

We will encode the outcomes in a very simple way:

  • Success (S) → 1
  • Failure (F) → 0

This is a standard and extremely useful trick.

Let:

  • p = probability of success
  • q = probability of failure

Figure 5: Derivation of Mean and Variance of Bernoulli distribution

Figure 5: Derivation of Mean and Variance of Bernoulli distribution

Figure 6:Here, we encode success as 1 and failure as 0, where success corresponds to getting a defective box and failure corresponds to getting a good box. Since a Bernoulli random variable can take only these two values, the visualization always contains exactly two bars, regardless of the dataset size.

Figure 6:Here, we encode success as 1 and failure as 0, where success corresponds to getting a defective box and failure corresponds to getting a good box. Since a Bernoulli random variable can take only these two values, the visualization always contains exactly two bars, regardless of the dataset size.

In this example, out of 100 boxes, 20 are defective and 80 are good. All 20 defective observations map to the value 1 and therefore overlap into a single bar with probability 0.2. Similarly, the 80 good boxes map to the value 0 and overlap into a single bar with probability 0.8.

Binomial: Many Trials

Now let’s move from one box to many boxes.

Instead of inspecting just a single box, suppose we randomly select 5 boxes from the same factory and inspect all of them. Each inspection is still a Bernoulli trial:

  • Success = box is defective
  • Failure = box is good

But now, our question changes.

If we take 5 random boxes, what is the probability of getting exactly 1 defective box?

This is no longer a Bernoulli problem. It’s a Binomial one.

Figure 7: It shows the different observations we can make when we randomly select 5 boxes from a large pool of 10,000 boxes, highlighting all the possible ways in which exactly one box can be defective among the five.

Figure 7: It shows the different observations we can make when we randomly select 5 boxes from a large pool of 10,000 boxes, highlighting all the possible ways in which exactly one box can be defective among the five.

Let’s understand one specific case in detail — Case 2

In Case 2, we are inspecting 5 boxes, and only one of them is defective. As we can see, the defective box appears in the last position in Case 2, then the probability of that exact sequence is simply — 0.8 × 0.8 × 0.8 × 0.8 × 0.2 = 0.08192

However, the defective box does not have to be in the last position; it could appear in any of the five positions, and each arrangement has the same probability.

To account for all these possibilities, we count how many different ways one defective box can be placed among five boxes. This is done using combinations, C(n , x), where n is the total number of boxes and x is the number of defective boxes we are interested in.

In this case, C(5,1) counts all valid arrangements, which naturally leads us to the Binomial probability mass function.

Figure 8: Derivation of the Binomial Probability Mass Function.

Figure 8: Derivation of the Binomial Probability Mass Function.

For the remaining cases, the reasoning stays exactly the same. In each case, we fix the number of defective boxes, calculate the probability of one specific arrangement, and then multiply it by the number of possible arrangements using combinations.

The only thing that changes from case to case is how many defective and good boxes are involved. Figure 9 summarizes all these cases along with their corresponding probabilities, showing how each outcome contributes to the overall Binomial distribution.

Figure 9: All binomial cases with their probabilities.

Figure 9: All binomial cases with their probabilities.

And that’s it. Once we compute the probabilities for all possible cases, we can place them side by side and form a distribution of cases versus probability, which is visualized in Figure 10.

Figure 10

Figure 10

At this point, we understand how the Binomial distribution is constructed, but we’re still left with an important question — how do we calculate and derive its mean and variance?

We’ll take that up in Part 3, where we’ll dive deeper into the Binomial distribution, derive its mean and variance step by step, and work through a complete example to tie everything together.

🧩 Conclusion

In this part, we moved from a single trial to multiple trials and saw how Bernoulli naturally grows into Binomial. By counting cases and assigning probabilities, we built the Binomial distribution step by step and visualized it clearly. The ideas may look mathematical at first, but at their core, they’re just careful bookkeeping of possibilities.

👉 In **Part 3, we’ll complete the picture by deriving the mean and variance** of the Binomial distribution and solving a problem together. See you there!


메타데이터
post_id
cf019c07584d
slug
bernoulli-vs-binomial-one-trial-or-many-part-2-cf019c07584d
url
https://medium.com/@anurupakarmakar.dgp18/bernoulli-vs-binomial-one-trial-or-many-part-2-cf019c07584d
canonical_url
https://medium.com/@anurupakarmakar.dgp18/bernoulli-vs-binomial-one-trial-or-many-part-2-cf019c07584d
author_url
https://medium.com/@anurupakarmakar.dgp18
status
ok
fetched_at
2026-06-27 07:40:21