Binomial and Geometric Distribution

Chapter 06 · Overview

Binomial and Geometric Distribution

One repeated attempt, two different stopping rules — and the two models that follow from them.

What this chapter is about

This chapter is about one kind of situation, and two ways of asking a question about it: you repeat the same attempt over and over, every attempt has the same chance p of succeeding, and one attempt tells you nothing about the next. What separates the two models is a single decision taken before the run starts — when you are allowed to stop.

Stop after a fixed number of attempts and count the successes, and the run is described by the binomial distribution. Stop at the first success and count how long you waited, and the very same run is described by the geometric distribution. The chapter follows that split: you play both games first, then work each model through four steps — run the game a thousand times, take the formula apart, watch what the chance per attempt does to the shape, then settle the centre, the spread and the conditions — and you finish with a one-page map of each model, a table of the contrasts, and a check of your own work.

Stopping rule A
Run n attempts, count successes

The number of attempts is fixed before the run starts and never changes: every run ends on attempt n, whatever happened. Only the number of successes differs from run to run, so it can be 0, 1, 2, …, up to n.

you will meet this as the binomial distribution
Stopping rule B
Stop at the first success

There is no fixed number of attempts: keep going until one succeeds, then stop at once. Here the number of attempts is itself the outcome, so it runs 1, 2, 3, … with nothing to stop it.

you will meet this as the geometric distribution

Learning objectives

By the end of this chapter you can:

  1. Tell the two models apart. Read a real situation and decide, from the stopping rule alone, whether it is binomial, geometric, or neither of them.
  2. Read a probability correctly. Explain the difference between “exactly this many” and “at most this many”, and compute both by hand from the formula.
  3. Explain where the counting factor comes from. Say why one model multiplies a count of orderings into its answer and the other does not.
  4. Summarise a run numerically. Give the average outcome and how far a typical run sits from it, then predict how changing the number of attempts or the chance moves both.
  5. Check the conditions. Name the four requirements behind a binomial model and identify which one an everyday situation breaks.
  6. Explain why the past stops mattering. Say why misses already spent cannot raise the chance of a success on the next attempt, and what that rules out.

How to use this chapter

  1. Read this page. It fixes the question the rest of the chapter answers, so nothing later has to be introduced from scratch.
  2. Flick through the prerequisites. Seventeen cards, each flipped once, the last three of them the counting rules. Everything later is used without being explained again, so this pass matters.
  3. Work the Explore section. Play both games, then take the same four steps for each model with the lab beside you. Each model closes on a one-map recap.
  4. Finish on the comprehension check. Match real situations to a model, then compute the probabilities, the average and the spread yourself; both levels are marked straight away.

Chapter 06 · Prerequisites

The toolbox you need first

Seventeen cards: fourteen terms and three counting rules, all used later without explaining again.

How to use these cards. The front of each card shows a term; click or tap it and the card turns over with the definition, the notation and one short example. The last three cards are the counting rules, and this chapter leans on them hardest: the binomial formula multiplies a count of orderings into its answer, the geometric formula deliberately does not.

Work in two passes. First pass: flip every card once and read it. Second pass: cover the back and try to state the definition yourself, then check. Only the cards that catch you need a third pass.

Chapter 06 · Comprehension check

Check what you can now do

Nine situations to classify, seven items to compute, marked the moment you submit.

Level 1 — match the model. One real situation at a time. Choose Binomial, Geometric or Neither, submit, and the app tells you whether that is right, why the context belongs where it does, and draws the probability plot of the model you should have picked.

Level 2 — compute and judge. Type P(X = k), P(X ≤ k), E(X), Var(X) and SD(X). Probabilities go in as decimals (0.2150, not 21.50); the mean, the variance and the SD to two decimals. After you submit, the page shows the whole calculation, line by line.

Some items cannot be modelled at all. Say so, and name the condition that fails — that is the step most students skip, and the one an exam rewards.

Work alone before you submit. Nothing is timed, and either level can be restarted.

Live Shiny app

Comprehension check

Nine classifications and seven computations, marked as you submit.

Open in a full window ↗

The app runs inside this card, or on a page of its own through the second button. The first launch starts the R engine in your browser and takes about half a minute; after that it opens straight away.

Both levels open as a real Shiny app from this package. Answers stay with you until you close the window.

Chapter 06 · Explore

Two games, one basket booth

