Massachusetts Institute of Technology Lecture 16 6.042J/18.062J: Mathematics for Computer Science October 31, 1996 Professors Nancy Lynch and Tom Leighton

Notes 16

Readings: Section 4-3, 5-4 Next: 4-6, 4-7

Last time, we introduced the binomial coefficients

\binom{n}{r} = \frac{n!}{r!(n − r)!}

These represent the number of ways to choose r elements from a set of n elements, where the order does not matter. Combinations, as opposed to permutations, where the order does matter. (There are

\frac{n!}{(n − r)!}

of those.)

Today, we study basic properties of binomial coefficients, Then an important theorem called the Binomial Theorem, And finally revisit the principle of inclusion and exclusion, using binomial coefficients to prove it.

1 Basic Properties of Binomial Coefficients

Let n and r be naturals, 0 ≤ r ≤ n. Then

\binom{n}{r} = \frac{n!}{r!(n − r)!}.

Special cases:

\binom{n}{1} = n

\binom{n}{0} = 1

(uses the convention that 0! = 1),

\binom{n}{n} = 1

(note symmetry with previous),

\binom{n}{n − 1} = n

(symmetry).

There are infinitely many interesting identities involving binomial coefficients. You can’t learn them all, but you can learn the basic ones and look others up/derive them as needed. Can prove them by algebra, or by “thought experiments” that establish a combinatorial meaning for the LHS and RHS and argue that they are the same.

Theorem 1.1 Suppose 0 ≤ r ≤ n. Then

\binom{n}{r} = \binom{n}{n − r}.

Proof. (Algebraic)

\frac{n!}{r!(n − r)!} = \frac{n!}{(n − r)!(n − (n − r))!}.

Proof. (Combinatorial thought experiment) LHS is number of ways to choose r from n. RHS is number of ways to choose n − r. Choosing a set of r is equivalent to choosing a set of n − r (the elements not in the first chosen set)

– so there are just as many ways to choose either.

The next theorem gives the ratio between successive binomial coefficients (same n, successive r):

Theorem 1.2 Suppose 1 ≤ r ≤ n. Then

\binom{n}{r}/\binom{n}{r − 1} = (n − r + 1)/r.

Proof. (Algebraic) LHS =

\frac{n!}{r!(n − r)!} × \frac{(r − 1)!(n − (r − 1))!}{n!} = (n − r + 1)/r.

Note that this ratio is > 1, which means the successive coefficients are increasing, as long as r < \frac{n+1}{2}. Also, the ratio is < 1, which means the coefficient are decreasing, when r > \frac{n+1}{2}. This says that the coefficients increase, then decrease, i.e., they are unimodal. Form a bell-shaped curve:

-bb-error = =

Figure 1: Bell Curve

In fact, the binomial coefficients form a real bell curve. Like on tests: Suppose that an SAT test has n questions. Then the bell curve describes, for every r, the number of ways the student can get exactly r of the questions right, that is,

\binom{n}{r}.

If we suppose that each student taking the test is equally likely to get each of the n questions right or wrong, \frac{1}{2} for each, then these coefficients turn out to be proportional to the number of students that get those numbers of questions right. (See this when we do probability.)

Another identity:

Theorem 1.3 Suppose 1 ≤ r ≤ n. Then

\binom{n}{r} = \frac{n}{r}\binom{n − 1}{r − 1}.

Proof. (Algebraic)

\binom{n}{r} = \frac{n!}{r!(n − r)!}
= \frac{n}{r} \frac{(n − 1)!}{(r − 1)!(n − r)!}
= \frac{n}{r} \frac{(n − 1)!}{(r − 1)!((n − 1) − (r − 1))!}
= \frac{n}{r}\binom{n − 1}{r − 1}

Proof. (Combinatorial) Consider choosing a committee of size r and a leader, from n people. One way is to pick the leader first (n ways), then pick the other r − 1 committee members from the remainder (\binom{n−1}{r−1} ways). Another way is to pick the r committee members first (\binom{n}{r} ways) and then pick a leader from among them (r ways). This implies that:

n\binom{n − 1}{r − 1} = \binom{n}{r}r.

Now divide both sides by r.

Now an important theorem due to Pascal:

Theorem 1.4 (Pascal) Suppose 1 ≤ r ≤ n − 1. Then

\binom{n}{r} = \binom{n − 1}{r} + \binom{n − 1}{r − 1}.

Proof. (Algebraic)

