Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discrete Math for CS CMPSC 360 LECTURE 27 Last time: Counting.

Similar presentations


Presentation on theme: "Discrete Math for CS CMPSC 360 LECTURE 27 Last time: Counting."— Presentation transcript:

1 Discrete Math for CS CMPSC 360 LECTURE 27 Last time: Counting.
Combinatorial proofs. Today: More counting. Inclusion-Exclusion Principle. CMPSC 360 11/12/2018

2 I-clicker question (frequency: BC)
In a standard deck of 52 cards, how many different ``full house'' poker hands are there? (A full house consists of five cards with three of them having one value and two having a differnt value; the order of cards doesn't matter, so {5♥,5♦, 5♠, Q♥, Q♣} and {5♦,5♥,Q♥, 5♠,  Q♣} are the same full house hand.) 13⋅6⋅6⋅4 13⋅12⋅6⋅4 13 2 ⋅11⋅ 6 2 ⋅2 52 5 None of the above 11/12/2018

3 Inclusion-Exclusion Principle
For any two sets A and B, 𝐴∪𝐵 = 𝐴 + 𝐵 − 𝐴∩𝐵 . Example. A 3-card hand is dealt off of a standard 52-card deck. How many different such hands are there for which all 3 cards are red or all three cards are face cards? (A face card is J,K or Q of any suit.) 11/12/2018

4 Inclusion-Exclusion Principle
For any two sets A and B, 𝐴∪𝐵 = 𝐴 + 𝐵 − 𝐴∩𝐵 . For any three sets A ,B, and C, 𝐴∪𝐵∪𝐶 = 𝐴 + 𝐵 + 𝐶 − 𝐴∩𝐵 − 𝐵∩𝐶 − 𝐴∩𝐶 + 𝐴∩𝐵∩C . Example. How many integers in 1,2,…,100 are divisible by 2, 3 or 5? =103-32=3=68 11/12/2018

5 Inclusion-Exclusion Principle
For any three sets 𝐴 1 , 𝐴 2 ,…, 𝐴 𝑛 , 𝐴 1 ∪ 𝐴 2 ∪…∪ 𝐴 𝑛 = 𝐴 1 |+ 𝐴 2 +…+| 𝐴 𝑛 − 𝐴 1 ∩ 𝐴 2 − 𝐴 2 ∩ 𝐴 3 −…− 𝐴 𝑛−1 ∩ 𝐴 𝑛 + 𝐴 1 ∩ 𝐴 2 ∩ 𝐴 𝐴 1 ∩𝐴 2 ∩ 𝐴 4 +…+ 𝐴 𝑛−2 ∩ 𝐴 𝑛−1 ∩ 𝐴 𝑛 −…+……… ±| 𝐴 1 ∩ 𝐴 2 ∩⋯∩ 𝐴 𝑛 | =103-32=3=68 11/12/2018


Download ppt "Discrete Math for CS CMPSC 360 LECTURE 27 Last time: Counting."

Similar presentations


Ads by Google