← mapFunctions & Growth

Counting & the Binomial Theorem

⚗ Dr. Möbius, from the lab

You've been expanding (a+b)2(a+b)^2 and (a+b)3(a+b)^3 by hand, cranking through the distributivity grinder like a damn field hand, hoping you didn't miss a term. That ends today. You're about to learn WHY the coefficients are exactly what they are — not as a cute pattern in Pascal's triangle, but as a theorem about choices. Every coefficient in (a+b)n(a+b)^n counts the number of ways to pick bb's from the product. Once you see that, you'll also see why the total row sum is 2n2^n, the exact same result you derived in the Sets stratum when you counted power sets. It all connects. It always connected. I've been waiting to show you.

THE BIG IDEA

The coefficient of $a^{n-k}b^k$ in $(a+b)^n$ is the number of ways to choose which $k$ of the $n$ factors contribute a $b$ — so the binomial theorem is a theorem about counting subsets, not an algebraic coincidence.

Counting: the multiplication principle

Before we get to (a+b)n(a+b)^n, we need to count. The fundamental tool:

Multiplication Principle. If a task has mm steps, step ii can be done in nin_i ways (independently), then the total number of ways is n1n2nmn_1 \cdot n_2 \cdots n_m.

Example: create a 3-character code using 26 letters for each character. Total codes: 26×26×26=263=1757626 \times 26 \times 26 = 26^3 = 17576. This is the whole principle. It sounds almost embarrassingly simple because it is — the power comes from applying it systematically, not from the principle itself being mysterious.

Permutations

A permutation is an ordered selection. The number of ways to arrange kk objects chosen from nn distinct objects (order matters):

P(n,k)=n!(nk)!=n(n1)(n2)(nk+1).P(n,k) = \frac{n!}{(n-k)!} = n(n-1)(n-2)\cdots(n-k+1).

Why? First choice: nn options. Second choice: n1n-1 (one used). \ldots kkth choice: nk+1n-k+1. Multiply: n(n1)(nk+1)=n!/(nk)!n(n-1)\cdots(n-k+1) = n!/(n-k)!.

Recall 0!=10! = 1 (the empty product convention, consistent with P(n,0)=1P(n,0) = 1: there's exactly one way to select nothing).

Combinations: order-blind counting

A combination is an unordered selection. The number of ways to choose kk objects from nn distinct objects (order does NOT matter):

(nk)=n!k!(nk)!.\binom{n}{k} = \frac{n!}{k!(n-k)!}.

Why? Every combination of kk objects can be arranged in k!k! different orders. So: P(n,k)ordered=(nk)unordered×k!rearrangements.\underbrace{P(n,k)}_{\text{ordered}} = \underbrace{\binom{n}{k}}_{\text{unordered}} \times \underbrace{k!}_{\text{rearrangements}}. Solve: (nk)=P(n,k)/k!=n!/[k!(nk)!]\binom{n}{k} = P(n,k)/k! = n!/[k!(n-k)!].

This is "n choose k" — the number of kk-element subsets of an nn-element set. You computed this in the Sets stratum when counting power sets; you just didn't have a name for it. You've been doing combinatorics this whole time. Surprise.

Pascal's triangle and the key identity

Arrange the combinations: (00)\binom{0}{0} (10)(11)\binom{1}{0} \quad \binom{1}{1} (20)(21)(22)\binom{2}{0} \quad \binom{2}{1} \quad \binom{2}{2} (30)(31)(32)(33)\binom{3}{0} \quad \binom{3}{1} \quad \binom{3}{2} \quad \binom{3}{3}

which evaluates to: 11 111 \quad 1 1211 \quad 2 \quad 1 13311 \quad 3 \quad 3 \quad 1

This is Pascal's triangle. The key identity that generates it:

(nk)+(nk+1)=(n+1k+1).\binom{n}{k} + \binom{n}{k+1} = \binom{n+1}{k+1}.

Proof via committee argument. The right side counts (k+1)(k+1)-element subsets of {1,2,,n+1}\{1, 2, \ldots, n+1\}. Split into two types based on whether element n+1n+1 is included:

  • Subsets INCLUDING n+1n+1: choose the remaining kk elements from {1,,n}\{1,\ldots,n\} — that's (nk)\binom{n}{k} ways.
  • Subsets EXCLUDING n+1n+1: choose all k+1k+1 elements from {1,,n}\{1,\ldots,n\} — that's (nk+1)\binom{n}{k+1} ways.

These two cases are mutually exclusive and exhaustive, so their sum equals the total: (nk)+(nk+1)=(n+1k+1).\binom{n}{k} + \binom{n}{k+1} = \binom{n+1}{k+1}. \quad \square

This is the purely combinatorial proof, with no algebra at all.

The Binomial Theorem: where it comes from

Theorem. For any n0n \ge 0: (a+b)n=k=0n(nk)ankbk.\boxed{(a+b)^n = \sum_{k=0}^{n}\binom{n}{k}a^{n-k}b^k.}

Why the coefficients are binomial. When you expand (a+b)n=(a+b)(a+b)(a+b)(a+b)^n = (a+b)(a+b)\cdots(a+b) (nn factors), you get a sum of 2n2^n terms (each factor contributes either aa or bb). Each term is a product of exactly nn letters — some aa's and some bb's. A term that has exactly kk bb's (and hence nkn-k aa's) contributes ankbka^{n-k}b^k.

