Mathematics for Computer Science MIT 6 042 J18
- Slides: 35
Mathematics for Computer Science MIT 6. 042 J/18. 062 J Combinatorics II Copyright © Radhika Nagpal, 2002. Prof. Albert Meyer & Dr. Radhika Nagpal April 1, 2002 1
Last Week: Counting I • Sets – Bijections, Sum Rule, Inclusion. Exclusion, Product Rule • Pigeonhole Principle • Permutations • Tree Diagrams April 1, 2002 2
This Week: Counting II • • Division Rule Combinations (binomial coefficients) Binomial Theorem and Identities Permutations with limited repetition (multinomial coefficients) • Combinations with repetition (stars and bars) April 1, 2002 3
The Real Agenda: Poker • How many different hands could I get, if I played 5 -card draw? April 1, 2002 4
The Real Agenda: Poker • How many different hands could I get, if I played 5 -card draw? (52) (51) (50) (49) (48) April 1, 2002 5
The Real Agenda: Poker • How many different hands could I get, if I played 5 -card draw? (52) (51) (50) (49) (48) r-permutation, P(52, 5) April 1, 2002 6
Problem: Over-counting • These two hands are the same: April 1, 2002 7
Problem: Over-counting • These two hands are the same: April 1, 2002 8
Problem: Over-counting • These two hands are the same: • In fact any permutation of these cards is the same hand (order is irrelevant) April 1, 2002 9
Number of 5 -card Hands • How much have we over-counted? April 1, 2002 10
Number of 5 -card Hands • How much have we over-counted? • Over-counted EVERY HAND by 5! April 1, 2002 11
Number of 5 -card Hands • How much have we over-counted? • Over-counted EVERY HAND by 5! …… April 1, 2002 12
Number of 5 -card Hands • How much have we over-counted? • Over-counted EVERY HAND by 5! Still approximately 2. 5 million possible hands …… April 1, 2002 13
Combinations • C(n, r) = number of different subsets of size r from a set with n elements. C(n, r) = P(n, r) / r! April 1, 2002 14
Combinations • C(n, r) = P(n, r)/r! = April 1, 2002 15
Combinations • C(n, r) = P(n, r)/r! = April 1, 2002 16
Combinations • C(n, r) = P(n, r)/r! = April 1, 2002 17
Combinations • C(n, r) = P(n, r)/r! = April 1, 2002 18
Poker: Gambling Table Straight Flush > Four-of-a-kind > Full House > Flush > Straight > Three-of-a-kind > Two pair > One pair > No pair April 1, 2002 19
Poker: Four-of-a-kind • Card: value (13) + suit (4) • Four-of-a-kind – 4 cards with the same value – 1 with a different value EXAMPLE: 9 s 9 d 9 c 9 h 5 h April 1, 2002 20
Poker: Four-of-a-kind 1 2 3. . 11 (jack) 12 (queen) 13 (king) 2 spades 2 clubs 2 hearts 2 diamonds. . K hearts K diamonds April 1, 2002 21
Poker: Four-of-a-kind 1 2 3. . 11 (jack) 12 (queen) 13 (king) Four-of-a-kind = 2 spades 2 clubs 2 hearts 2 diamonds. . K hearts K diamonds . 48 = 624 April 1, 2002 22
Poker: Full House • Full House 9 s 9 c 9 d 5 s 5 c = choose value for the triple + choose 3 suits + choose value for pair + choose 2 suits April 1, 2002 23
In-class Problem 1: Each table should write their solution on their whiteboard. April 1, 2002 24
Incorrect Counting Argument • Two pair = • Every hand is counted twice – 44775 – 77445 April 1, 2002 25
Correct Counting Arguments 1. Divide the Theory Pig’s estimate by 2 2. Choose the values of the two pairs together 2 -pair = April 1, 2002 26
Division Rule • If set B over-counts every element of A by k times then, |B| = k |A| April 1, 2002 27
Permutations vs Combinations • Combinations: subsets of size r, – order does not matter • Permutations: strings of length r, – order of elements does matter. April 1, 2002 28
Calculating Permutations and Combinations • Closely related: C(n, r) = P(n, r) / r! • C(n, r) = count all r-permutations, every combination is over-counted by r! • P(n, r) = choose r items, then take all permutations of the items April 1, 2002 29
Counting Powerset of A P(A) = set of all subsets of A • A = {a, b} • P(A) = {{}, {a}, {b}, {a, b}} April 1, 2002 30
Counting P(A) • Bijection : P(A) and binary strings of length |A| A = {a 1 a 2 a 3 a 4 a 5……an} Binary String = 1 0 1 0…. . 0 Subset of A = {a 1, a 3, a 5} | P(A) | = 2 n April 1, 2002 31
Counting P(A) • |P(A)| = = subsets + subsets…. . subsets of size 0 of size 1 of size 2 of size n April 1, 2002 32
Counting P(A) • |P(A)| = = subsets + subsets…. . subsets of size 0 of size 1 of size 2 of size n Identity: April 1, 2002 33
Poker: Gambling Table Straight Flush = 40 Four-of-a-kind = 624 Full house = 3744 Flush = 5148 Straight = 10240 Three-of-a-kind = 54, 912 Two pair =123, 552 One pair = 1, 098, 240 No pair = 1, 317, 388 April 1, 2002 34
In-class Problems April 1, 2002 35
- S/2005 j18
- Mathematics for computer science mit
- Mathematics for computer science mit
- Mathematics for computer science mit
- 042 area code
- 042-68-4425
- Mmt-042
- Mmt-042
- Pad-042
- Tsr-042
- Dori-042
- Vegard law
- Pad-042
- It is my favourite subject
- Mathematics
- International journal of science and mathematics education
- Rowan college of science and mathematics
- Formuö
- Typiska novell drag
- Nationell inriktning för artificiell intelligens
- Ekologiskt fotavtryck
- Varför kallas perioden 1918-1939 för mellankrigstiden?
- En lathund för arbete med kontinuitetshantering
- Särskild löneskatt för pensionskostnader
- Tidböcker
- Anatomi organ reproduksi
- Vad är densitet
- Datorkunskap för nybörjare
- Boverket ka
- Tes debattartikel
- Delegerande ledarskap
- Nyckelkompetenser för livslångt lärande
- Påbyggnader för flakfordon
- Kraft per area
- Offentlig förvaltning
- I gullregnens månad