35
1 Binomial Binomial Coefficients Coefficients CS/APMA 202 CS/APMA 202 Rosen section 4.4 Rosen section 4.4 Aaron Bloomfield Aaron Bloomfield

1506 binomial-coefficients

Embed Size (px)

Citation preview

Page 1: 1506 binomial-coefficients

11

Binomial CoefficientsBinomial CoefficientsCS/APMA 202CS/APMA 202

Rosen section 4.4Rosen section 4.4Aaron BloomfieldAaron Bloomfield

Page 2: 1506 binomial-coefficients

22

Binomial CoefficientsBinomial Coefficients

It allows us to do a quick expansion of It allows us to do a quick expansion of ((xx++yy))nn

Why it’s really important:Why it’s really important:It provides a good context to present It provides a good context to present proofsproofs Especially combinatorial proofsEspecially combinatorial proofs

Page 3: 1506 binomial-coefficients

33

Let Let nn and and rr be non-negative integers with be non-negative integers with rr ≤ ≤ nn. Then . Then CC((nn,,rr) = ) = CC((nn,,n-rn-r))Or, Or,

Proof (from last slide set):Proof (from last slide set):

! )()!(!),(

rnnrnnrnnC

)!(!!rnr

n

)!(!!),(rnr

nrnC

Review: corollary 1 Review: corollary 1 from section 4.3from section 4.3

rnn

rn

Page 4: 1506 binomial-coefficients

44

Review: combinatorial proofReview: combinatorial proof

A A combinatorial proofcombinatorial proof is a proof that uses is a proof that uses counting arguments to prove a theorem, counting arguments to prove a theorem, rather than some other method such as rather than some other method such as algebraic techniquesalgebraic techniques

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

with supporting formulaewith supporting formulae

Page 5: 1506 binomial-coefficients

55

Polynomial expansionPolynomial expansion

Consider (Consider (xx++yy))33::Rephrase it as:Rephrase it as:

When choosing When choosing xx twice and twice and yy once, there are once, there are C(3,2) = C(3,1) = 3 ways to choose where the C(3,2) = C(3,1) = 3 ways to choose where the xx comes fromcomes fromWhen choosing When choosing xx once and once and yy twice, there are twice, there are C(3,2) = C(3,1) = 3 ways to choose where the C(3,2) = C(3,1) = 3 ways to choose where the yy comes fromcomes from

32233 33)( yxyyxxyx

32222223))()(( yxyxyxyyxyxyxxyxyxyx

Page 6: 1506 binomial-coefficients

66

Polynomial expansionPolynomial expansionConsiderConsider

To obtain the To obtain the xx55 term term Each time you multiple by (Each time you multiple by (xx++yy), you select the ), you select the xx Thus, of the 5 choices, you choose Thus, of the 5 choices, you choose xx 5 times 5 times

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

C(5,0) = 1C(5,0) = 1To obtain the To obtain the xx44yy term term

Four of the times you multiply by (Four of the times you multiply by (xx++yy), you select the ), you select the xxThe other time you select the The other time you select the yy

Thus, of the 5 choices, you choose Thus, of the 5 choices, you choose xx 4 times 4 timesC(5,4) = 5C(5,4) = 5

Alternatively, you choose Alternatively, you choose yy 1 time 1 timeC(5,1) = 5C(5,1) = 5

To obtain the To obtain the xx33yy22 term term C(5,3) = C(5,2) = 10C(5,3) = C(5,2) = 10

Etc…Etc…

543223455 510105)( yxyyxyxyxxyx

Page 7: 1506 binomial-coefficients

77

Polynomial expansionPolynomial expansion

For (For (xx++yy))55

543223455

05

15

25

35

45

55

)( yxyyxyxyxxyx

543223455 510105)( yxyyxyxyxxyx

Page 8: 1506 binomial-coefficients

88

Polynomial expansion: Polynomial expansion: The binomial theoremThe binomial theorem

For (For (xx++yy))nn

The book calls this Theorem 1The book calls this Theorem 1

nnnnn yxn

yxn

yxnn

yxnn

yx 011110

011)(

n

j

jjn yxjn

0

nnnn yxnn

yxnn

yxn

yxn 011110

110

Page 9: 1506 binomial-coefficients

99

ExamplesExamplesWhat is the coefficient of What is the coefficient of xx1212yy1313 in ( in (xx++yy))2525??

What is the coefficient of What is the coefficient of xx1212yy1313 in (2 in (2xx-3-3yy))2525?? Rephrase it as (2x+(-3y))Rephrase it as (2x+(-3y))2525

The coefficient occurs when The coefficient occurs when jj=13:=13:

300,200,5!12!13

!251225

1325

25

0

2525 )3()2(25

)3(2j

jj yxj

yx

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

!25)3(21325 13121312

Page 10: 1506 binomial-coefficients

1010

Rosen, section 4.4, question 4Rosen, section 4.4, question 4

Find the coefficient of Find the coefficient of xx55yy88 in ( in (xx++yy))1313

Answer: Answer: 1287

813

513

Page 11: 1506 binomial-coefficients

1111

Pascal’s trianglePascal’s triangle0

1

2

3

4

5

6

7

8

n =

Page 12: 1506 binomial-coefficients

1212

Pascal’s IdentityPascal’s Identity

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

Let Let nn and and kk be positive integers with be positive integers with nn ≥≥ kk. . ThenThen

or C(or C(nn+1,+1,kk) = C() = C(nn,,kk-1) + C(-1) + C(nn,,kk))The book calls this Theorem 2The book calls this Theorem 2We will prove this via two ways:We will prove this via two ways: Combinatorial proofCombinatorial proof Using the formula forUsing the formula for

kn

kn

kn

11

56

46

57

kn

Page 13: 1506 binomial-coefficients

1313

Combinatorial proof of Pascal’s Combinatorial proof of Pascal’s identityidentity

Prove C(Prove C(nn+1,+1,kk) = C() = C(nn,,kk-1) + C(-1) + C(nn,,kk) ) 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 kk elements elements We will count the number of subsets of We will count the number of subsets of kk elements via 2 methods elements via 2 methods

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

Method 2: Let Method 2: Let aa be an element of set T be an element of set TTwo casesTwo cases aa is in such a subset is in such a subset

There are C(There are C(nn,,kk-1) ways to choose such a subset-1) ways to choose such a subset aa is not in such a subset is not in such a subset

There are C(There are C(nn,,kk) ways to choose such a subset) ways to choose such a subsetThus, there are C(Thus, there are C(nn,,kk-1) + C(-1) + C(nn,,kk) ways to choose a subset of ) ways to choose a subset of kk elementselements

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

Page 14: 1506 binomial-coefficients

1414

Rosen, section 4.4, question 19: Rosen, section 4.4, question 19: algebraic proof of Pascal’s identityalgebraic proof of Pascal’s identity

kn

kn

kn

11

)!)(1()1(!)1()!1(

)!(*)1()!1(

knknknnnn

knknkn

11 nn

)!(!!

))!1(()!1(!

)!1(!)!1(

knkn

knkn

knkn

)!()!1(!

)!)(1()!1(!

)!)(1()!1(!)1(

knkkn

knknkn

knknkknn

kknknkn 1

)1(1

)1()1(

11 knkn)1(

)1()1()1(

)1(

knkkn

knkk

knkn

Substitutions:

Page 15: 1506 binomial-coefficients

1515

Privacy policyPrivacy policy From time to time, in order to improve Google From time to time, in order to improve Google

Gulp's usefulness for our users, Google Gulp will Gulp's usefulness for our users, Google Gulp will send packets of data related to your usage of this send packets of data related to your usage of this product from a wireless transmitter embedded in product from a wireless transmitter embedded in the base of your Google Gulp bottle to the the base of your Google Gulp bottle to the GulpPlex™, a heavily guarded, massively parallel GulpPlex™, a heavily guarded, massively parallel server farm whose location is known only to Eric server farm whose location is known only to Eric Schmidt, who carries its GPS coordinates on a 64-Schmidt, who carries its GPS coordinates on a 64-bit-encrypted smart card locked in a stainless-bit-encrypted smart card locked in a stainless-steel briefcase handcuffed to his right wrist. No steel briefcase handcuffed to his right wrist. No personally identifiable information of any kind personally identifiable information of any kind related to your consumption of Google Gulp or related to your consumption of Google Gulp or any other current or future Google Foods product any other current or future Google Foods product will ever be given, sold, bartered, auctioned off, will ever be given, sold, bartered, auctioned off, tossed into a late-night poker pot, or otherwise tossed into a late-night poker pot, or otherwise transferred in any way to any untrustworthy third transferred in any way to any untrustworthy third party, ever, we swear. See our Privacy Policy.party, ever, we swear. See our Privacy Policy.

April Fools Day JokesApril Fools Day Jokes

http://www.google.com/googlegulp/(or do a Google search for ‘gulp’)

Page 16: 1506 binomial-coefficients

1616

Pascal’s trianglePascal’s triangle0

1

2

3

4

5

6

7

8

n = 1

2

4

8

16

32

64

128

256

sum = = 2n

Page 17: 1506 binomial-coefficients

1717

Proof practice: corollary 1Proof practice: corollary 1

Let Let nn be a non-negative integer. Then be a non-negative integer. Then

Algebraic proofAlgebraic proof

n

k

n

kn

0

2

n

k

knk

kn

0

11

nn )11(2

n

k kn

0

n

j

jjnn yxjn

yx0

)(

Page 18: 1506 binomial-coefficients

1818

Proof practice: corollary 1Proof practice: corollary 1

Let Let nn be a non-negative integer. Then be a non-negative integer. Then

Combinatorial proofCombinatorial proof A set with A set with nn elements has 2 elements has 2nn subsets subsets

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 elements elements

There are subsets with 0 elements, subsets with 1 There are subsets with 0 elements, subsets with 1 element, … and subsets with element, … and subsets with nn elements elements

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

n

k

n

kn

0

2

nn

k kn

20

0n

n

k kn

0

1n

nn

Page 19: 1506 binomial-coefficients

2020

Pascal’s trianglePascal’s triangle0

1

2

3

4

5

6

7

8

n =

Page 20: 1506 binomial-coefficients

2121

Proof practice: corollary 2Proof practice: corollary 2

Let Let nn be a positive integer. Then be a positive integer. ThenAlgebraic proofAlgebraic proof

This implies that This implies that

n00

n

k

k

kn

0

0)1(

531420nnnnnn

n

k

knk

kn

0

1)1(

n1)1(

kn

k kn

)1(0

Page 21: 1506 binomial-coefficients

2222

Proof practice: corollary 3Proof practice: corollary 3

Let Let nn be a non-negative integer. Then be a non-negative integer. Then

Algebraic proofAlgebraic proof

n

k

kkn

kn

0

21

n

k

nk

kn

0

32

nn )21(3

n

k

k

kn

0

2

Page 22: 1506 binomial-coefficients

2323

Vandermonde’s identityVandermonde’s identity

Let Let mm, , nn, and , and rr be non-negative integers be non-negative integers with with rr not exceeding either not exceeding either mm or or nn. Then. Then

The book calls this Theorem 3The book calls this Theorem 3

r

k kn

krm

rnm

0

Page 23: 1506 binomial-coefficients

2424

Combinatorial proof of Combinatorial proof of Vandermonde’s identityVandermonde’s identity

Consider two sets, one with Consider two sets, one with mm items and one with items and one with nn itemsitems

Then there are ways to choose Then there are ways to choose rr items from the union of items from the union of those two setsthose two sets

Next, we’ll find that value via a different meansNext, we’ll find that value via a different means Pick Pick kk elements from the set with elements from the set with nn elements elements Pick the remaining Pick the remaining rr--kk elements from the set with elements from the set with mm elements elements Via the product rule, there are ways to do that for Via the product rule, there are ways to do that for EACHEACH

value of value of kk Lastly, consider this for all values of Lastly, consider this for all values of kk::

Thus, Thus,

r

k kn

krm

rnm

0

rnm

k

nkrm

r

k kn

krm

0

Page 24: 1506 binomial-coefficients

2525

Review of Rosen, section Review of Rosen, section 4.3, question 11 (a)4.3, question 11 (a)

How many bit strings of length 10 contain How many bit strings of length 10 contain exactly four 1’s?exactly 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 matterThe 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,,rr) possibilities of bit strings of length ) possibilities of bit strings of length nn