\binom{n − 1}{r} + \binom{n − 1}{r − 1} = \frac{(n − 1)!}{r!(n − 1 − r)!} + \frac{(n − 1)!}{(r − 1)!(n − r)!}
= (n − r)\frac{(n − 1)!}{r!(n − r)!} + r\frac{(n − 1)!}{r!(n − r)!}
= n\frac{(n − 1)!}{r!(n − r)!}
= \frac{n!}{r!(n − r)!}
= \binom{n}{r}

Proof. (Combinatorial) Let S = {1, …, n}. Let A be the set of r-element subsets of S. Let B be the set of r-element subsets of S that contain 1. Let C be the set of r-element subsets of S that don’t contain 1.

Then A = B ∪ C, and B and C are disjoint. So |A| = |B| + |C|, by sum rule. But now can get expressions for |A|, |B| and |C| as numbers of combinations:

• |A| = \binom{n}{r}.

• |B| = \binom{n−1}{r−1}. This is because r − 1 other elements must be chosen from the remaining n − 1.

• |C| = \binom{n−1}{r}. This is because r elements must be chosen from the remaining n.

So

\binom{n}{r} = |A| = |B| + |C| = \binom{n − 1}{r − 1} + \binom{n − 1}{r}.

Pascal’s theorem has a nice pictorial representation: Row represents n, starting with 0 in top row. Successive elements represent r, starting with 0 at left.

-bb-error = =

Figure 2: Pascal’s triangle.

This triangle has lots of nice properties. Experiment with it. E.g., what happens if we add the coefficients in one row?

Theorem 1.5 Suppose n is any natural. Then

∑_{r=0}^{n} \binom{n}{r} = 2^{n}.

Proof. (Algebraic) Induction on n. Let P (n) be:

∑_{r=0}^{n} \binom{n}{r} = 2^{n}

BASE: n = 0.

∑_{r=0}^{0} \binom{0}{r} = \binom{0}{0} = 1 = 2^{0}

INDUCTIVE STEP: Assume P (n), show P (n + 1), where n ≥ 0.

∑_{r=0}^{n+1} \binom{n + 1}{r} = \binom{n+1}{0} + ∑_{r=1}^{n} \binom{n+1}{r} + \binom{n+1}{n+1}

= 2 + ∑_{r=1}^{n} \binom{n + 1}{r}

= 2 + ∑_{r=1}^{n}(\binom{n}{r} + \binom{n}{r − 1})  by Pascal’s identity

= 2 + 2 ∑_{r=1}^{n−1} \binom{n}{r} + \binom{n}{0} + \binom{n}{n}

= 2 ∑_{r=0}^{n} \binom{n}{r}

= 2 · 2^{n}  by inductive hypothesis,
= 2^{n+1}.

Proof. (Combinatorial) There are 2^{n} different subsets of a set of n elements. Decompose this collection based on the sizes of the subsets. There are \binom{n}{r} subsets of size r, for r = 0, 1, …, n. Hence the theorem follows.

Theorem 1.6 (Vandermonde) Suppose 0 ≤ r ≤ m, n. Then

\binom{m + n}{r} = ∑_{k=0}^{r} \binom{m}{r − k}\binom{n}{k}

Proof. (Combinatorial) Suppose there are m red balls and n blue balls, all distinct. There are \binom{m+n}{r} ways to choose r balls from the two sets combined. That’s the LHS. Now decompose this collection of choices based on how many of the chosen balls are blue. For any k, 0 ≤ k ≤ r, there are \binom{m}{r−k} ways to choose r − k red balls, and \binom{n}{k} ways to choose k blue balls. By the product rule, that makes \binom{m}{r−k}\binom{n}{k} ways to choose r balls such that k of them are blue. Adding up these numbers for all k gives the RHS.

It is also possible to prove this algebraically, using Pascal’s identity. To do this, it’s useful to generalize the notion of binomial coefficient a little bit: If r > n, define \binom{n}{r} to be 0. Makes some kind of sense informally, because there aren’t any ways to choose more elements than there are in a set!

We can then observe that some of the binomial identities are still correct with this extension. E.g., Pascal’s theorem is still true if r > n (reduces trivially). So we will prove Vandermonde’s theorem without the restriction r ≤ m, n. This means that some of the terms in the statement of the theorem could be trivial terms, e.g., \binom{n}{k} could occur, where k > n (value taken as 0).

Proof. (Algebraic) Induction using Pascal’s identity: Let P (n) be

∀m, r, \binom{m + n}{r} = ∑_{k=0}^{r} \binom{m}{r − k}\binom{n}{k}

BASE: n = 0. Then

