CSCI 2824 Lecture 25 Notes: Binomial Theorem

In this lecture, we will continue with the binomial theorem and look at some applications. We will also look at recursive counting and counting unordered lists with repetitions.

Biniomial Theorem

For all natural numbers n, we can expand (x+y)^n as

 (x+y)^n = {}^n C_n x^n + {}^n C_{n-1} x^{n-1} y + {}^n C_{n-2} x^{n-2} y^2 + cdots + {}^nC_j x^j y^{n-j} + cdots + {}^nC_1 x y^{n-1} + {}^nC_n y^n

We can write it succinctly as  sum_{j=0}^n {}^nC_j x^j y^{n-j}.

Proof What is the coefficient of x^j y^{n-j} in (x+y)^n. We write (x+y)^n as (x+y)* .... * (x+y). There are n multiplicands.

To form a term x^j y^{n-j} where j geq 0, we can choose j out of n multiplicands to “supply” the x. The remaining will be chosen automatically to supply the ys. There are {}^nC_j choices. Each choice appears as a term which are then collected up.

Our reasoning above shows that the coefficient of x^j y^{n-j} where j geq 0 should be {}^nC_j.

Applications of Binomial Theorem

We can use the Binomial theorem to show some properties of the {}^nC_k function.

1. sum_{j=1}^n {}^nC_j = 2^n.

Proof: Take the expansion of (1+x)^n and substitute x=1.

 (1+1)^n = sum_{j=0}^n {}^nC_j x^j

2. Let n be an even number. Then we have {}^nC_0 + {}^nC_2 + ldots + {}^nC_{n} = {}^nC_1 + {}^nC_3 + ldots + {}^nC_{n-1}.

Proof: Take (1+x)^n and set x = -1. Write a similar result for n odd.

3. Evaluate:  sum_{j=1}^n j {}^nC_j  = {}^n C_1 + 2 times {}^nC_2 + 3 times {}^n C_3 + ldots + n times {}^n C_n.

Proof: Take (1+x)^n. Using binomial theorem, we have (1+x)^n =sum_{j=0}^n {}^nC_j x^j .

Take the derivative of both sides w.r.t x. We get:

 n (1+x)^{n-1} = sum_{j=1}^n {}^nC_j (j x^{j-1})

Substituting x=1, we get the required summation to be n 2^{n-1}.

4. Likewise, can you evaluate this summation:

 sum_{j=0}^n frac{1}{j+1} {}^nC_j  = frac{{}^nC_0}{1} + frac{{}^nC_1}{2} + frac{{}^nC_2}{3} + frac{{}^nC_3}{4} + ldots + frac{{}^nC_n}{(n+1)}

Counting Unordered Lists With Repetition

Here is a problem: There are ten candy stores, each selling the same type of candy. How many ways are there for me to purchase 30 candies from these 10 stores?

  • I could purchase all 30 from one store.

  • I could purchase 29 from one store and one more from another store.

  • I could purchase 28 from one store, and one each from two other stores.

  • I could purchase 28 from one of the stores and two from another store…

  • Ah.. the possibilities :-)

In other words, we are asking, how many ways are there of satisfying the following equation:

 x_1 + ldots+x_{10} = 30, mbox{where} x_1 mathbb{N},ldots,x_{10} in mathbb{N}

Note that x_1 refers to the number of candy bought from the first store any number ranging from 0,1.... Similarly, x_i refers to number of candy bought from i^{th} store. Again, we can buy any natural number. Note that we cannot buy negative number of candies.

Naturally each of the x_i leq 30 but we do not add that explicitly. The only way x_1 can be 31 is some other x_i is negative, which cannot happen.

Candy Purchasing and Binary Sequence

We will now “code up” the patterns of candy purchasing using binary strings made up of 0s and 1s.

Take a sequence of 30 0's. Each 0 represents a candy.

 000000....0

