Counting III: Pascal’s Triangle, Polynomials, and Vector ProgramsSlide 2Choice tree for terms of (1+X)3The Binomial FormulaSlide 5One polynomial, two representationsSlide 9Multinomial CoefficientsThe Multinomial FormulaPower Series RepresentationSlide 14Slide 15Slide 16Slide 17Slide 18A Combinatorial ProofAn attempt at a correspondenceA correspondence that works for all nSlide 22Slide 23Pascal’s Triangle: kth row are the coefficients of (1+X)kkth Row Of Pascal’s Triangle:Inductive definition of kth entry of nth row: Pascal(n,0) = Pascal (n,n) = 1; Pascal(n,k) = Pascal(n-1,k-1) + Pascal(n-1,k)Slide 27Pascal’s TriangleSlide 29Slide 30Slide 31Slide 32Slide 33Slide 34Slide 35Slide 36Slide 37How many shortest routes from A to B?ManhattanSlide 40Slide 41Slide 42Slide 43Slide 44Slide 45Slide 46Slide 47Slide 48Vector ProgramsSlide 50Slide 51Slide 52Slide 53Slide 54Programs -----> PolynomialsFormal Power SeriesV! = < a0, a1, a2, . . . >Slide 58Slide 59Slide 60The Geometric SeriesThe Infinite Geometric SeriesSlide 63Geometric Series (Linear Form)Geometric Series (Quadratic Form)Suppose we multiply this out to get a single, infinite polynomial. What is an expression for Cn?cn = a0bn + a1bn-1 +… aibn-i… + an-1b1 + anb0If a = b then cn = (n+1)(an) a0bn + a1bn-1 +… aibn-i… + an-1b1 + anb0Slide 69if a b then cn = a0bn + a1bn-1 +… aibn-i… + an-1b1 + anb0Geometric Series (Quadratic Form)Slide 72Counting III: Pascal’s Triangle, Polynomials, and Vector ProgramsGreat Theoretical Ideas In Computer ScienceJohn Lafferty CS 15-251 Fall 2006Lecture 8 Sept 21, 2006 Carnegie Mellon University X1 X2 + + X3Last time, we saw thatPolynomials Count!1 X 1 X1 X 1 X1 X1 X1 XChoice tree for terms of (1+X)31XXX2XX2X2X3Combine like terms to get 1 + 3X + 3X2 + X3The Binomial Formula(1 X) FHGIKJFHGIKJFHGIKJ FHGIKJ FHGIKJn k nn nXnXnkXnnX0 1 22... ...binomial expressionBinomial Coefficients0(1 )nn kknx xk The Binomial Formula0(1 )nn kknx xk One polynomial, two representations“Product form” or“Generating form”“Additive form” or“Expanded form”What is the coefficient of BA3N2 in the expansion of(B + A + N)6?The number of ways to rearrange the letters in the word BANANA.Multinomial Coefficientsnk; n- knkFHGIKJFHGIKJnr ;r ;...;r0 if r r ... r n n!r !r !...r !1 2k1 21 2kkFHGIKJRS||T|| The Multinomial Formula( )����� �����ik, ,r =n3 k1 221kn21rrrr321kr r ...,r21kX +X +...+ Xn= X X X ...Xr ;r ;...;r00(1 )nn kkkknx xknxk=�=��+ = �������= �������“Closed form” or“Generating form”“Power series” (“Taylor series”) expansionSince 0 if nk nk Power Series RepresentationBy playing these two representations againsteach other we obtain a new representation ofa previous insight:00(1 )2nn kknnknx xknk 1 2 3Let x=1. The number ofThe number ofsubsets of an subsets of an nn-element set-element set001 even odd(1 )0 ( 1)2nn kknkkn nnk knx xknkn nk k Let x= -1. Equivalently, By varying x, we can discover new identities001 even odd(1 )0 ( 1)2nn kknkkn nnk knx xknkn nk k Let x= -1. Equivalently, The number of even-sized subsets of an n element set is the same as the number of odd-sized subsets.Proofs that work by manipulating algebraic forms are called “algebraic” arguments. Proofs that build a 1-1 onto correspondence are called “combinatorial” arguments.0(1 )nn kknx xk=��+ = ������Let Let OOnn be the set of binary strings of be the set of binary strings of length length nn with an with an oddodd number of ones. number of ones.Let Let EEnn be the set of binary strings of be the set of binary strings of length length nn with an with an even even number of ones.number of ones.We gave an We gave an algebraicalgebraic proof that proof that OOn n = = E Enn 1 even odd2n nnk kn nk k-�� ��= =�� ���� ��� �A Combinatorial ProofLet Let OOnn be the set of binary strings of length be the set of binary strings of length nn with an with an oddodd number of ones. number of ones.Let Let EEnn be the set of binary strings of length be the set of binary strings of length nn with an with an even even number of ones.number of ones.A A combinatorialcombinatorial proof must construct a proof must construct a one-one-to-one correspondence to-one correspondence betweenbetween OOn n and and EEn nAn attempt at a correspondenceLet fn be the function that takes an n-bit string and flips all its bits....but do even n work? In f6 we have110011 001100101010 010101Uh oh. Complementing maps evens to evens!fn is clearly a one-to-one and onto function for odd n. E.g. in f7 we have0010011 11011001001101 0110010A correspondence that works for all nLet Let ffnn be the function that takes an be the function that takes an n-bit string and flips only n-bit string and flips only the first bitthe first bit..For example,For example,0010011 0010011 1010011 10100111001101 1001101 0001101 0001101110011 110011 010011 010011101010 101010 001010 001010The binomial coefficients have so many representations that many fundamental mathematical identities emerge…0(1 )nn kknx xk=��+ = ������The Binomial Formula(1+X)1 =(1+X)0 =(1+X)2 =(1+X)3 =11 + 1X1 + 2X + 1X21 + 3X + 3X2 + 1X3(1+X)4 =1 + 4X + 6X2 + 4X3 + 1X4Pascal’s Triangle:kth row are the coefficients of (1+X)k(1+X)1 =(1+X)0 =(1+X)2 =(1+X)3 =11 + 1X1 + 2X + 1X21 + 3X + 3X2 + 1X3(1+X)4 =1 + 4X + 6X2 + 4X3 + 1X4kth Row Of Pascal’s Triangle:(1+X)1 =(1+X)0 =(1+X)2 =(1+X)3 =11 + 1X1 + 2X + 1X21 + 3X + 3X2 + 1X3(1+X)4 =1 + 4X + 6X2 + 4X3 + 1X4, , ,..., ,...0 1 2n n n n nk n������ �� �������� �� �������� �� ��Inductive definition of kth entry of nth row:Pascal(n,0) = Pascal (n,n) = 1; Pascal(n,k) = Pascal(n-1,k-1) + Pascal(n-1,k)(1+X)1 =(1+X)0 =(1+X)2 =(1+X)3 =11 + 1X1 + 2X + 1X21 + 3X + 3X2
View Full Document