<<

. Combinations with repetition. and combinations Pascal’s Triangle

The Binomial Theorem Given a with n elements. Combinations with repetition

Permutations with The number of permutations of the elements the set: repetition

P(n) = n! = n (n 1) (n 2) ... 1 · − · − · · The number of r-permutations of the set:

n! P(n, r) = = n (n 1) (n 2) ... (n r + 1) (n r)! | · − · − {z· · − } − product of r numbers

The number of unordered r-combinations (“n choose r”):  ‹ n P(n, r) n! = = r P(r) (n r)! r! −

p. 2 n What are the properties of r ? Pascal’s Triangle

The Binomial Theorem n Combinations with repetition How does r change with r? Permutations with repetition 0‹ 0! 1. 0 = 0! 0! =

1‹ 1! 1‹ 1! 1, 1. 0 = 1! 0! = 1 = 0! 1! =

2‹ 2! 2‹ 2! 2‹ 2! 1, 2, 1. 0 = 2! 0! = 1 = 1! 1! = 2 = 0! 2! =

3‹ 3! 3‹ 3! 3‹ 3! 3‹ 3! 1, 3, 3, 1. 0 = 3! 0! = 1 = 2! 1! = 2 = 1! 2! = 3 = 0! 3! =

p. 3 Pascal’s Triangle Pascal’s Triangle

The Binomial Theorem

Combinations with repetition 0‹ 1 Permutations with 0 repetition 1‹ 1‹ 11 0 1 2‹ 2‹ 2‹ 121 0 1 2 3‹ 3‹ 3‹ 3‹ 0 1 2 3 1331 4‹ 4‹ 4‹ 4‹ 4‹ 0 1 2 3 4 14641 5‹ 5‹ 5‹ 5‹ 5‹ 5‹ 0 1 2 3 4 5 15 10 1051

p. 4 Pascal’s Triangle Pascal’s Triangle

The Binomial The numbers in Pascal’s Triangle are the coefficients of the polyno- Theorem n Combinations with mials of the form (x + y) : repetition Permutations with 0 repetition (x + y) = 1

1 (x + y) = 1x + 1y 2 2 2 (x + y) = 1x + 2xy + 1y 3 3 2 2 3 (x + y) = 1x + 3x y + 3xy + 1y 4 4 3 2 2 3 4 (x + y) = 1x + 4x y + 6x y + 4xy + 1y

 ‹  ‹  ‹  ‹ n n n n n 1 n n 2 2 n n (x + y) = x + x − y + x − y + ... + y . 0 · 1 · 2 · n · n X n‹ x y n x n k y k ( + ) = k − k=0 p. 5 Pascal’s Triangle Pascal’s Triangle

The Binomial The numbers in Pascal’s Triangle are the coefficients of the polyno- Theorem n Combinations with mials of the form (x + y) : repetition Permutations with 0 repetition (x + y) = 1

1 (x + y) = 1x + 1y 2 2 2 (x + y) = 1x + 2xy + 1y 3 3 2 2 3 (x + y) = 1x + 3x y + 3xy + 1y 4 4 3 2 2 3 4 (x + y) = 1x + 4x y + 6x y + 4xy + 1y

 ‹  ‹  ‹  ‹ n n n n n 1 n n 2 2 n n (x + y) = x + x − y + x − y + ... + y . 0 · 1 · 2 · n · n X n‹ x y n x n k y k ( + ) = k − k=0 p. 6 Pascal’s Triangle Pascal’s Triangle

The Binomial The numbers in Pascal’s Triangle are the coefficients of the polyno- Theorem n Combinations with mials of the form (x + y) : repetition Permutations with 0 repetition (x + y) = 1

1 (x + y) = 1x + 1y 2 2 2 (x + y) = 1x + 2xy + 1y 3 3 2 2 3 (x + y) = 1x + 3x y + 3xy + 1y 4 4 3 2 2 3 4 (x + y) = 1x + 4x y + 6x y + 4xy + 1y

 ‹  ‹  ‹  ‹ n n n n n 1 n n 2 2 n n (x + y) = x + x − y + x − y + ... + y . 0 · 1 · 2 · n · n X n‹ x y n x n k y k ( + ) = k − k=0 p. 7 Pascal’s Triangle Pascal’s Triangle

The Binomial The numbers in Pascal’s Triangle are the coefficients of the polyno- Theorem n Combinations with mials of the form (x + y) : repetition Permutations with 0 repetition (x + y) = 1