\binom{m + 0}{r} = \binom{m}{r} = ∑_{k=0}^{r} \binom{m}{r − k}\binom{0}{k}.

This latter equation is true because the only value of k for which the last factor isn’t 0 is k = 0. Hence P (0) is true.

INDUCTIVE STEP: Assume P (n) is true, show P (n + 1). We have:

\binom{m + (n + 1)}{r} = \binom{m + n}{r} + \binom{m + n}{r − 1} by Pascal’s identity (don’t have to worry about bounds)

= ∑_{k=0}^{r} \binom{m}{r − k}\binom{n}{k} + ∑_{k=0}^{r−1} \binom{m}{r − 1 − k}\binom{n}{k} by inductive hypothesis (don’t have to worry about bounds)

= ∑_{k=0}^{r} \binom{m}{r − k}\binom{n}{k} + ∑_{k=1}^{r} \binom{m}{r − k}\binom{n}{k − 1} by change of vars

= \binom{m}{r}\binom{n}{0} + ∑_{k=1}^{r} \binom{m}{r − k}(\binom{n}{k} + \binom{n}{k − 1})

= \binom{m}{r}\binom{n}{0} + ∑_{k=1}^{r} \binom{m}{r − k}\binom{n + 1}{k} by Pascal’s identity

= \binom{m}{r}\binom{n + 1}{0} + ∑_{k=1}^{r} \binom{m}{r − k}\binom{n + 1}{k}

= ∑_{k=0}^{r} \binom{m}{r − k}\binom{n + 1}{k}

Hence, P (n + 1) is true. So P (n) is true for all n.

2 The Binomial Theorem

An important theorem giving the coefficients in the expansion of powers of binomial expressions. Turns out they are binomial coefficients.

2.1 The Theorem

Theorem 2.1 Suppose n ∈ ℕ. Then

(x + y)^{n} = ∑_{k=0}^{n} \binom{n}{k}x^{k}y^{n−k}.

Example 1 (x + y)^{4} = 1x^{4} + 4x^{3}y + 6x^{2}y^{2} + 4xy^{3} + 1y^{4} Proof. (Algebraic) By induction (HW)

Proof. (Combinatorial)

(x + y)(x + y)(x + y)(x + y) …

n factors. Each x^{k}y^{n−k} term selects k binomials from the n to have x, rest y. \binom{n}{k} ways of choosing the binomials to have x.

2.2 Identities via Binomial Theorem

The binomial theorem can be used to give slick proofs of some binomial identities, e.g.:

Theorem 2.2

∑_{k=0}^{n} \binom{n}{k} = 2^{n}.

Proof. Plug x = 1, y = 1 into binomial theorem.

Theorem 2.3

∑_{k=0}^{n}(−1)^{k}\binom{n}{k} = 0.

Proof. Plug x = −1, y = 1 into binomial theorem.

Combinatorial interpretation: number of ways of selecting an even number of elements from a set of n equals the number of ways of selecting an odd number. This may be somewhat surprising – works whether n is even or odd.

Example 2 n = 5: Choosing odd is \binom{5}{1} + \binom{5}{3} + \binom{5}{5} = 5 + 10 + 1 = 16. Choosing even is \binom{5}{0} + \binom{5}{2} + \binom{5}{4} = 1 + 10 + 5 = 16.

Example 3 n = 6: Choosing odd is 6 + 20 + 6 = 32. Even is 1 + 15 + 15 + 1 = 32.

Theorem 2.4

∑_{k=0}^{⌊ \frac{n}{2} ⌋} \binom{n}{2k} = 2^{n−1}.

Proof. (Algebraic) Add the equations in the two previous theorems. Get

∑_{k=0}^{n}(\binom{n}{k} + (−1)^{k}\binom{n}{k}) = 2^{n}.

Odd terms cancel out, even terms double, so get:

2 ∑_{k=0}^{⌊ \frac{n}{2} ⌋} \binom{n}{2k} = 2^{n}.

Then divide by 2.

Proof. (Combinatorial) LHS represents number of ways to pick an even number of elements from a set of n elements. The number of ways to pick an even number is equal to the number of ways to pick an odd number of elements. Since the total number of ways is 2^{n}, the number of ways to pick even is half this, or 2^{n−1}.

A new proof of Pascal’s identity:

Proof. (x + y)^{n} = x(x + y)^{n−1} + y(x + y)^{n−1}. Consider coefficient of x^{r}y^{n−r}. LHS: \binom{n}{r}. RHS: Obtained by adding coefficient of x^{r−1}y^{n−r} in the first term, plus the coefficient of x^{r}y^{n−1−r} in the second term. These are \binom{n−1}{r−1} and \binom{n−1}{r}, respectively.

