1 / 39

Polynomials Count!

Great Theoretical Ideas In Computer Science. Polynomials Count!. X 1. X 2. +. +. X 3. Lecture 9. CS 15-251. Review: the binomial formula. Review: The multinomial formula. Representation: Understand the relationship between different representations of the same information or idea.

freira
Télécharger la présentation

Polynomials Count!

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Great Theoretical Ideas In Computer Science Polynomials Count! • X1 • X2 • + • + • X3 Lecture9 CS 15-251

  2. Review: the binomial formula

  3. Review: The multinomial formula

  4. Representation:Understand the relationship between different representations of the same information or idea 1 2 3

  5. The binomial formula gives two representations of the same function: “Closed form” or “Generating form” or “Generating function” “Power series” (“Taylor series”) expansion

  6. Let x=1. We find that The number of subsets of an n-element set By playing these two representations against each other we obtain a new representation of a previous insight: There are 2n subsets of an n element set.

  7. By by setting x to –1 we obtain a new insight: Let x= -1. We find that …or equivalently, that The number of even sized subsets of an n element set is the same as the number of odd sized subsets.

  8. More odds and evens Let On be the set of`binary strings of length n with an odd number of ones. Let En be the set of`binary strings of length n with an even number of ones. We have just presented an algebraic proof that On= En An elegant combinatorial proof can be had by putting Onand Enin one-to-one correspondence. The correspondence principle says that if two sets can be placed in one-to-one correspondence, then they are the same size!

  9. An attempt at a correspondence Let fn be the function that takes an n-bit string and flips all its bits. ...but do even n work? In f6 we have 110011  001100 101010  010101 Uh oh. Complementing maps evens to evens! fn is clearly a one-to-one and onto function for odd n. E.g. in f7 we have 0010011  1101100 1001101  0110010

  10. A correspondence that works for all n Let fn be the function that takes an n-bit string and flips only the first bit. For example, 0010011  1010011 1001101  0001101 110011  010011 101010  001010 Check: 1. fn: OnEn? 2. fn is one-to-one? i.e.x  y  fn (x)  fn (y) 3. fn is onto? i.e.for all y  En, there exists an x  On such that fn (x)=y

  11. What is the coefficient of BA3N2 in the expansion of (B + A + N)6? Keeping counts in coefficients The number of ways to rearrange the letters in the word BANANA.

  12. How many integer solutions to the following equations? kitems            n -1 breakpoints ///////

  13. We obtain xkfor each way of choosing a power of x from each of n expressions in such a way that the exponents sum to k, i.e., once for each solution to

  14. The # of solutions to The coefficient of xk in(1-x)-n =

  15. The fact that the manipulation of polynomial equations can encode the same theorems that are proved by combinatorial reasoning is very significant! Never underestimate the insights encoded into the coefficients of a polynomial!

  16. Recall the Fibonacci sequence

  17. How did I do that?

  18. You could give the generating function to a good calculus student and ask for the power series expansion. Using the method of partial fractions, the student would discover:

  19. The “method of generating functions” is so powerful that it can solve: • Most recurrences • Most sums • Most of the neat math facts that we have ever seen Generating-Functionology by Herbert S. Wilf (Academic Press) Is HIGHLY recommended!

  20. Getting to know the binomial coefficients… Three binomial identities we that have seen: 1. 2. 3.

  21. By convention: (empty product = 1)

  22. An important identity:

  23. How to count pathways Meandering in a nameless modern metropolis Scenario: You’re in a city where all the streets, numbered 0 through x, run north-south, and all the avenues, numbered 0 through y, run east-west. How many [sensible] ways are there to walk from the corner of 0th St. and 0th avenue to the opposite corner of the city? 0 x y 0

  24. Meandering in a nameless modern metropolis • All paths require exactly x+y steps: • x steps east, y steps north • Counting paths is the same as counting which of the x+y steps are northward steps: (i,j) 0 x y 1 Now, what if we add the constraint that the path must go through a certain intersection, call it (i,j)? 0

  25. An important identity for binomial coefficients Graphical intuition: Let n=x+y be the total steps needed in the city walk problem, and let k=y be the number of northward steps. There are two cases for the very last step taken.

  26. 0 k’th Avenue 0 3 4 2 1 . . . . Level n 1 . . . . . . . 2 . . . . . . . . . . 3 . . . . . . . . . . . . . . . 4 . . . . . . . . . . . . . . . . . . Manhattan

  27. . . . . . k’th Avenue 1 . . . . . level n 1 1 . . . . . 2 1 1 . . . . . 3 3 1 1 . . . . . 4 1 6 1 4 1 1 5 5 10 10 6 6 15 15 20

  28. . . . . . k’th Avenue 1 . . . . . level n 1 1 . . . . . 2 1 1 . . . . . 3 3 1 1 . . . . . 4 1 6 1 4 1 1 5 5 10 10 6 6 15 15 20

  29. . . . . . k’th Avenue 1 . . . . . level n 1 1 . . . . . 2 1 1 . . . . . 3 3 1 1 . . . . . 4 1 6 1 4 1 1 5 5 10 10 6 6 15 15 20

  30. . . . . . k’th Avenue 1 . . . . . level n 1 1 . . . . . 2 1 1 . . . . . 3 3 1 1 . . . . . 4 1 6 1 4 1 1 5 5 10 10 6 6 15 15 20

  31. “Pascal’s Triangle” Chu Shin-Chieh 1303 The Precious Mirror of the Four Elements . . . Known in Europe by 1529 Blaise Pascal 1654

  32. Pascal’s Triangle 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 “It is extraordinary how fertile in properties the triangle is. everyone can try his hand.”

  33. Summing the rows… gives us powers of 2 1 1 + 1 1 + 2 + 1 1 + 3 + 3 + 1 1 + 4 + 6 + 4 + 1 1 + 5 + 10 + 10 + 5 + 1 1 + 6 + 15 + 20 + 15 + 6 + 1 =1 =2 =4 =8 =16 =32 =64

  34. 6+20+6 = 1+15+15+1 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1

  35. Summing the diagonals… yields Little Gauss’s formula and more! 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1

  36. 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 =2 =3 =5 =8 =13

  37. 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 2 2 2 2 2 2 2

  38. Application:

More Related