1 (x + y) = 1x + 1y 2 2 2 (x + y) = 1x + 2xy + 1y 3 3 2 2 3 (x + y) = 1x + 3x y + 3xy + 1y 4 4 3 2 2 3 4 (x + y) = 1x + 4x y + 6x y + 4xy + 1y

 ‹  ‹  ‹  ‹ n n n n n 1 n n 2 2 n n (x + y) = x + x − y + x − y + ... + y . 0 · 1 · 2 · n · n X n‹ x y n x n k y k ( + ) = k − k=0 p. 8 n Coefficients of (x + y) Pascal’s Triangle

The Binomial Theorem Let’s prove Combinations with repetition  ‹  ‹  ‹  ‹ Permutations with n n n n n 1 n n 2 2 n n repetition (x + y) = x + x − y + x − y + ... + y . 0 · 1 · 2 · n ·

Example:

3 (x + y) =(x + y)(x + y)(x + y) = x x x+ x x y + x y x + y x x+ x y y + y x y + y y x+ y y y

n 3 2 = 2 = 8 terms in total. The same as the number of the bit strings of length 3.

p. 9 n Coefficients of (x + y) Pascal’s Triangle

The Binomial Theorem

Combinations with repetition n (x + y) = (x + y) (x + y) ... (x + y) = ? Permutations with | · {z · · } repetition n times

What is happening when we multiply (x + y) n times? We get the sum of

p. 10 n Coefficients of (x + y) Pascal’s Triangle

The Binomial Theorem

Combinations with repetition n (x + y) = (x + y) (x + y) ... (x + y) = ? Permutations with | · {z · · } repetition n times

What is happening when we multiply (x + y) n times? We get the sum of

x x x x x ... x+ yxxxx ... x+ xyxxx ... x+ yyxxx ... x+ x xyxx ... x+ ... + y y y y y ... y

p. 11 n Coefficients of (x + y) Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition n (x + y) = (x + y) (x + y) ... (x + y) = | · {z · · } n times x x ... x + | {z } · =·x n · (x ... x) y + ... + y (x ... x)+ | {z } · x n 1· · · · · = − (x ... x) (y y) + ... + (y y) (x ... x)+ | {z } | {z } · x n 2· · · · · · x n 2· = − = − ... + y y ... y | · {z· · } =y n

p. 12 n Coefficients of (x + y) Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition

n (x + y) = (x + y) (x + y) ... (x + y) = | · {z · · } n times n 1 x + · n 1 n x − y +  · ‹ n n 2 2 x − y + 2 · ... + 1 y n ·

p. 13 The Binomial Theorem Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition n (x + y) = (x + y) (x + y) ... (x + y) = | · {z · · } n times  ‹  ‹  ‹  ‹ n n n n 1 n n 2 2 n n x + x − y + x − y + ... + y . 0 · 1 · 2 · n · Shorter notation for the same thing:

n X n‹ x y n x n k y k. ( + ) = k − k=0

This result is called The Binomial Theorem, and this is why the co- n efficients, k , are also called the binomial coefficients.

p. 14 The Binomial Theorem Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with Let’s prove that repetition

n‹ n‹ n‹ ... 2n. 0 + 1 + + n =

n n n X n‹ X n‹ X n‹ 1 1 n 1n k1k 1 . ( + ) = k − = k = k k=0 k=0 · k=0

Therefore, n X n‹ 2n. k = k=0

p. 15 The Binomial Theorem Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with Let’s prove that repetition

n‹ n‹ n‹ ... 2n. 0 + 1 + + n =

n n n X n‹ X n‹ X n‹ 1 1 n 1n k1k 1 . ( + ) = k − = k = k k=0 k=0 · k=0

Therefore, n X n‹ 2n. k = k=0

p. 16 The Binomial Theorem Pascal’s Triangle

The Binomial Theorem

Combinations with  ‹  ‹  ‹ repetition n n n n + + ... + = 2 . Permutations with 0 1 n repetition Results like this are not very obvious. Recall that n‹ n! = k (n k)! k! So, − n! n! n! n! n + + + ... + = 2 . n! 0! (n 1)! 1! (n 2)! 2! 0! n! − − In this form, the result seems to be much harder to prove.

However, can you think of another way to prove this identity? (You can try to use double counting)

p. 17 The Binomial Theorem Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with Using the binomial theorem repetition

n X n‹ x y n x n k y k, ( + ) = k − k=0 prove that

n X n‹ 2k k = k=0 n‹ n‹ n‹ n‹ 2 22 ... 2n 3n. 0 + 1 + 2 + + n =

p. 18 Counting routes Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition

You can go only North and East. 5+3 Count the number of paths from (0, 0) to (5, 3). Answer: 3 .

p. 19 Counting routes Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition

You can go only North and East. 5+3 Count the number of paths from (0, 0) to (5, 3). Answer: 3 .

p. 20 Pascal’s Triangle Again Pascal’s Triangle