containing containing rr ones ones

Page 25: 1506 binomial-coefficients

2626

Yet another combinatorial proofYet another combinatorial proof

Let Let nn and and rr be non-negative integers with be non-negative integers with rr ≤ ≤ nn. . ThenThen

The book calls this Theorem 4The book calls this Theorem 4

We will do the combinatorial proof by showing We will do the combinatorial proof by showing that both sides show the ways to count bit that both sides show the ways to count bit strings of length strings of length nn+1 with +1 with rr+1 ones+1 ones

From previous slide: achieves thisFrom previous slide: achieves this

n

rj rj

rn

11

11

rn

Page 26: 1506 binomial-coefficients

2727

Yet another combinatorial proofYet another combinatorial proofNext, show the right side counts the same objectsNext, show the right side counts the same objectsThe final one must occur at position The final one must occur at position rr+1 or +1 or rr+2 or … or +2 or … or nn+1+1Assume that it occurs at the Assume that it occurs at the kkthth bit, where bit, where rr+1 ≤ +1 ≤ kk ≤ ≤ nn+1+1

Thus, there must be r ones in the first Thus, there must be r ones in the first kk-1 positions-1 positions Thus, there are such strings of length Thus, there are such strings of length kk-1-1

As As kk can be any value from can be any value from rr+1 to +1 to nn+1, the total number +1, the total number of possibilities is of possibilities is

