binomial coefficients

29
1 Binomial Binomial Coefficients Coefficients CS 202 CS 202 Epp, section ??? Epp, section ??? Aaron Bloomfield Aaron Bloomfield

Upload: briar-thomas

Post on 30-Dec-2015

94 views

Category:

Documents


4 download

DESCRIPTION

Binomial Coefficients. CS 202 Epp, section ??? Aaron Bloomfield. Binomial Coefficients. It allows us to do a quick expansion of ( x + y ) n Why it’s really important: It provides a good context to present proofs Especially combinatorial proofs. Review: combinations. - PowerPoint PPT Presentation

TRANSCRIPT

11

Binomial CoefficientsBinomial CoefficientsCS 202CS 202

Epp, section ???Epp, section ???

Aaron BloomfieldAaron Bloomfield

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 proofsIt provides a good context to present proofs Especially combinatorial proofsEspecially combinatorial proofs

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 a previous slide set):Proof (from a previous slide set):

! )()!(

!),(

rnnrn

nrnnC

)!(!

!

rnr

n

)!(!

!),(

rnr

nrnC

Review: combinationsReview: combinations

rn

n

r

n

44

Review: combinatorial proofReview: combinatorial proof

A A combinatorial proofcombinatorial proof is a proof that uses counting is a proof that uses counting arguments to prove a theorem, rather than some arguments to prove a theorem, rather than some other 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 with Usually in the form of an English explanation with

supporting formulaesupporting formulae

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 C(3,2) = once, there are C(3,2) = C(3,1) = 3 ways to choose where the C(3,1) = 3 ways to choose where the xx comes from comes fromWhen choosing When choosing xx once and once and yy twice, there are C(3,2) = twice, there are C(3,2) = C(3,1) = 3 ways to choose where the C(3,1) = 3 ways to choose where the yy comes from comes from

32233 33)( yxyyxxyx

32222223))()(( yxyxyxyyxyxyxxyxyxyx

66

Polynomial expansionPolynomial expansion

ConsiderConsider

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) = 1

To 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 xx

The 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 times

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

C(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

77

Polynomial expansionPolynomial expansion

For (For (xx++yy))55

543223455

0

5

1

5

2

5

3

5

4

5

5

5)( yxyyxyxyxxyx

543223455 510105)( yxyyxyxyxxyx

88

Polynomial expansion: Polynomial expansion: The binomial theoremThe binomial theorem

For (For (xx++yy))nn

nnnnn yxn

yxn

yxn

nyx

n

nyx 011110

011)(

n

j

jjn yxj

n

0

nnnn yxn

nyx

n

nyx

nyx

n 011110

110

1010

ExamplesExamples

What 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

!25

12

25

13

25

25

0

2525 )3()2(25

)3(2j

jj yxj

yx

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

!25)3(2

13

25 13121312

1111

Sample questionSample question

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

Answer: Answer: 1287

8

13

5

13

1212

Pascal’s trianglePascal’s triangle

0

1

2

3

4

5

6

7

8

n =

1313

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

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

k

n

k

n

k

n

1

1

5

6

4

6

5

7

k

n

1414

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

k

n

k

n

k

n

1

1

)!)(1()1(

!)1()!1(

)!(*)1()!1(

knknkn

nnn

knknkn

11 nn

)!(!

!

))!1(()!1(

!

)!1(!

)!1(

knk

n

knk

n

knk

n

)!()!1(

!

)!)(1()!1(

!

)!)(1()!1(

!)1(

knkk

n

knknk

n

knknkk

nn

kknknk

n 1

)1(

1

)1(

)1(

11 knkn

)1(

)1(

)1()1(

)1(

knk

kn

knk

k

knk

n

Substitutions:

1515

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

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 subsetThere 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 subsetThere are C(There are C(nn,,kk) ways to choose such a subset) ways to choose such a subset

Thus, 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))

1616

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

1717

Corollary 1 and algebraic proofCorollary 1 and algebraic proof

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

Algebraic proofAlgebraic proof

n

k

n

k

n

0

2

n

k

knk

k

n

0

11

nn )11(2

n

k k

n

0

n

j

jjnn yxj

nyx

0

)(

1818

Combinatorial proof of corollary 1Combinatorial proof of 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 elementsThere 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 elements elements

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

n

k

n

k

n

0

2

nn

k k

n2

0

0

n

n

k k

n

0

1

n

n

n

1919

Pascal’s trianglePascal’s triangle0

1

2

3

4

5

6

7

8

n =

2020

Let Let nn be a positive integer. Then be a positive integer. Then

Algebraic proofAlgebraic proof

This implies that This implies that

Proof practice: corollary 2Proof practice: corollary 2

n00

n

k

k

k

n

0

0)1(

531420

nnnnnn

n

k

knk

k

n

0

1)1(

n1)1(

kn

k k

n)1(

0

n

j

jjnn yxj

nyx

0

)(

2121

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

k

n

0

21

n

k

nk

k

n

0

32

nn )21(3

n

k

k

k

n

0

2

2222

Vandermonde’s identityVandermonde’s identity

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

Assume a congressional committee must consist of Assume a congressional committee must consist of rr people, and there are people, and there are nn Democrats and Democrats and mm RepublicansRepublicans How many ways are there to pick the committee?How many ways are there to pick the committee?

r

k k

n

kr

m

r

nm

0

2323

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 items items Then there are ways to choose Then there are ways to choose rr items from the union of those items 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 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 value

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

Thus, Thus,

r

k k

n

kr

m

r

nm

0

r

nm

k

n

kr

m

r

k k

n

kr

m

0

2424

Sample questionSample question

How many bit strings of length 10 contain exactly How 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 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

2525

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. Then. Then

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

From previous slide: achieves thisFrom previous slide: achieves this

n

rj r

j

r

n

1

1

1

1

r

n

2626

Yet another combinatorial proofYet 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 position The final one must occur at position rr+1 or +1 or rr+2 or … or +2 or … or nn+1+1

Assume 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 Thus, there must be rr ones in the first 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 of +1, the total number of possibilities is possibilities is

Thus, Thus,

r

k 1

1

1

1n

rk r

k

n

rk r

k

n

rj r

j

n

rj r

j

r

n

1

1

2727

Sample questionSample question

Show 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 pp

We 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 out

Since 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

k

p

)!(!

!

kpk

p

k

p

k

p

2828

Sample questionSample question

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

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

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

2

0

2 2)1(

nn

k

nnk

nk

12

0

2 22)1(

nnn

k

nnnk

nk

2929

Sample questionSample question

Show the left side properly counts the desired Show 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

3030

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