The Binomial Theorem

Combinations with repetition 0‹ 1 Permutations with 0 repetition 1‹ 1‹ 11 0 1 2‹ 2‹ 2‹ 121 0 1 2 3‹ 3‹ 3‹ 3‹ 0 1 2 3 1331 4‹ 4‹ 4‹ 4‹ 4‹ 0 1 2 3 4 14641 5‹ 5‹ 5‹ 5‹ 5‹ 5‹ 0 1 2 3 4 5 15 10 1051

p. 21 Pascal’s Identity Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition

 ‹  ‹  ‹ n + 1 n n k = k 1 + k − Every number in Pascal’s triangle is equal to the sum of the two numbers that are immediately above.

p. 22 Another Identity Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition

Prove that for r n and r m: ≤ ≤  ‹ r  ‹ ‹ m + n X m n r = r k k k 0 = −

p. 23 Vandermonde’s Identity Pascal’s Triangle

The Binomial Theorem

Combinations with Prove that for r n and r m: repetition ≤ ≤  ‹ r  ‹ ‹ Permutations with m + n X m n repetition r = r k k k 0 = −

We split the initial set of m + n objsects into two arbitrary of m and n objects. After that, we can choose r objects from the two subsets in the following ways:

k of size m subset of size n  ‹ ‹  ‹ ‹ 0 choose r choose none m n m n r 0 + r 1 1 + 1 choose r 1 choose 1  m ‹n‹ − m‹n‹ ... 2 choose r − 2 choose 2 + r 2 2 + + 0 r r − ... − X  m ‹n‹ = r k k k 0 r choose 0 choose r = −

p. 24 r-combinations without repetition Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition n Recall that without repetitions, this is r . For example, you have n books, but don’t have time to read all of them, and have to select only r books to read. In how many ways can you do so?

n‹ n! = r (n r)! r! − n There are r ways to make the choice.

p. 25 r-combinations with repetition Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition

There is a vending machine with 3 types of drinks, $1 each drink. You have to spend $5.

| $ | $ | $ | $ | $ |

p. 26 r-combinations with repetition Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition

There is a vending machine with 3 types of drinks, $1 each drink. You have to spend $5.

| $ | $ | $ | $ | $ |

p. 27 r-combinations with repetition Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition

There is a vending machine with 3 types of drinks, $1 each drink. You have to spend $5.

$ | $ $ | $ $ |{z} |{z} |{z} 1 drink 2 drinks 2 drinks

p. 28 r-combinations with repetition Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition

There is a vending machine with 3 types of drinks, $1 each drink. You have to spend $5.

| $ | $ | $ | $ | $ |

p. 29 r-combinations with repetition Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition

There is a vending machine with 3 types of drinks, $1 each drink. You have to spend $5.

$ $ | $ $ $ | |{z} | {z } |{z} 2 drink 3 drinks none

p. 30 r-combinations with repetition Pascal’s Triangle

The Binomial Theorem

Combinations with So, there are 5 + (3 1) places that stand for 5 dollars and (3 1) repetition − − Permutations with separators between the drinks’ types. repetition

______$ | $ $ | $ $ $ $ | $ $ $ | $ $ $ $ $ | |

7‹ 7‹ 21 ways to buy 5 drinks 2 = 5 =

p. 31 r-combinations with repetition Pascal’s Triangle

The Binomial Theorem

Combinations with So, there are 5 + (3 1) places that stand for 5 dollars and (3 1) repetition − − Permutations with separators between the drinks’ types. repetition

______$ | $ $ | $ $ $ $ | $ $ $ | $ $ $ $ $ | |

7‹ 7‹ 21 ways to buy 5 drinks 5 = 2 =

p. 32 r-combinations with repetition Pascal’s Triangle

The Binomial Theorem

Combinations with repetition To select r objects out of n with repetitions, there are Permutations with repetition r n 1‹ r n 1‹ + + ways. r − = n −1 − ______* * * * * * | | | |

(r objects and n 1 separator) − In other words, this is the number of r-combinations with repetition from the set of n objects.

p. 33 r-permutations with repetition Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with repetition

We know that the number of r-permutations of n objects without repetition is

n! n(n 1)(n 2) ... (n r + 1) = − − · · − (n r)! − But, if repetitions are allowed, it is even easier, the simple product rule works just fine! r n n ... n = n · · ·

p. 34 Summary Pascal’s Triangle

The Binomial Theorem

Combinations with repetition

Permutations with with repetitions? repetition

n r-combination No r

r+n 1 r+n 1 r-combination Yes r− = n −1 −

n! r- No P(n, r) = (n r)! − r-permutation Yes nr

p. 35