Transcript

Binomial Theorem.Combinations with repetition.

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 2

Permutations and combinationsGiven a set with n elements.

The number of permutations of the elements the set:

P(n) = n!= n · (n− 1) · (n− 2) · . . . · 1

The number of r-permutations of the set:

P(n, r) =n!

(n− r)!= n · (n− 1) · (n− 2) · . . . · (n− r + 1)︸ ︷︷ ︸

product of r numbers

The number of unordered r-combinations (“n choose r”):�

nr

=P(n, r)P(r)

=n!

(n− r)! r!

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 3

What are the properties of �nr

�?How does

�nr

change with r?

00

=0!

0! 0!= 1.

10

=1!

1! 0!= 1,

11

=1!

0! 1!= 1.

20

=2!

2! 0!= 1,

21

=2!

1! 1!= 2,

22

=2!

0! 2!= 1.

30

=3!

3! 0!= 1,

31

=3!

2! 1!= 3,

32

=3!

1! 2!= 3,

33

=3!

0! 3!= 1.

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 4

Pascal’s Triangle

00

10

� �

11

20

� �

21

� �

22

30

� �

31

� �

32

� �

33

40

� �

41

� �

42

� �

43

� �

44

50

� �

51

� �

52

� �

53

� �

54

� �

55

1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 5

Pascal’s TriangleThe numbers in Pascal’s Triangle are the coefficients of the polyno-mials of the form (x + y)n:

(x + y)0 = 1

(x + y)1 = 1x + 1y

(x + y)2 = 1x2 + 2x y + 1y2

(x + y)3 = 1x3 + 3x2 y + 3x y2 + 1y3

(x + y)4 = 1x4 + 4x3 y + 6x2 y2 + 4x y3 + 1y4

(x + y)n =�

n0

· xn +�

n1

· xn−1 y +�

n2

· xn−2 y2 + . . .+�

nn

· yn.

(x + y)n =n∑

k=0

nk

xn−k yk

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 6

Pascal’s TriangleThe numbers in Pascal’s Triangle are the coefficients of the polyno-mials of the form (x + y)n:

(x + y)0 = 1

(x + y)1 = 1x + 1y

(x + y)2 = 1x2 + 2x y + 1y2

(x + y)3 = 1x3 + 3x2 y + 3x y2 + 1y3

(x + y)4 = 1x4 + 4x3 y + 6x2 y2 + 4x y3 + 1y4

(x + y)n =�

n0

· xn +�

n1

· xn−1 y +�

n2

· xn−2 y2 + . . .+�

nn

· yn.

(x + y)n =n∑

k=0

nk

xn−k yk

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 7

Pascal’s TriangleThe numbers in Pascal’s Triangle are the coefficients of the polyno-mials of the form (x + y)n:

(x + y)0 = 1

(x + y)1 = 1x + 1y

(x + y)2 = 1x2 + 2x y + 1y2

(x + y)3 = 1x3 + 3x2 y + 3x y2 + 1y3

(x + y)4 = 1x4 + 4x3 y + 6x2 y2 + 4x y3 + 1y4

(x + y)n =�

n0

· xn +�

n1

· xn−1 y +�

n2

· xn−2 y2 + . . .+�

nn

· yn.

(x + y)n =n∑

k=0

nk

xn−k yk

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 8

Pascal’s TriangleThe numbers in Pascal’s Triangle are the coefficients of the polyno-mials of the form (x + y)n:

(x + y)0 = 1

(x + y)1 = 1x + 1y

(x + y)2 = 1x2 + 2x y + 1y2

(x + y)3 = 1x3 + 3x2 y + 3x y2 + 1y3

(x + y)4 = 1x4 + 4x3 y + 6x2 y2 + 4x y3 + 1y4

(x + y)n =�

n0

· xn +�

n1

· xn−1 y +�

n2

· xn−2 y2 + . . .+�

nn

· yn.

(x + y)n =n∑

k=0

nk

xn−k yk

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 9

Coefficients of (x + y)n

Let’s prove

(x + y)n =�

n0

· xn +�

n1

· xn−1 y +�

n2

· xn−2 y2 + . . .+�

nn

· yn.

Example:

(x + y)3 =(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

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

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 10

Coefficients of (x + y)n

(x + y)n =(x + y) · (x + y) · . . . · (x + y)︸ ︷︷ ︸

n times

= ?

What is happening when we multiply (x + y) n times?

We get the sum of

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 11

Coefficients of (x + y)n

(x + y)n =(x + y) · (x + y) · . . . · (x + y)︸ ︷︷ ︸

n times

= ?

What is happening when we multiply (x + y) n times?

We get the sum of

x x x x x . . . x+yx x x x . . . x+xyx x x . . . x+yyx x x . . . x+x xyx x . . . x+. . .+y y y y y . . . y

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 12

Coefficients of (x + y)n

(x + y)n =(x + y) · (x + y) · . . . · (x + y)︸ ︷︷ ︸

n times

=

x · x · . . . · x︸ ︷︷ ︸

=xn

+

(x · . . . · x︸ ︷︷ ︸

=xn−1

) · y + . . .+ y · (x · . . . · x)+

(x · . . . · x︸ ︷︷ ︸

=xn−2

) · (y · y) + . . .+ (y · y) · (x · . . . · x︸ ︷︷ ︸

=xn−2

)+

. . .+y · y · . . . · y︸ ︷︷ ︸

=yn

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 13

Coefficients of (x + y)n

(x + y)n =(x + y) · (x + y) · . . . · (x + y)︸ ︷︷ ︸

n times

=

1 · xn +

n · xn−1 y +�

n2

· xn−2 y2 +

. . . +1 · yn

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 14

The Binomial Theorem

(x + y)n =(x + y) · (x + y) · . . . · (x + y)︸ ︷︷ ︸

n times

=

n0

· xn +�

n1

· xn−1 y +�

n2

· xn−2 y2 + . . .+�

nn

· yn.

Shorter notation for the same thing:

(x + y)n =n∑

k=0

nk

xn−k yk.

This result is called The Binomial Theorem, and this is why the co-efficients,

�nk

, are also called the binomial coefficients.

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 15

The Binomial Theorem

Let’s prove that�

n0

+�

n1

+ . . .+�

nn

= 2n.

(1+ 1)n =n∑

k=0

nk

1n−k1k =n∑

k=0

nk

· 1=n∑

k=0

nk

.

Therefore,n∑

k=0

nk

= 2n.

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 16

The Binomial Theorem

Let’s prove that�

n0

+�

n1

+ . . .+�

nn

= 2n.

(1+ 1)n =n∑

k=0

nk

1n−k1k =n∑

k=0

nk

· 1=n∑

k=0

nk

.

Therefore,n∑

k=0

nk

= 2n.

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 17

The Binomial Theorem�

n0

+�

n1

+ . . .+�

nn

= 2n.

Results like this are not very obvious.

Recall that�

nk

=n!

(n− k)! k!

So,n!

n! 0!+

n!(n− 1)! 1!

+n!

(n− 2)! 2!+ . . .+

n!0! n!

= 2n.

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)

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 18

The Binomial Theorem

Using the binomial theorem

(x + y)n =n∑

k=0

nk

xn−k yk,

prove that

n∑

k=0

2k�

nk

=

n0

+ 2�

n1

+ 22�

n2

+ . . .+ 2n�

nn

= 3n.

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 19

Counting routes

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

�5+33

.

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 20

Counting routes

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

�5+33

.

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 21

Pascal’s Triangle Again

00

10

� �

11

20

� �

21

� �

22

30

� �

31

� �

32

� �

33

40

� �

41

� �

42

� �

43

� �

44

50

� �

51

� �

52

� �

53

� �

54

� �

55

1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 22

Pascal’s Identity

n+ 1k

=�

nk− 1

+�

nk

Every number in Pascal’s triangle is equal to the sum of the twonumbers that are immediately above.

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 23

Another Identity

Prove that for r ≤ n and r ≤ m:

m+ nr

=r∑

k=0

mr − k

��

nk

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 24

Vandermonde’s IdentityProve that for r ≤ n and r ≤ m:

m+ nr

=r∑

k=0

mr − k

��

nk

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

k subset of size m subset of size n

0 choose r choose none1 choose r − 1 choose 12 choose r − 2 choose 2. . .r choose 0 choose r

mr

��

n0

+�

mr − 1

��

n1

+

+�

mr − 2

��

n2

+ . . .+�

m0

��

nr

=r∑

k=0

mr − k

��

nk

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 25

r-combinations without repetition

Recall that without repetitions, this is�n

r

.

For example, you have n books, but don’t have time to read all ofthem, and have to select only r books to read.

In how many ways can you do so?�

nr

=n!

(n− r)! r!

There are�n

r

ways to make the choice.

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 26

r-combinations with repetition

There is a vending machine with 3 types of drinks, $1 each drink.

You have to spend $5.

| $ | $ | $ | $ | $ |

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 27

r-combinations with repetition

There is a vending machine with 3 types of drinks, $1 each drink.

You have to spend $5.

| $ | $ | $ | $ | $ |

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 28

r-combinations with repetition

There is a vending machine with 3 types of drinks, $1 each drink.

You have to spend $5.

$︸︷︷︸

1 drink

| $ $︸︷︷︸

2 drinks

| $ $︸︷︷︸

2 drinks

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 29

r-combinations with repetition

There is a vending machine with 3 types of drinks, $1 each drink.

You have to spend $5.

| $ | $ | $ | $ | $ |

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 30

r-combinations with repetition

There is a vending machine with 3 types of drinks, $1 each drink.

You have to spend $5.

$ $︸︷︷︸

2 drink

| $ $ $︸ ︷︷ ︸

3 drinks

|︸︷︷︸

none

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 31

r-combinations with repetition

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

_ _ _ _ _ _ _

$ | $ $ | $ $

$ $ | $ $ $ |

$ $ $ $ $ | |�

72

=�

75

= 21 ways to buy 5 drinks

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 32

r-combinations with repetition

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

_ _ _ _ _ _ _

$ | $ $ | $ $

$ $ | $ $ $ |

$ $ $ $ $ | |�

75

=�

72

= 21 ways to buy 5 drinks

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 33

r-combinations with repetition

To select r objects out of n with repetitions, there are�

r + n− 1r

=�

r + n− 1n− 1

ways.

_ _ _ _ _ _ _ _ _ _

* * * * * * | | | |

(r objects and n− 1 separator)

In other words, this is the number of r-combinations with repetitionfrom the set of n objects.

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 34

r-permutations with repetition

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

n(n− 1)(n− 2) · . . . · (n− r + 1) =n!

(n− r)!

But, if repetitions are allowed, it is even easier, the simple productrule works just fine!

n · n · . . . · n= nr

Pascal’s TriangleThe BinomialTheoremCombinations withrepetitionPermutations withrepetition

p. 35

Summary

with repetitions?

r-combination No�n

r

r-combination Yes�r+n−1

r

=�r+n−1

n−1

r-permutation No P(n, r) =n!

(n− r)!

r-permutation Yes nr