A booth of baskets and one ball. Every shot has the same 0.4 chance of dropping in, one shot tells you nothing about the next, and nothing is written down. Both games below shoot at those same baskets. They differ in one respect only — when the round is allowed to stop.

Same baskets, same chance. Only the stopping rule changes.

Chance per shot
p = 0.4
Game A
10 shots
Game B
stop at 1st basket

Play both games before touching a formula. Each round of Game A produces one number, each round of Game B produces one number, and after enough rounds those numbers pile into a shape. That shape is the distribution — and the two shapes are different because the stopping rules are different.

Game A

Ten shots, fixed

Rule: take all ten shots, whatever comes out, and only then stop. Count how many baskets you made.

12345678910BASKETMISSONE SHOT = ONE ATTEMPT10 SHOTS · 3 BASKETS · P(X = 3) = 21.50%

No early exit: ten shots, always ten. What you record is X = baskets among ten shots, a whole number from 0 to 10. The model that prices it is the binomial distribution.

Enter Game A rule first, then the lab
Game B

Stop at the first basket

Rule: keep shooting until the first basket drops, then stop on the spot. Count how many shots that took, the basket included.

1234STOPBASKETMISSONE SHOT = ONE ATTEMPTFIRST BASKET ON SHOT 4 · P(X = 4) = 8.64%

The round can end on any shot, so there is no ceiling. What you record is X = shots up to and including the first basket, a whole number from 1 upward. The model that prices it is the geometric distribution.

Enter Game B rule first, then the lab

One attempt, two names. From here on, one attempt is called a shot and a success is called a basket — the same object the Overview called an attempt, renamed for the game.

How to read both pictures. A ball that sits in its basket is a basket; a ball left outside with a dotted path is a miss. The number under each basket is the order of the shot. Both pictures use the same grammar, so you can read them side by side.

What the drawing does not decide. Nothing in the picture is aimed or timed. Every shot is a fresh 40% chance, whether it comes first or ninth — where a shot sits in the row never raises or lowers its chance. The pictures show what one round happened to produce, not what the booth prefers.

A1

Game A · fixed ten shots

The rule decides what you count.

Take all ten shots whatever happens, then count the baskets. Play a handful of rounds before anything is named — the number you write down is already a variable.

Rule

You must take all ten shots. Count how many baskets you end up with.

Lab · how to read it — this lab plays the round below one shot at a time, with the same chance, the same count and the same stopping rule.

Live Shiny app

Game A · the court

Ten shots per round at p = 0.4, counted one shot at a time.

Open in a full window ↗

The app runs inside this card, or on a page of its own through the second button. The first launch starts the R engine in your browser and takes about half a minute; after that it opens straight away.

This lab is Game A only: a fixed ten shots per round. Take all ten, then read your round result.

What you write down
X = baskets in 10 shots

The number of shots is decided before the round starts, so it never appears in the result. Only the baskets vary from round to round.

possible values: 0, 1, … , 10
After five or six rounds
Dots pile up at 3–4

One dot per finished round on a 0–10 axis. Nobody has drawn a curve yet, and the pile already drifts to the middle.

mini dot plot sits under the shot buttons
Check 1

Can X equal 12 in this game? Can it be negative?

Show answer

Neither. Ten shots is the ceiling, so ten baskets is the largest possible value; the floor is 0 because any shot can miss. The range comes from the rule, not from the story.

A2

Game A, one thousand times

Baskets, in a fixed number of shots.

Fixed n, fixed p, count the baskets. Four steps: see the shape, take the formula apart, watch what p does, then read off the centre and the spread.

01

Simulate & Count

Does the data match the model?

Run it once and read only the blue bars. Tick the red dots afterwards, not before.

Lab · how to read it — this lab plays the round below one shot at a time, with the same chance, the same count and the same stopping rule.

Live Shiny app

Game A · simulation

A thousand rounds at once, histogram against the formula.

Open in a full window ↗

The app runs inside this card, or on a page of its own through the second button. The first launch starts the R engine in your browser and takes about half a minute; after that it opens straight away.

02

Model & Formula

Where does 21.50% come from?

Drag k from 3 to 4 once. After the numbers move, C(n, k) stops being a symbol to memorise.

Live Shiny app

Game A · the model

Pick k and read P(X = k) and P(X ≤ k) straight off the formula.

Open in a full window ↗