Thus, Thus,

rk 1

1

1

1n

rk rk

n

rk rk

n

rj rj

n

rj rj

rn

11

Page 27: 1506 binomial-coefficients

2828

Rosen, section 4.4, question 24Rosen, section 4.4, question 24Show that if Show that if pp is a prime and is a prime and kk is an integer such that is an integer such that 1 ≤ 1 ≤ kk ≤ ≤ pp-1, then -1, then pp divides divides

We know that We know that pp divides the numerator ( divides the numerator (pp!) once only!) once only

Because Because pp is prime, it does not have any factors less than is prime, it does not have any factors less than ppWe need to show that it does We need to show that it does NOTNOT divide the divide the denominatordenominator

Otherwise the Otherwise the pp factor would cancel out factor would cancel outSince Since kk < < pp (it was given that k ≤ (it was given that k ≤ pp-1), -1), pp cannot divide cannot divide kk!!Since Since kk ≥ 1, we know that ≥ 1, we know that pp--kk < < pp, and thus , and thus pp cannot cannot divide (divide (pp--kk)!)!Thus, Thus, pp divides the numerator but not the denominator divides the numerator but not the denominatorThus, Thus, pp divides divides

kp

)!(!!kpk

pkp

kp

Page 28: 1506 binomial-coefficients

2929

Rosen, section 4.4, question 38Rosen, section 4.4, question 38

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

Provided hint: show that both sides count the Provided hint: show that both sides count the ways to select a subset of a set of ways to select a subset of a set of nn elements elements together with two not necessarily distinct together with two not necessarily distinct elements from the subsetelements from the subset

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

2

0

2 2)1(

nn

k

nnkn

k

12

0

2 22)1(

nnn

k

nnnkn

k

Page 29: 1506 binomial-coefficients

3030

Rosen, section 4.4, question 38Rosen, section 4.4, question 38

Show the left side properly counts the Show the left side properly counts the desired propertydesired property

n

k kn

k0

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 30: 1506 binomial-coefficients

3131

Rosen, section 4.4, question 38Rosen, section 4.4, question 38Two 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 possibilities possibilitiesPick 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 2nn-1-1 possibilities to pick a given possibilities 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 is Thus, 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 possibilities possibilitiesPick 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 possibilitiesPick 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 given possibilities to pick a given subsetsubset

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 is Thus, the total possibilities is nn*(n-1)*2*(n-1)*2nn-2-2

We do one or the otherWe do one or the otherThus, 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 twoOr Or nn*2*2nn-1-1++nn*(n-1)*2*(n-1)*2nn-2-2

Page 31: 1506 binomial-coefficients

32

Quick surveyQuick survey I felt I understood the material in this I felt I understood the material in this

slide set…slide set…a)a) Very wellVery wellb)b) With some review, I’ll be goodWith some review, I’ll be goodc)c) Not reallyNot reallyd)d) Not at allNot at all

Page 32: 1506 binomial-coefficients

33

Quick surveyQuick survey The pace of the lecture for this The pace of the lecture for this

slide set was…slide set was…a)a) FastFastb)b) About rightAbout rightc)c) A little slowA little slowd)d) Too slowToo slow

Page 33: 1506 binomial-coefficients

34

Quick surveyQuick survey How interesting was the material How interesting was the material

in this slide set? Be honest!in this slide set? Be honest!a)a) Wow! That was SOOOOOO cool!Wow! That was SOOOOOO cool!b)b) Somewhat interestingSomewhat interestingc)c) Rather bortingRather bortingd)d) ZzzzzzzzzzzZzzzzzzzzzz

Page 34: 1506 binomial-coefficients

3535

Becoming an IEEE authorBecoming an IEEE author

Page 35: 1506 binomial-coefficients

3636