How many such terms are there? Exactly the number of ways to choose WHICH kk of the nn factors contributed a bb — which is (nk)\binom{n}{k}.

So the coefficient of ankbka^{n-k}b^k is exactly (nk)\binom{n}{k}. Not a coincidence, not a pattern someone scribbled in a triangle four hundred years ago: it counts choices. Every coefficient in the expansion is literally a count of subsets. That's the binomial theorem — and now you will never again be confused about where those coefficients come from, because you know the argument. You magnificent idiot, you've got it.

Small cases to ground it.

n=2n = 2: (a+b)2=(20)a2+(21)ab+(22)b2=a2+2ab+b2(a+b)^2 = \binom{2}{0}a^2 + \binom{2}{1}ab + \binom{2}{2}b^2 = a^2 + 2ab + b^2. You knew this.

n=3n = 3: (a+b)3=a3+3a2b+3ab2+b3(a+b)^3 = a^3 + 3a^2b + 3ab^2 + b^3. Row 3 of Pascal's triangle: 1,3,3,11, 3, 3, 1.

Connection: row sums and power sets

Set a=b=1a = b = 1 in the binomial theorem: 2n=(1+1)n=k=0n(nk).2^n = (1+1)^n = \sum_{k=0}^{n}\binom{n}{k}.

The sum of row nn of Pascal's triangle is 2n2^n.

But wait — this is the same result from the Sets stratum: a set with nn elements has 2n2^n subsets, because (nk)\binom{n}{k} is the number of kk-element subsets and all subsets have size 0,1,,n0, 1, \ldots, n. The binomial theorem is the Sets result in algebraic clothing.

The Sets stratum built the room; the Binomial Theorem is what's written on the wall. When you see this kind of convergence — two apparently different arguments arriving at the same fact — that is not an accident. That is mathematics doing exactly what it's supposed to do, and it should give you a feeling somewhere between vertigo and genuine joy.

🔬 SPECIMENS (worked examples)

Worked example 1 — counting selections

A committee of 3 is chosen from 8 people. (a) If the committee has no special roles, how many committees are possible? (b) If one person is chosen as chair, one as secretary, and one as treasurer, how many choices?

(a) No roles (unordered). We choose 3 from 8 without caring about order: this is a combination. (83)=8!3!5!=876321=3366=56.\binom{8}{3} = \frac{8!}{3! \cdot 5!} = \frac{8 \cdot 7 \cdot 6}{3 \cdot 2 \cdot 1} = \frac{336}{6} = 56.

(b) With distinct roles (ordered). Now order matters: who gets which role. This is a permutation. P(8,3)=8!(83)!=876=336.P(8,3) = \frac{8!}{(8-3)!} = 8 \cdot 7 \cdot 6 = 336.

The ratio: 336/56=6=3!336/56 = 6 = 3!. Exactly the number of ways to assign 3 distinct roles to 3 people — consistent with P(n,k)=(nk)k!P(n,k) = \binom{n}{k} \cdot k!.

Worked example 2 — expanding with the Binomial Theorem

Expand (2x3)4(2x - 3)^4 using the Binomial Theorem.

Write a=2xa = 2x, b=3b = -3, n=4n = 4: (2x3)4=k=04(4k)(2x)4k(3)k.(2x - 3)^4 = \sum_{k=0}^{4}\binom{4}{k}(2x)^{4-k}(-3)^k.

Compute each term:

k=0k=0: (40)(2x)4(3)0=116x41=16x4\binom{4}{0}(2x)^4(-3)^0 = 1 \cdot 16x^4 \cdot 1 = 16x^4.

k=1k=1: (41)(2x)3(3)1=48x3(3)=96x3\binom{4}{1}(2x)^3(-3)^1 = 4 \cdot 8x^3 \cdot (-3) = -96x^3.

