25 binomial coefficients

29
 1 1 Binomial Coef ficients Binomial Coef ficients CS 202 CS 202 Epp, section ??? Epp, section ???  Aaron Bloomfield  Aaron Bloomfield

Upload: licarnette-pascual-aguilar

Post on 03-Apr-2018

235 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 1/29

  11

Binomial CoefficientsBinomial CoefficientsCS 202CS 202

Epp, section ???Epp, section ??? Aaron Bloomfield Aaron Bloomfield

Page 2: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 2/29

2

Binomial CoefficientsBinomial Coefficients

It allows us to do a quick expansion of (It allows us to do a quick expansion of ( x  x ++y y ))nn

Why it’s really important:Why it’s really important:

It provides a good context to present proofsIt provides a good context to present proofs Especially combinatorial proofsEspecially combinatorial proofs

Page 3: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 3/29

3

LetLet nn andand r r  be non-negative integers withbe non-negative integers with

r r ≤≤ nn. Then. Then C C ((nn,,r r ) =) = C C ((nn,,n-r n-r ))

Or,Or,

Proof (from a previous slide set):Proof (from a previous slide set):

[ ] !)()!(

!),(

r nnr n

nr nnC 

−−−=−

)!(!

!

r nr 

n

−=

)!(!!),(r nr 

nr nC −

=

Review: combinationsReview: combinations

       −=       r n

n

n

Page 4: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 4/29

4

Review: combinatorial proof Review: combinatorial proof 

 A A combinatorial proof combinatorial proof  is a proof that uses countingis a proof that uses countingarguments to prove a theorem, rather than somearguments to prove a theorem, rather than someother method such as algebraic techniquesother method such as algebraic techniques

Essentially, show that both sides of the proof Essentially, show that both sides of the proof manage to count the same objectsmanage to count the same objects Usually in the form of an English explanation withUsually in the form of an English explanation with

supporting formulaesupporting formulae

Page 5: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 5/29

5

Polynomial expansionPolynomial expansion

Consider (Consider ( x  x ++y y ))33::

Rephrase it as:Rephrase it as:

When choosingWhen choosing  x  x  twice andtwice and y y  once, there are C(3,2) =once, there are C(3,2) =C(3,1) = 3 ways to choose where theC(3,1) = 3 ways to choose where the x  x comes fromcomes from

When choosingWhen choosing  x  x  once andonce and y y  twice, there are C(3,2) =twice, there are C(3,2) =

C(3,1) = 3 ways to choose where theC(3,1) = 3 ways to choose where the y y comes fromcomes from

32233 33)( y xy y x x y x +++=+

[ ] [ ]

32222223))()(( y xy xy xy y x y x y x x y x y x y x

+++++++=+++

Page 6: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 6/29

6

Polynomial expansionPolynomial expansion

Consider Consider 

To obtain theTo obtain the x  x 55 termterm Each time you multiple by (Each time you multiple by ( x  x ++y y ), you select the), you select the x  x  Thus, of the 5 choices, you chooseThus, of the 5 choices, you choose x  x 5 times5 times

C(5,5) = 1C(5,5) = 1  Alternatively, you choose Alternatively, you choose y y 0 times0 times

C(5,0) = 1C(5,0) = 1

To obtain theTo obtain the x  x 44y y termterm Four of the times you multiply by (Four of the times you multiply by ( x  x ++y y ), you select the), you select the x  x 

The other time you select theThe other time you select the y y 

Thus, of the 5 choices, you chooseThus, of the 5 choices, you choose x  x 4 times4 timesC(5,4) = 5C(5,4) = 5

 Alternatively, you choose Alternatively, you choose y y 1 time1 timeC(5,1) = 5C(5,1) = 5

To obtain theTo obtain the x  x 33y y 22 termterm C(5,3) = C(5,2) = 10C(5,3) = C(5,2) = 10

Etc…Etc…

543223455 510105)( y xy y x y x y x x y x +++++=+

Page 7: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 7/29

7

Polynomial expansionPolynomial expansion

For (For ( x  x ++y y ))55

543223455

0

5

1

5

2

5

3

5

4

5

5

5)( y xy y x y x y x x y x   

 

  

 +  

 

  

 +  

 

  

 +  

 

  

 +  

 

  

 +  

 

  

 =+

543223455 510105)( y xy y x y x y x x y x +++++=+

Page 8: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 8/29

Page 9: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 9/29

10

ExamplesExamples

What is the coefficient of What is the coefficient of  x  x 1212y y 1313 in (in ( x  x ++y y ))2525??

What is the coefficient of What is the coefficient of  x  x 1212y y 1313 in (2in (2 x  x -3-3y y ))2525?? Rephrase it as (2x+(-3y))Rephrase it as (2x+(-3y))2525

The coefficient occurs whenThe coefficient occurs when j  j =13:=13:

300,200,5!12!13

!25

12

25

13

25==  

 

  

 =  

 

  

 

( ) ∑=

− −   

  

 =−+

25

0

2525)3()2(

25)3(2

 j

 j j  y x j

 y x

00,545,702,433,959,763)3(2!12!13

!25)3(2

13

2513121312 −=−=−  

 

  

 

Page 10: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 10/29

11

Sample questionSample question

Find the coefficient of Find the coefficient of  x  x 55y y 88 in (in ( x  x ++y y ))1313

 Answer: Answer:1287

813

513 =  

  

  =  

  

  

Page 11: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 11/29

12

Pascal’s trianglePascal’s triangle

0

1

2

3

4

5

6

7

8

n =

Page 12: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 12/29

13

Pascal’s IdentityPascal’s Identity

By Pascal’s identity: or 21=15+6By Pascal’s identity: or 21=15+6

LetLet nn andand k k be positive integers withbe positive integers with nn ≥≥ k k ..

ThenThen

or C(or C(nn+1,+1,k k ) = C() = C(nn,,k k -1) + C(-1) + C(nn,,k k ))

We will prove this via two ways:We will prove this via two ways: Combinatorial proof Combinatorial proof  Using the formula for Using the formula for 

    

  +  

  

  

−=  

  

   +

k n

k n

k n

11

    

  +  

  

  =  

  

  

5

6

4

6

5

7

  

 

 

 

 

n

Page 13: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 13/29

14

 Algebraic proof of Pascal’s identity Algebraic proof of Pascal’s identity

   

  

 +  

 

  

 −

=   

  

  +k 

n

n

n

1

1

)!)(1()1(

!)1()!1(

)!(*)1()!1(

k nk nk n

nnn

k nk nk n

−+−=+−+=+

−−+=−+

11 +=+ nn

)!(!

!

))!1(()!1(

!

)!1(!

)!1(

k nk 

n

k nk 

n

k nk 

n

−+

−−−=

−+

+

)!()!1(

!

)!)(1()!1(

!

)!)(1()!1(

!)1(

k nk k 

n

k nk nk 

n

k nk nk k 

nn

−−+

−+−−=

−−+−+

k k nk nk 

n 1

)1(

1

)1(

)1(

++−=−+

+

11 +−+=+ k nk n

)1(

)1(

)1()1(

)1(

+−+−

++−

=−+

+k nk 

k n

k nk 

k nk 

n

Substitutions:

Page 14: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 14/29

15

Pascal’s identity: combinatorial proof Pascal’s identity: combinatorial proof 

Prove C(Prove C(nn+1,+1,k k ) = C() = C(nn,,k k -1) + C(-1) + C(nn,,k k ))

Consider a set T of Consider a set T of nn+1 elements+1 elements We want to choose a subset of We want to choose a subset of k k elementselements We will count the number of subsets of We will count the number of subsets of k k elements via 2 methodselements via 2 methods

Method 1: There are C(Method 1: There are C(nn+1,+1,k k ) ways to choose such a subset) ways to choose such a subset

Method 2: LetMethod 2: Let aa be an element of set Tbe an element of set T

Two casesTwo cases aa is in such a subsetis in such a subset

There are C(There are C(

nn

,,k k -1) ways to choose such a subset-1) ways to choose such a subset

aa is not in such a subsetis not in such a subsetThere are C(There are C(nn,,k k ) ways to choose such a subset) ways to choose such a subset

Thus, there are C(Thus, there are C(nn,,k k -1) + C(-1) + C(nn,,k k ) ways to choose a subset of ) ways to choose a subset of  k k  elementselements

Therefore, C(Therefore, C(nn+1,+1,k k ) = C() = C(nn,,k k -1) + C(-1) + C(nn,,k k ))

Page 15: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 15/29

16

Pascal’s trianglePascal’s triangle

0

1

2

3

4

5

6

7

8

n = 1

2

4

8

16

32

64

128

256

sum = = 2n

Page 16: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 16/29

17

Corollary 1 and algebraic proof Corollary 1 and algebraic proof 

LetLet nn be a non-negative integer. Thenbe a non-negative integer. Then

 Algebraic proof  Algebraic proof 

∑=

=   

  

 n

n

n

0

2

∑=

−    

  =

n

k nk 

k n

0

11

nn )11(2 +=

∑=

  

 

 

 

 =

n

k  k 

n

0

∑=

−   

  

 =+

n

 j

 j jnn  y x j

n y x

0

)(

Page 17: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 17/29

18

Combinatorial proof of corollary 1Combinatorial proof of corollary 1

LetLet nn be a non-negative integer. Thenbe a non-negative integer. Then

Combinatorial proof Combinatorial proof   A set with A set with nn elements has 2elements has 2nn subsetssubsets

By definition of power setBy definition of power set

Each subset has either 0 or 1 or 2 or … or Each subset has either 0 or 1 or 2 or … or nn elementselements

There are subsets with 0 elements, subsets with 1 element,There are subsets with 0 elements, subsets with 1 element,

… and subsets with… and subsets with nn elementselements

Thus, the total number of subsets isThus, the total number of subsets is

Thus,Thus,

∑=

=   

  

 n

n

n

0

2

nn

k  k 

n2

0

=   

  

 ∑=

   

  

 0

n

∑=

   

  

 n

k  k 

n

0

   

  

 1

n

    

  nn

Page 18: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 18/29

19

Pascal’s trianglePascal’s triangle

0

1

2

3

4

5

6

7

8

n =

Page 19: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 19/29

20

LetLet nn be a positive integer. Thenbe a positive integer. Then

 Algebraic proof  Algebraic proof 

This implies thatThis implies that

Proof practice: corollary 2Proof practice: corollary 2

n00 =∑=

=   

  

 −

n

n

0

0)1(

+  

 

 

 

 +  

 

 

 

 +  

 

 

 

 =+  

 

 

 

 +  

 

 

 

 +  

 

 

 

 

531420

nnnnnn

∑=

−−   

  

 =

n

k nk 

n

0

1)1(

( ) n1)1( +−=

k n

k  k 

n

)1(0 −   

 

 

 

=∑=

∑=−

   

  

 =+

n

 j

 j jnn

 y x j

n

 y x0

)(

Page 20: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 20/29

21

Proof practice: corollary 3Proof practice: corollary 3

LetLet nn be a non-negative integer. Thenbe a non-negative integer. Then

 Algebraic proof  Algebraic proof 

∑= −   

  

 =

n

k k n

n

021

∑=

=   

  

 n

nk 

n

0

32

nn )21(3 +=

∑=

   

  

 =

n

n

0

2

Page 21: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 21/29

22

Vandermonde’s identityVandermonde’s identity

LetLet mm,, nn, and, and r r be non-negative integers withbe non-negative integers with r r notnot

exceeding either exceeding either mm or or nn. Then. Then

 Assume a congressional committee must consist of  Assume a congressional committee must consist of r r  people, and there arepeople, and there are nn Democrats andDemocrats and mm 

RepublicansRepublicans How many ways are there to pick the committee?How many ways are there to pick the committee?

∑=

    

      

  

−=  

  

   +

k  k n

k r m

r nm

0

Page 22: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 22/29

23

Combinatorial proof of Combinatorial proof of 

Vandermonde’s identityVandermonde’s identity

Consider two sets, one withConsider two sets, one with mm items and one withitems and one with nn itemsitems Then there are ways to chooseThen there are ways to choose r r items from the union of thoseitems from the union of those

two setstwo sets

Next, we’ll find that value via a different meansNext, we’ll find that value via a different means PickPick k k elements from the set withelements from the set with nn elementselements

Pick the remainingPick the remaining r r --k k elements from the set withelements from the set with mm elementselements

Via the product rule, there are ways to do that for Via the product rule, there are ways to do that for EACHEACH valuevalue

of of k k 

Lastly, consider this for all values of Lastly, consider this for all values of k k ::

Thus,Thus,

∑=

   

  

    

  

 −

=   

  

  + r 

k  k 

n

k r 

m

nm

0

   

  

  +r 

nm

   

  

    

  

 − k 

n

k r 

m

∑=    

  

    

  

 −

k  k 

n

k r 

m

0

Page 23: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 23/29

24

Sample questionSample question

How many bit strings of length 10 contain exactlyHow many bit strings of length 10 contain exactly

four 1’s?four 1’s? Find the positions of the four 1’sFind the positions of the four 1’s

The order of those positions does not matter The order of those positions does not matter Positions 2, 3, 5, 7 is the same as positions 7, 5, 3, 2Positions 2, 3, 5, 7 is the same as positions 7, 5, 3, 2

Thus, the answer is C(10,4) = 210Thus, the answer is C(10,4) = 210

Generalization of this result:Generalization of this result: There are C(There are C(nn,,r r ) possibilities of bit strings of length) possibilities of bit strings of length nn 

containingcontaining r r onesones

Page 24: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 24/29

25

Yet another combinatorial proof Yet another combinatorial proof 

LetLet nn andand r r be non-negative integers withbe non-negative integers with r r ≤≤ nn. Then. Then

We will do the combinatorial proof by showing that bothWe will do the combinatorial proof by showing that bothsides show the ways to count bit strings of lengthsides show the ways to count bit strings of length nn+1 with+1 withr r +1 ones+1 ones

From previous slide: achieves thisFrom previous slide: achieves this

∑=

   

  

 =  

 

  

 ++ n

r  j r 

 j

n

1

1

    

   ++1

1r n

Page 25: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 25/29

26

Yet another combinatorial proof Yet another combinatorial proof 

Next, show the right side counts the same objectsNext, show the right side counts the same objects

The final one must occur at positionThe final one must occur at position r r +1 or +1 or r r +2 or … or +2 or … or nn+1+1

 Assume that it occurs at the Assume that it occurs at the k k thth bit, wherebit, where r r +1 ≤+1 ≤ k k ≤≤ nn+1+1

Thus, there must beThus, there must be r r ones in the firstones in the first k k -1 positions-1 positions Thus, there are such strings of lengthThus, there are such strings of length k k -1-1

 As As k k can be any value fromcan be any value from r r +1 to+1 to nn+1, the total number of +1, the total number of 

possibilities ispossibilities is

Thus,Thus,

   

  

  −r 

k  1

+

+=    

 

 

  −1

1

1n

r k  r 

∑=    

 

 

 

=

n

r k  r 

∑=    

 

 

 

=

n

r  j r 

 j

∑=

   

  

 =  

 

  

 ++ n

r  j r 

 j

n

1

1

Page 26: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 26/29

27

Sample questionSample question

Show that if Show that if  p p is a prime andis a prime and k k  is an integer such thatis an integer such that1 ≤1 ≤ k k ≤≤ p p-1, then-1, then p p dividesdivides

We know thatWe know that

 p p divides the numerator (divides the numerator ( p p!) once only!) once only BecauseBecause p p is prime, it does not have any factors less thanis prime, it does not have any factors less than p p

We need to show that it doesWe need to show that it does NOTNOT divide thedivide thedenominator denominator  Otherwise theOtherwise the p p factor would cancel outfactor would cancel out

SinceSince k k << p p (it was given that k ≤(it was given that k ≤ p p-1),-1), p p cannot dividecannot divide k k !!SinceSince k k  ≥ 1, we know that≥ 1, we know that  p p--k k  <<  p p, and thus, and thus  p p cannotcannotdivide (divide ( p p--k k )!)!

Thus,Thus, p p divides the numerator but not the denominator divides the numerator but not the denominator 

Thus,Thus, p p dividesdivides

   

  

 k 

 p

)!(!

!

k  pk 

 p

 p

−=  

 

  

 

  

 

 

 

 k 

 p

Page 27: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 27/29

28

Sample questionSample question

Give a combinatorial proof that if Give a combinatorial proof that if nn is positive integer thenis positive integer then

Provided hint: show that both sides count the ways to selectProvided hint: show that both sides count the ways to selecta subset of a set of a subset of a set of  nn elements together with two notelements together with two notnecessarily distinct elements from the subsetnecessarily distinct elements from the subset

Following the other provided hint, we express the right sideFollowing the other provided hint, we express the right sideas follows:as follows:

2

0

2 2)1( −

=

+=   

  

 ∑ nn

nnk 

nk 

12

0

2 22)1( −−

=

+−=   

  

 ∑ nnn

nnnk 

nk 

Page 28: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 28/29

29

Sample questionSample question

Show the left side properly counts the desiredShow the left side properly counts the desired

propertyproperty

=   

  

 ∑=

n

k  k 

nk 

0

2

Choosing a subset of k  elements from a set of 

n elements

Consider each

of the possible

subset sizes k 

Choosing one of 

the k elements in

the subset twice

Page 29: 25 Binomial Coefficients

7/28/2019 25 Binomial Coefficients

http://slidepdf.com/reader/full/25-binomial-coefficients 29/29

30

Sample questionSample question

Two cases to show the right side:Two cases to show the right side: nn((n-n-1)21)2n-n-22++nn22nn-1-1

Pick the same element from the subsetPick the same element from the subsetPick that one element from the set of Pick that one element from the set of nn elements: total of elements: total of nn possibilitiespossibilities

Pick the rest of the subsetPick the rest of the subset  As there are As there are nn-1 elements left, there are a total of 2-1 elements left, there are a total of 2 nn-1-1 possibilities to pick a givenpossibilities to pick a given

subsetsubset

We have to do bothWe have to do both Thus, by the product rule, the total possibilities is the product of the twoThus, by the product rule, the total possibilities is the product of the two Thus, the total possibilities isThus, the total possibilities is nn*2*2nn-1-1

Pick different elements from the subsetPick different elements from the subsetPick the first element from the set of Pick the first element from the set of nn elements: total of elements: total of nn possibilitiespossibilities

Pick the next element from the set of Pick the next element from the set of nn-1 elements: total of -1 elements: total of nn-1 possibilities-1 possibilities

Pick the rest of the subsetPick the rest of the subset

 As there are As there are nn-2 elements left, there are a total of 2-2 elements left, there are a total of 2nn-2-2

possibilities to pick a givenpossibilities to pick a givensubsetsubset

We have to do all threeWe have to do all three Thus, by the product rule, the total possibilities is the product of the threeThus, by the product rule, the total possibilities is the product of the three Thus, the total possibilities isThus, the total possibilities is nn*(n-1)*2*(n-1)*2nn-2-2

We do one or the other We do one or the other Thus, via the sum rule, the total possibilities is the sum of the twoThus, via the sum rule, the total possibilities is the sum of the two

OrOr nn*2*2nn-1-1

++nn*(n-1)*2*(n-1)*2nn-2-2