1 / 30

CS 173: Discrete Mathematical Structures

CS 173: Discrete Mathematical Structures. Cinda Heeren heeren@cs.uiuc.edu Siebel Center, rm 2213 Office Hours: M 11a-12p. CS 173 Announcements. Homework 8 available. Due 10/31, 8a. Midterm 2 11/9, 7-9p. Email me with conflicts. P(17,10) = 17x16x15x14x13x12x11. CS173 Permutations.

cybil
Download Presentation

CS 173: Discrete Mathematical Structures

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. CS 173:Discrete Mathematical Structures Cinda Heeren heeren@cs.uiuc.edu Siebel Center, rm 2213 Office Hours: M 11a-12p

  2. CS 173 Announcements • Homework 8 available. Due 10/31, 8a. • Midterm 2 11/9, 7-9p. Email me with conflicts. Cs173 - Spring 2004

  3. P(17,10) = 17x16x15x14x13x12x11 CS173 Permutations Suppose you have time to listen to 10 songs on your daily jog around campus. There are 6 Cake tunes, 8 Moby tunes, and 3 Eagles tunes to choose from. How many different jog playlists can you make? Cs173 - Spring 2004

  4. P(6,4) x P(8,4) x P(3,2) CS173 Permutations Suppose you have time to listen to 10 songs on your daily jog around campus. There are 6 Cake tunes, 8 Moby tunes, and 3 Eagles tunes to choose from. Now suppose you want to listen to 4 Cake, 4 Moby, and 2 Eagles tunes, in that band order. How many playlists can you make? Cs173 - Spring 2004

  5. P(6,4) x P(8,4) x P(3,2) x 3! CS173 Permutations Suppose you have time to listen to 10 songs on your daily jog around campus. There are 6 Cake tunes, 8 Moby tunes, and 3 Eagles tunes to choose from. Finally, suppose you still want 4 Cake, 4 Moby, and 2 Eagles tunes, and the order of the groups doesn’t matter, but you get dizzy and fall down if all the songs by any one group aren’t played together. How many playlists are there now? Cs173 - Spring 2004

  6. M2 M4 M5 M1 M3 5! X P(6,3) CS173 Permutations In how many ways can 5 distinct Martians and 3 distinct Jovians stand in line, if no two Jovians stand together? Cs173 - Spring 2004

  7. CS173 Combinations A combination is an unordered selection of elements from some set. The number of combinations of r distinct objects chosen from n distinct objects is denoted by C(n,r) or nCr or , and is read “n choose r.” C(n,r) = P(n,r)/r! = n!/((n-r)!r!) Cs173 - Spring 2004

  8. C(12,5) P(12,5) = C(12,5) x 5! CS173Combinations A basketball squad consists of 12 players, 5 of which make up a team. How many different teams of players can you make from the 12? What’s the diff? In a running race of 12 sprinters, each of the top 5 finishers receives a different medal. How many ways are there to award the 5 medals? Cs173 - Spring 2004

  9. CS173 Combinations A committee of 8 students is to be selected from a class consisting of 19 frosh, and 34 soph. In how many ways can 3 frosh and 5 soph be selected? Cs173 - Spring 2004

  10. CS173 Combinations A committee of 8 students is to be selected from a class consisting of 19 frosh, and 34 soph. In how many ways can a committee with exactly 1 frosh be selected? Cs173 - Spring 2004

  11. CS173 Combinations A committee of 8 students is to be selected from a class consisting of 19 frosh, and 34 soph. In how many ways can a committee with at most 1 frosh be selected? Cs173 - Spring 2004

  12. CS173 Combinations A committee of 8 students is to be selected from a class consisting of 19 frosh, and 34 soph. In how many ways can a committee with at least 1 frosh be selected? Cs173 - Spring 2004

  13. Why am I showing this to you? • Beautiful patterns • Recursive defn • New type of proof • Applications in more complex counting techniques CS 173 Binomial Coefficients (a + b)2 = a2 + 2ab + b2 (a + b)3 = a3 + 3ab2 + 3a2b + b3 (a + b)4 = a4 + 4ab3 + 6a2b2 + 4a3b + b4 Cs173 - Spring 2004

  14. What is coefficient of a9b3 in (a + b)12? • 36 • 220 • 15 • 6 • No clue CS 173 Binomial Coefficients (a + b)2 = a2 + 2ab + b2 (a + b)3 = a3 + 3a2b + 3ab2 + b3 (a + b)4 = a4 + 4a3b + 6a2b2 + 4ab3 + b4 Cs173 - Spring 2004

  15. = a4 + a3b + a2b2 + ab3 + b4 Binomial Theorem: Let x and y be variables, and let n be any nonnegative integer. Then CS 173 Binomial Coefficients (a + b)4 = (a + b)(a + b)(a + b)(a + b) Cs173 - Spring 2004

  16. Binomial Theorem: Let x and y be variables, and let n be any nonnegative integer. Then 17 9 3a 2b CS 173 Binomial Coefficients What is the coefficient of a8b9 in the expansion of (3a +2b)17? What is n? What is j? What is x? Cs173 - Spring 2004 What is y?

  17. = a4 + a3b + a2b2 + ab3 + b4 • 10C6 • 9C4 • 9C5 • 8C4 + 8C5 • No clue CS 173 Binomial Coefficients (a + b)4 = (a + b)(a + b)(a + b)(a + b) Cs173 - Spring 2004

  18. Powers of 2 2n nC0 nC1 nC2 CS 173 Binomial Coefficients Sum each row of Pascal’s Triangle: Two proofs that Suppose you have a set of size n. How many subsets does it have? How many subsets of size 0 does it have? How many subsets of size 1 does it have? How many subsets of size 2 does it have? Cs173 - Spring 2004 Count all subsets in this way, and we have the result!

  19. Powers of 2 Done CS 173 Binomial Coefficients Sum each row of Pascal’s Triangle: Two proofs that Let x=1 and y=1 in Binomial Theorem. Cs173 - Spring 2004

  20. n-1Cj-1 n-1Cj CS 173 Pascal’s Identity A relationship between the entries in Pascal’s . Suppose T is a set, |T|=n. Let a be an element in T, and let S = T - {a}. Let’s count the nCj subsets of size j. Note that some of these contain a, and some don’t. How many contain a? How many don’t? Cs173 - Spring 2004

  21. A m items B n items This is an exampleof a combinatorial proof. We describe the set counted by the LHS and RHS of the eqn, and argue that they count the same thing. Look in Rosen. CS 173 Vandermonde’s Identity Let m, n, and r be nonnegative integers with r not exceeding either m or n. Then To choose r items, take some from A and some from B. All possible ways of doing this gives the result. Cs173 - Spring 2004

  22. CS 173 Combinations with repetition Suppose you want to buy 5 bags of chips from the 3 kinds you like at Meijer. In how many different ways can you stock up? Out of 7 items, we are choosing 2 to be bars. From that, and our understanding of the model, we can report the answer. Cs173 - Spring 2004

  23. Example: How many solutions are there to the equation When the variables are nonnegative integers? 13C3 CS 173 Combinations with repetition There are n+r-1Cr, r-sized combinations from a set of n elements when repetition is allowed. Cs173 - Spring 2004

  24. 6 3 CS 173 Permutations with indistinguishable objects How many different strings can be made from the letters in the word rat? How many different strings can be made from the letters in the word egg? Cs173 - Spring 2004

  25. 8C4, now 4 spots are left 4C2, now 2 spots are left 2C2, now 0 spots are left CS 173 Permutations with indistinguishable objects How many different strings can be made from the letters in the phrase nano-nano? Key thoughts: 8 positions, 3 kinds of letters to place. In how many ways can we place the ns? In how many ways can we place the as? In how many ways can we place the os? Cs173 - Spring 2004

  26. CS 173 Permutations with indistinguishable objects How many distinct permutations are there of the letters in the word APALACHICOLA? How many if the two Ls must appear together? How many if the first letter must be an A? Cs173 - Spring 2004

  27. CS 173 A little practice A turtle begins at the upper left corner of an n x m grid and meanders to the lower right corner. How many routes could she take if she only moves right and down? Cs173 - Spring 2004

  28. CS 173 A little practice A turtle begins at the upper left corner of a m x n grid and meanders to the lower right corner. How many routes could she take if she only moves right and down, and if she must pass through the dot at point (a,b)? Cs173 - Spring 2004

  29. CS 173 A little practice In how many ways can 11 identical computer science books and 8 identical psychology books be distributed among 5 students? Hint: forget about the psychology books for the moment. Hint: how can you combine your soln for the CS books with your soln for the Psych books? Cs173 - Spring 2004

  30. CS 173 A little practice In an RNA chain of 20 bases, there are 4 As, 5 Us, 6 Gs, and 5Cs. If the chain begins either AC or UG, how many such chains are there? Let A denote the set of chains beginning with AC, and U denote the set of chains beginning with UG. Count them separately, and then sum. First find |A|: 18 bases, 3 As, 5 Us, 6 Gs, and 4Cs. (This is like the MISSISSIPPI problem.) |A| = 18!/(3!5!6!4!) Cs173 - Spring 2004

More Related