Vandermonde:

Proof. (1 + t)^{m+n} = (1 + t)^{m}(1 + t)^{n}. Consider coefficient of t^{r}. LHS: \binom{m+n}{r}. RHS: Obtained by adding up, for all k, the product of the coefficient of t^{k} in the second factor and the coefficient of t^{r−k} in the first factor. This is

Σ_{k=0}^{r}\binom{n}{k}\binom{m}{r − k}.

2.3 General Binomial Theorem

Can generalize binomial coefficients once again, allowing the first argument to be any real number:

Definition 2.5 General binomial coefficient \binom{α}{k} for α ∈ ℝ and k ∈ ℕ:

\binom{α}{k} = \frac{1}{k!} ∏_{j=0}^{k−1}(α − j)
=  \frac{α(α − 1) ⋯ (α − k + 1)}{k!}
\binom{α}{0}  = 1

This doesn’t have the same kinds of combinatorial meaning as before, but works out nice mathematically. In particular, a version of the binomial theorem holds:

Theorem 2.6 Let α ∈ ℝ and |\frac{x}{y} | < 1. Then

(x + y)^{α} = ∑_{k=0}^{∞} \binom{α}{k}x^{k}y^{α−k}

Proof. Calculus.

Example 4 Approximate \sqrt{2} using binomial theorem.

\sqrt{2} = (x + y)^{\frac{1}{2}} , where x = 1, y = 1

However, can’t use b.t. directly, because

|\frac{x}{y}| ≮ 1

. However,

\sqrt{2} = 2\frac{\sqrt{2}}{2} = 2\sqrt{\frac{1}{2}} = 2(1 − \frac{1}{2})^{\frac{1}{2}} = 2(x + y)^{\frac{1}{2}} , where x = 1, y = −\frac{1}{2}

(1 − \frac{1}{2})^{\frac{1}{2}} = ∑_{k=0}^{∞} \binom{\frac{1}{2}}{k} (−\frac{1}{2})^{k}

\binom{\frac{1}{2}}{0} = 1, \binom{\frac{1}{2}}{1} = \frac{1}{2}, \binom{\frac{1}{2}}{2} = \frac{(\frac{1}{2}) (−\frac{1}{2})}{2!} = −\frac{1}{8}, \binom{\frac{1}{2}}{3} = \frac{(\frac{1}{2}) (−\frac{1}{2}) (−\frac{3}{2})}{3!} = \frac{1}{16}, etc.

\sqrt{2} = 2 (1 + \frac{1}{2} (−\frac{1}{2}) + (−\frac{1}{8}) (\frac{1}{4}) + (\frac{1}{16}) (−\frac{1}{8}) + ⋯)
= 2 (1 − \frac{1}{4} − \frac{1}{32} − \frac{1}{128} − ⋯)
≈ 2(.7109375) = 1.421875

3 Principle of Inclusion and Exclusion

Finally, we return to the principle of inclusion-exclusion from last lecture. Use binomial coefficients to help prove this. Recall (for general m):

Theorem 3.1 | ∪_{i} A_{i}| = Σ_{i}|A_{i}| − Σ_{i,j distinct} |A_{i} ∪ A_{j}| + Σ_{i,j,k distinct} |A_{i} ∪ A_{j} ∪ A_{k}| − … + (−1)^{m+1}| ∩ A_{i}|

Can be proved by induction on the number of sets – LTTR. Now we will give a combinatorial proof using binomial coefficients.

Proof. (Combinatorial) Each term in the summation counts certain elements in ∪_{i}A_{i}. We prove that every element of this union is counted exactly once. So, consider any particular element a, and suppose it is in exactly r of the sets A_{i}. We see how many times a is counted by each term.

In the first term, a is counted r = \binom{r}{1} times, once for each of the sets that contains it. In the second term, a is counted \binom{r}{2} times, once for each of the pairs of sets that contain it. In the third term, a is counted \binom{r}{3} times, ..., and in the rth term, a is counted \binom{r}{r} = 1 times. The terms alternate signs, so the total number of times a is counted is:

\binom{r}{1} − \binom{r}{2} + \binom{r}{3} − … − (−1)^{r}\binom{r}{r}.

But Theorem 2.3 implies that

∑_{k=0}^{r}(−1)^{k}\binom{n}{k} = 0.

This implies that the sum above is equal to \binom{r}{0} = 1. That is, a is counted exactly once, as needed.