Our goal is to insert 9 ’1's somewhere in this sequence. Eg.,

 010010001000000000...0111111100

We interpret the sequence above to mean,

  • Bought 1 candy from first store.

  • Bought 2 candy from second store.

  • Bought 3 candy from third store.

  • Bought 23 candy from store

  • Bought 2 candy from store

Let us take another example: Take another sequence of 0's and 1's with 30 0s and 9 1s.

 01010101010101010100000....0

What pattern of candy buying does it represent:

  • 1 candy from store 1

  • 1 candy from store 2

  • 1 candy from store 9

  • 21 candies from store 10.

What pattern of 0s and 1s represent the following pattern of candy purchasing?

  • 0 candies from stores 1-5.

  • 1 candy from store 6.

  • 28 candies from store 7

  • 0 candies from store 8

  • 1 from store 9

  • 0 from store 10.

Answer:

 11111010^{28}1101

Claim

1. There is a one-to-one correspondence between the patterns of purchasing 30 candies from 10 stores and the number of binary sequences consisting of 30 0's and 9 1's.

2. There is a one-to-one corr. between the patterns of purchasing 30 candies from 10 stores and the number of solutions to the equation:

 x_1 + ldots+x_{10} = 30, mbox{where} x_1 mathbb{N},ldots,x_{10} in mathbb{N}

Answer

There are ten candy stores, each selling the same type of candy. How many ways are there for me to purchase 30 candies from these 10 stores?

Answer We have a corr. between each pattern of candy purchasing and a binary sequence with exactly 30 0's and 9 1's. Therefore, the required answer is simply {}^{39}C_9 (or {}^{39}C_{30}).

Unordered Lists With Repetitions

1. Let us say we have n different bags each containing unlimited quantities of an item. How many ways are there of choosing r items from these bags?

Or equivalently,

2. What are the number of solutions to the equation:

 x_1 + x_2 + cdots + x_n = r, x_1,ldots,x_n in mathbb{N}

or equivalently,

3. How many binary sequences of 0's and 1's exist with precisely r 0's and n-1 1's?

Answer to all of these problems is {}^{n+r-1}C_r.

Example-1

How many natural number solutions are there for the equation: x_1 + x_2 + x_3 + x_4 = 20?

Answer Each solution can be viewed as inserting 3 1s in between 20 zeros. This gives us {}^{23}C_3.

Example-2

How many natural number solutions are there for the equation: x_1 + x_2 + x_3 + x_4 leq 20?

Answer We can write the problem equivalently as x_1 + x_2 + x_3 + x_4 +x_5 = 20, where x_5 is a slack variable representing the left-over quantity 20-x_1-x_2 - x_3-x_4 which must be a natural number geq 0. Therefore, the answer is inserting 4 1s between 20 zeros: {}^{24}C_4.

Example-3

How many positive integer solutions are there for the equation: x_1 + x_2 + x_3 + x_4 = 20?

We require x_1,ldots,x_4 > 0. Let us simply write y_1 = 1 + x_1,..y_4 = 1+x_4. We have y_1,ldots,y_4 geq 0 and y_1 + y_2 + y_3 + y_4 = 16.

This gives us {}^{19}C_3 solutions.

Example-4

There are three shops that sell widgets. Our goal is to obtain 20 widgets in all. But we are constrained to buy at least 3 from each shop. How many ways of widget buying are available?

Recursive Counting

In recursive counting, we express the count as a recurrence relation.

Example-1

How many round-robin matches need to be played between n geq 2 teams?

We know that the answer is {}^nC_2.

Answer Let a_n be the number of round-robin matches that n teams need to play. If n = 2, we know that a_2 = 1.

Let us write a recurrence for a_n. We note that team teams 1,ldots,(n-1)). Therefore

 a_n = a_{n-1} + (n-1)

where a_{n-1} counts the number of round robin matches played all teams other than the last team and (n-1) accounts for the last team.