The app runs inside this card, or on a page of its own through the second button. The first launch starts the R engine in your browser and takes about half a minute; after that it opens straight away.

03

Compare Players

What does p do to the shape?

Three shooters, one booth: at p = 0.2 the mass piles up on the left with a long tail to the right, at p = 0.5 the bars are symmetric, at p = 0.8 the picture is mirrored — mass on the right, tail to the left.

Live Shiny app

Game A · compare p

Hold n = 10 and move p: the skew changes sides.

Open in a full window ↗

The app runs inside this card, or on a page of its own through the second button. The first launch starts the R engine in your browser and takes about half a minute; after that it opens straight away.

04

Key Properties

Where is the centre, and when is this model allowed?

The last card on the right is the BINS check: miss one condition and the model is not allowed.

Live Shiny app

Game A · centre and spread

Mean, variance, SD and the four conditions, side by side.

Open in a full window ↗

The app runs inside this card, or on a page of its own through the second button. The first launch starts the R engine in your browser and takes about half a minute; after that it opens straight away.

Chapter 06 · Recap · Line A

The binomial, on one map

Six statements that rebuild the model. Read each arm once, then cover it and say it back.

Model

Binomial
B(n, p)

A fixed number of shots. Count the baskets.

Values

0, 1, …, n. One value per possible count, with a ceiling because n is fixed.

Conditions

Binary outcome · Independent shots · fixed Number of shots · Same p on every shot.

PMF

P(X = k) = C(n,k) pk(1−p)n−k — many orderings share one probability, so the count multiplies it.

CDF

P(X ≤ k) = Σ P(X = i) for i from 0 to k — add the bars; there is no short formula.

Centre & spread

E = np, Var = np(1−p): here 4.00 and 2.40, so SD ≈ 1.55 baskets.

Shape

Peaks near np. Right-skewed (long tail to the right) while p < 0.5, left-skewed while p > 0.5, and exactly symmetric only at p = 0.5.

B1

Game B · stop at the first basket

The same booth, the opposite rule.

No fixed shot count this time: shoot until the first basket, then stop on the spot, and count the shots it took. The waiting is the variable now.

Rule

Keep shooting until your first basket, then stop immediately. Count how many shots it took.

Lab · how to read it — this lab plays the round below one shot at a time, with the same chance, the same count and the same stopping rule.

Live Shiny app

Game B · the court

Sudden death: shoot until the first basket lands.

Open in a full window ↗

The app runs inside this card, or on a page of its own through the second button. The first launch starts the R engine in your browser and takes about half a minute; after that it opens straight away.

The card labelled GAME B is yours here. Watch the tiles grow: a miss adds another shot, a basket ends the round on the spot.

What you write down
X = shots to first basket

Every round ends with a basket on its last shot, so the outcome is never in doubt — only the number of shots varies.

possible values: 1, 2, 3, … with no upper limit
After five or six rounds
Dots pile up at 1–2

Most rounds end early, a few drag on. The pile leans to the left with a tail stretching right — the shape of the geometric model, drawn by hand.

mini dot plot starts at 1, not 0
Check 2

Can X equal 0 here? Is there any largest possible value?

Show answer

No zero: the round ends only on a basket, so at least one shot is always taken and X starts at 1. There is no ceiling either — the booth can hand out misses any number of times in a row, so the values run on without end.

B2

Game B, one thousand times

Shots, until the first basket.

No fixed n. Keep shooting until the first basket, then stop. The bars fall away instead of rising to a peak, and the formula has no combination in it.

01

Simulate & Count

Why is shot 1 always the tallest bar?

Read the falling bars first: shot 1 is tallest because a basket on the very first shot has exactly one path.

Lab · how to read it — this lab plays the round below one shot at a time, with the same chance, the same count and the same stopping rule.

Live Shiny app

Game B · simulation

A thousand sudden-death rounds, histogram against the formula.

Open in a full window ↗

The app runs inside this card, or on a page of its own through the second button. The first launch starts the R engine in your browser and takes about half a minute; after that it opens straight away.

02

Model & Formula

Why is there no combination here?

Move k from 4 to 5: the basket is pinned to the last shot, so only one path exists.

Live Shiny app

Game B · the model

Pick k and read the waiting time away from the formula.

Open in a full window ↗

The app runs inside this card, or on a page of its own through the second button. The first launch starts the R engine in your browser and takes about half a minute; after that it opens straight away.

