Skip to content
LearnMathora

Counting & combinatorics · 04 · The bridge to probability · 8 min

Medium

Repetition, identical items & probability

Two twists complete your counting toolkit: arrangements where items can repeat, and arrangements where some items are identical. With these, you can count the outcomes that probability and statistics are built on — and that's exactly where this section delivers you.

Build the intuition

Arrangements with repetition

When choices can repeat — each independent and from the same pool — you simply multiply: a 4-digit PIN allows 10⁴ = 10,000 codes because each digit independently has all 10 options. No factorial discount, because nothing gets 'used up'. Repetition-allowed counting is the pure fundamental counting principle: pool size raised to the number of slots.

nk(k slots, n options each, repeats allowed)n^k \quad (\text{k slots, n options each, repeats allowed})

Arrangements with identical items

Spell MISSISSIPPI: 11 letters, but with repeats (4 S's, 4 I's, 2 P's). If all were distinct there'd be 11! orderings — but swapping two identical S's changes nothing, so we divide by the factorials of each repeat group. The result, 11!/(4!4!2!) = 34,650, is far less than 11!. Identical items collapse arrangements, just as unordered selection did for combinations.

n!n1!n2!\frac{n!}{n_1!\,n_2!\cdots}

Counting becomes probability

Here's the handoff. Probability of an event = (favorable outcomes) ÷ (total outcomes) — both counted with the tools you now have. The chance of a specific 5-card poker hand? Count the favorable hands, divide by C(52, 5). The binomial distribution's coefficients are literally C(n, k) — the number of ways to get k successes. Every probability you'll meet next rests on counting done right.

P(event)=favorable outcomestotal outcomesP(\text{event}) = \frac{\text{favorable outcomes}}{\text{total outcomes}}

See it move

InteractiveCounting without listing

number of heads k

6
With 6 coin flips there are 64 possible sequences (2 choices, 6 times: 2^6). The bars count how many land exactly k heads — Pascal's triangle, row 6, and already the outline of a bell curve.

Combinations become a distribution: each bar is C(n, k) — the number of ways to get k heads in n flips. Counting, plotted, is already the shape of probability.

A worked example

From a count to a probability

  1. Flip a fair coin 4 times. What's the probability of exactly 2 heads?

  2. Total ordered outcomes: 2⁴ = 16 (repetition allowed: H or T each flip).

  3. Favorable — which 2 of the 4 flips are heads:

    (42)=6\binom{4}{2} = 6
  4. Probability:

    616=0.375\frac{6}{16} = 0.375
  5. Counting gave both numbers. That ratio is the binomial distribution at work — your first step into probability.

Out in the world

Counting under the hood of ML

Probabilities in classifiers, the binomial and multinomial distributions in language models, sampling schemes in data science — all rest on counting outcomes correctly. The combinatorics here is quiet but foundational: get the counts wrong and every probability built on them is wrong too.

Common confusion, cleared

Counting and probability are separate topics.

Probability is counting, normalized: favorable ÷ total. Combinations and permutations are the machinery that produces both numbers. Counting is the foundation probability stands on.

Identical items can be arranged like distinct ones.

Swapping two identical letters creates no new arrangement, so you must divide by each repeat group's factorial. Treating identical items as distinct over-counts every time.

Check yourself

PracticeQuick check

  1. How many distinct arrangements of the letters in 'LEVEL'?

  2. Flipping a coin 3 times, P(exactly 1 head) is…

Recap

  • Repeats allowed: nᵏ (no factorial discount — nothing is used up).
  • Identical items: divide n! by the factorial of each repeat group.
  • Probability = favorable ÷ total — both counted with these tools. Next: probability.

Progress saves in this browser.