k=2k=2: (42)(2x)2(3)2=64x29=216x2\binom{4}{2}(2x)^2(-3)^2 = 6 \cdot 4x^2 \cdot 9 = 216x^2.

k=3k=3: (43)(2x)1(3)3=42x(27)=216x\binom{4}{3}(2x)^1(-3)^3 = 4 \cdot 2x \cdot (-27) = -216x.

k=4k=4: (44)(2x)0(3)4=1181=81\binom{4}{4}(2x)^0(-3)^4 = 1 \cdot 1 \cdot 81 = 81.

Result: (2x3)4=16x496x3+216x2216x+81.(2x - 3)^4 = 16x^4 - 96x^3 + 216x^2 - 216x + 81.

Sanity check at x=1x=1: (23)4=(1)4=1(2-3)^4 = (-1)^4 = 1. Check: 1696+216216+81=116 - 96 + 216 - 216 + 81 = 1. Confirmed.

Worked example 3 — the power set connection (two proofs, one truth)

Show that (1+x)4(1+x)^4 has coefficient sum 1616, and connect this to the number of subsets of a 4-element set.

By the Binomial Theorem: (1+x)4=(40)+(41)x+(42)x2+(43)x3+(44)x4.(1+x)^4 = \binom{4}{0} + \binom{4}{1}x + \binom{4}{2}x^2 + \binom{4}{3}x^3 + \binom{4}{4}x^4.

Evaluate at x=1x = 1: (1+1)4=24=16=(40)+(41)+(42)+(43)+(44).(1+1)^4 = 2^4 = 16 = \binom{4}{0} + \binom{4}{1} + \binom{4}{2} + \binom{4}{3} + \binom{4}{4}.

Numerically: 1+4+6+4+1=161 + 4 + 6 + 4 + 1 = 16. Row 4 of Pascal's triangle sums to 1616.

Connection to power sets. A set AA with A=4|A| = 4 has exactly 24=162^4 = 16 subsets. For each kk, there are (4k)\binom{4}{k} subsets of size kk: 11 empty set, 44 singletons, 66 pairs, 44 triples, 11 full set. Sum: 1+4+6+4+1=161+4+6+4+1 = 16. The binomial theorem is precisely the algebraic expression of the fact you proved in the Sets stratum: P(A)=2A|P(A)| = 2^{|A|}. Same truth, two faces.

☠ KNOWN HAZARDS

  • Permutations vs combinations. If order matters (passwords, race results), use P(n,k)P(n,k). If order doesn't matter (committees, hands of cards), use (nk)\binom{n}{k}. Mixing them up is the single most common error in combinatorics, and it costs exactly one factor of k!k!, which can be enormous. Ask yourself: does swapping the selections produce a different outcome?

  • Forgetting that the binomial coefficient applies to BOTH terms. In (a+b)n(a+b)^n, the coefficient of ankbka^{n-k}b^k is (nk)\binom{n}{k}. And since (nk)=(nnk)\binom{n}{k} = \binom{n}{n-k}, it also equals the coefficient of akbnka^k b^{n-k}. Pascal's triangle is symmetric for exactly this reason — and now you know WHY, not just that it is.

  • Off-by-one in the expansion. (a+b)n(a+b)^n has n+1n+1 terms (for k=0,1,,nk = 0, 1, \ldots, n), not nn terms. The power nn doesn't equal the number of terms. Count the kk values: from 00 to nn inclusive is n+1n+1 of them.

  • Misapplying the theorem to sums of more than two terms. The BINOMIAL theorem covers (a+b)n(a + b)^n. For (a+b+c)n(a + b + c)^n you need the multinomial theorem, which is a generalization not covered in this lesson. Don't try to brute-force a trinomial with the binomial theorem; that way lies grief.

TL;DR

  • Multiplication principle: multiply the number of choices at each step.

  • P(n,k)=n!/(nk)!P(n,k) = n!/(n-k)! ordered selections; (nk)=n!/[k!(nk)!]\binom{n}{k} = n!/[k!(n-k)!] unordered (divide out the k!k! rearrangements).

  • Pascal's identity: (nk)+(nk+1)=(n+1k+1)\binom{n}{k} + \binom{n}{k+1} = \binom{n+1}{k+1}, proved by the "include or exclude element n+1n+1" committee argument.

  • Binomial theorem: (a+b)n=k=0n(nk)ankbk(a+b)^n = \sum_{k=0}^n \binom{n}{k} a^{n-k}b^k; the coefficient (nk)\binom{n}{k} counts which kk factors contribute a bb.

  • Row sum: k=0n(nk)=2n\sum_{k=0}^n \binom{n}{k} = 2^n — the number of subsets of an nn-element set, confirming the Sets stratum's power-set count.