03

Compare Players

How fast does the wait die away?

The tail is the story: p = 0.2 stretches far right, p = 0.8 collapses almost at once.

Live Shiny app

Game B · compare p

Move p and watch the same curve stretch, never flip.

Open in a full window ↗

The app runs inside this card, or on a page of its own through the second button. The first launch starts the R engine in your browser and takes about half a minute; after that it opens straight away.

04

Key Properties

Do earlier misses change anything?

The most counter-intuitive page in the lesson: two misses already spent change nothing.

Live Shiny app

Game B · memorylessness

Shift the intervals and check that the past does not matter.

Open in a full window ↗

The app runs inside this card, or on a page of its own through the second button. The first launch starts the R engine in your browser and takes about half a minute; after that it opens straight away.

Chapter 06 · Recap · Line B

The geometric, on one map

Six statements that rebuild the model. The last one is the property nothing else has.

Model

Geometric
G(p)

No fixed number of shots. Count the wait to the first basket.

Values

1, 2, 3, … No ceiling: nothing stops the wait from being long.

Conditions

Binary outcome · Independent shots · Same p on every shot · no fixed n.

PMF

P(X = k) = (1−p)k−1 p — the basket is pinned to the last shot, so there is one ordering and no C(n,k).

CDF

P(X ≤ k) = 1 − (1−p)k — the chance of k straight misses, subtracted from 1.

Centre & spread

E = 1/p, Var = (1−p)/p2: here 2.50 and 3.75, so SD ≈ 1.94 shots.

Memoryless

P(X > s+t | X > s) = P(X > t) — misses already taken do not raise the chance of a basket on the next one.

Chapter 06 · Wrap-up

Same booth, different question

Seven rows, one decision behind every difference. Cover the right-hand column and say each row back.

QuantityBinomial · Game AGeometric · Game B
What variesBaskets, with n fixedShots, until the first basket
Parametersn (trials) · pp only — no n
Possible values0, 1, … , n1, 2, 3, …
PMFC(n,k) · pk(1−p)n−k(1−p)k−1 · p
Why it looks like thatMany orderings, one chance eachOne ordering only
Centre and spreadmean np · variance np(1−p)mean 1/p · variance (1−p)/p²
MemoryNot applicableMemoryless: P(X > s+t | X > s) = P(X > t)

Shaded rows: the four contrasts that get mixed up most. Cover the right column and rebuild each one out loud.

One contrast the table cannot hold is the shape, and it is worth one more line. In the binomial, p moves the mass and the skew changes side with it: at p = 0.2 the bars pile up near 0 with a tail to the right, at p = 0.5 the picture is symmetric, at p = 0.8 it mirrors into a tail to the left. In the geometric, p never changes the side: the tallest bar is always on k = 1 and the tail always runs right, and p only decides how fast that tail dies away. That is why the compare step looks like two different lessons — in Game A you watch p reshape the curve, in Game B you watch p stretch the same curve and nothing more.

BINS: is a Binomial model allowed?

  1. B — Binary outcome. Every shot ends either in a basket or in a miss, nothing in between.
  2. I — Independent trials. The result of one shot does not change the next.
  3. N — fixed Number of trials. You must take all n shots, exactly like Game A.
  4. S — Same probability. p stays constant on every shot.

Game B breaks the N condition: the number of shots is decided by the result, not fixed in advance. That is exactly why it needs a different model.

Memoryless, in one picture

The app above draws it twice, with the same PMF and p = 0.4.

On the left, two misses are already used, so the whole picture starts at shot 3 and the orange bars sit beyond 2 + t. On the right the same picture starts fresh, and the orange bars sit beyond t. Move t and both orange areas grow and shrink together: the left one is P(X > 2 + t | X > 2), the right one is P(X > t), and at t = 3 they are both 21.60%.

Independent shots keep no record of the misses already paid for, so the wait still to come averages 1/p = 2.50 shots — after two misses, 4.50 shots in total.

Connect the Shiny app

Paste the public address of your deployed app. Every lab on this page will then run live, and the page remembers it next time.

Deploy with rsconnect, then copy the address from the dashboard. Running locally? Use http://127.0.0.1:7790/ while the R session is open.

Connect the check app

Paste the address of the comprehension-check app once. Students then open it directly from this page.

Running locally? Use http://127.0.0.1:7791/ while the R session is open.