Combinations and State Diagrams Discrete Structures CS 173
Combinations and State Diagrams Discrete Structures (CS 173) Derek Hoiem, University of Illinois 04/16/13 1
HW 9 Do not use the quadratic formula! Review set constructor notation from earlier chapter. Relations between sets that we’ve covered include equals, subset, proper subset, disjoint. 2
Today’s class • Counting and combinations • State diagrams (mainly applied to counting) 3
Combinations/counting • 4
Mixed combination problems Examples • Suppose a slot machine has 6 dials which can each be set to {bell, cherry, 777, blank 1, blank 2} – How many possible (ordered) combinations are there? – How many ways are there to get exactly three cherries? – How many ways are there to get at least three cherries? 8
Dice games When rolling five dice at once, which is more likely, three-of-a-kind or a large-straight? 11
Binomial theorem • 12
Binomial theorem • 13
State diagrams state transition action 14
State diagrams and counting Suppose you have 3 red pills and 2 blue pills in a pouch. You draw three of them from at random. What is the probability that you have exactly one blue pill? 15
Dice games • 16
Challenge problem If Joe is going for “Yahtzee” (five of a kind with five dice), what is the chance that he will get it within two re-rolls? 17
Suppose we roll a two-sided die until the sum is a non-zero multiple of 3. What is the chance of getting there in three or fewer rolls? 18
19
Things to remember • 20
Next class More finite state machines 21
- Slides: 20