{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

09in-exclusion-pig_10_v2

# 09in-exclusion-pig_10_v2 - CSIS1121 Discrete Mathematics...

This preview shows pages 1–7. Sign up to view the full content.

1 CSIS1121 Discrete Mathematics Inclusion and Exclusion Inclusion and Exclusion Pigeon-Hole Principle Pigeon-Hole Principle Prof. Francis Chin, Dr SM Yiu October 14/15, 2010 (Chapter 5.2, 5.5, 7.5, 7.6)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 CSIS1121 Discrete Maths Over Counting Over Counting How many bit strings of length 8 that either start with a 1 bit 1xxxxxxx or end with the two bits 00? xxxxxx00 Number of bit strings starting with 1 = 2 7 = 128. Number of bit strings ending with 00 = 2 6 = 64. Hence, the answer is 128 + 64 = 192. No! What’s wrong? The bit strings 11110000, 10111000, …have been counted twice!
3 CSIS1121 Discrete Maths The Inclusion The Inclusion - - Exclusion Principle Exclusion Principle Let A 1 be the set of ways to do task T 1 and A 2 be the set of ways to do task T 2 . The sets A 1 and A 2 may overlap. Then, the number of ways to do task T 1 or T 2 is | A 1 A 2 | = | A 1 | + | A 2 | - | A 1 A 2 | Note that if the tasks T 1 and T 2 cannot be done in the same way, the above formula is reduced to the Sum Rule. Hence the number of bit strings of length 8 that either start with a 1 bit or end with the two bits 00 is 2 7 + 2 6 – 2 5 = 128 + 64 – 32 = 160 (1xxxxx00) A 1 A 2

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 CSIS1121 Discrete Maths More examples More examples What is the total number of positive integers that is ≤ 100 and is either divisible by 4 or 5? Ans = 100/4 + 100/5 – 100/20 = 40 . Consider all length-4 positive integers which contain only digits 3, 4, 5. How many of them contains at least one 3 and one 5? e.g. 3344 is not included, 4355 is included Total number of length-4 digits containing only 3,4,5
5 CSIS1121 Discrete Maths A B C What is the total number of positive integers that is 100 and is either divisible by 4 or 5 or 3 ? A B |A B| = |A| + |B| - |A B| . |A| + |B| + |C|: Double counted Triple counted |A| + |B| + |C| - |A B| - |B C| - |A C| + |A B C| Ans: 100/4 + 100/5 + 100/3 - 100/20 100/15 100/12 + 100/60 Do you know how to generalize the principle of inclusion-exclusion to n finite sets?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 CSIS1121 Discrete Maths Suppose a student wants to make up a schedule for a 7-day period during which she will study one subject each day. She is taking 4 subject: mathematics, physics, chemistry, and economics. What is the number of possible schedules that devote at least one day to each subject?
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}