Skip to content
AI360Xpert
Beta

Binomial Theorem

The binomial theorem expands a plus b to any power without multiplying it out, with coefficients that count the ways to choose each mix of terms.

Pascal row 1, 3, 3, 1 expands a plus b cubed term by term, and setting both to 1 checks the coefficients sum to 8
Pascal row 1, 3, 3, 1 expands a plus b cubed term by term, and setting both to 1 checks the coefficients sum to 8

Why Does This Exist?

Multiplying (a+b)10(a + b)^{10} out by hand means 1024 micro-products before collecting like terms: slow, error-prone, and pointless, because the pattern is fully known. The binomial theorem writes the answer directly: each coefficient counts how many micro-products produce that term. It converts exponential mechanical work into one counting lookup per term.

It is the backbone of anything with two outcomes repeated: coin flips, click versus skip, success counts in nn trials. The binomial distribution is this theorem normalized into probabilities, and polynomial feature expansions lean on the same coefficients. Counting foundations are in combinatorics and counting; the probability sequel is probability distributions.

The one idea you need first

"nn choose kk," written (nk)\binom{n}{k}, counts the ways to pick kk items from nn: (nk)=n!/(k!(n−k)!)\binom{n}{k} = n!/(k!(n-k)!). Expanding (a+b)n(a+b)^n creates one micro-product per nn-letter word in aa and bb; the term an−kbka^{n-k}b^k collects exactly the words with kk copies of bb. Its coefficient must be (nk)\binom{n}{k}: that is the whole theorem in one sentence.

Think of It Like This

Three coin flips and the scoreboard

Flip a coin three times and list all 8 outcomes: HHH, HHT, HTH, THH, HTT, THT, TTH, TTT. Group by number of tails: one outcome with none, three with one, three with two, one with three. The group sizes 1,3,3,11, 3, 3, 1 are the expansion coefficients: each counts the routes to that mix.

Pascal's triangle is the scoreboard across flip counts: each entry sums the two above because each route to this mix extends a route from the previous round. The analogy stops at signs: with (a−b)(a - b) the counts still hold but terms alternate sign, which coins cannot show.

How It Actually Works

For non-negative integer nn:

(a+b)n=∑k=0n(nk) an−kbk(a + b)^n = \sum_{k=0}^{n} \binom{n}{k}\, a^{n-k} b^k

In plain words: the sum runs over kk, the number of bb factors; (nk)\binom{n}{k} counts the micro-products with that mix; an−kbka^{n-k}b^k is the term they share. The coefficients of row nn of Pascal's triangle are exactly these counts, each the sum of the two above it: (nk)=(n−1k−1)+(n−1k)\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}.

Two instant checks: setting a=b=1a = b = 1 gives ∑k(nk)=2n\sum_k \binom{n}{k} = 2^n (all 2n2^n outcomes counted); setting a=1,b=−1a = 1, b = -1 gives alternating sum 00 for n≥1n \geq 1 (cancellation). Any expansion failing these is wrong.

Worked example

Expand (a+b)3(a + b)^3 with row 1,3,3,11, 3, 3, 1:

(a+b)3=1a3+3a2b+3ab2+1b3(a+b)^3 = 1a^3 + 3a^2b + 3ab^2 + 1b^3

Verify three ways. At a=b=1a = b = 1: 1+3+3+1=8=231 + 3 + 3 + 1 = 8 = 2^3. At a=2,b=1a = 2, b = 1: 8+12+6+1=27=338 + 12 + 6 + 1 = 27 = 3^3. And (31)=3!/(1!2!)=3\binom{3}{1} = 3!/(1!2!) = 3 confirms the middle coefficient by direct counting. Expansion, powers, and combinatorics all agree.

Code

Expand symbolically by counting, then verify numerically.

import math
n = 3coeffs = [math.comb(n, k) for k in range(n + 1)]print(coeffs)                    # -> [1, 3, 3, 1]print(sum(coeffs))               # -> 8a, b = 2.0, 1.0print(sum(c * a ** (n - k) * b**k for k, c in enumerate(coeffs)))  # -> 27.0

Coefficients [1,3,3,1][1, 3, 3, 1], total 8, value 27.0=3327.0 = 3^3: counting and arithmetic coincide.

Watch Out For

Applying it with a minus and dropping the alternation

(a−b)3(a - b)^3 is (a+(−b))3(a + (-b))^3: odd-kk terms go negative, giving a3−3a2b+3ab2−b3a^3 - 3a^2b + 3ab^2 - b^3. Forgetting the alternation and reusing plus signs produces a3+3a2b+⋯a^3 + 3a^2b + \cdots, wrong wherever bb is nonzero.

Substitute b→−bb \to -b explicitly before reading coefficients. If an expansion of a difference has all positive terms, the signs were dropped.

Generalizing to non-integer powers term by term

(a+b)1/2(a + b)^{1/2} is not a four-term polynomial: non-integer exponents need the infinite Newton series with generalized coefficients, which converges only under conditions (∣b/a∣<1|b/a| < 1 for the standard form). Truncating after n+1n+1 terms of the finite pattern gives a wrong "exact" answer.

Check the exponent is a non-negative integer before using the finite form. Otherwise reach for the generalized series and state its convergence region.

The Quick Version

  • (a+b)n(a+b)^n sums (nk)an−kbk\binom{n}{k} a^{n-k} b^k: coefficients count the routes to each mix.
  • Row 1,3,3,11, 3, 3, 1 expands the cube: a3+3a2b+3ab2+b3a^3 + 3a^2b + 3ab^2 + b^3.
  • Coefficients always sum to 2n2^n; alternating sum is 0.
  • At (2,1)(2, 1) the cube gives 27=3327 = 3^3, confirmed three ways.
  • Pascal entries sum from the pair above: (nk)=(n−1k−1)+(n−1k)\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}.
  • Minuses alternate signs; fractional powers need the infinite series, not this form.