09in-exclusion-pig_10

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

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

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

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

View Full Document
CSIS1121 Discrete Maths ver 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. o! What’s wrong? No! What s wrong? he bit strings 11110000, 10111000, …have been 2 The bit strings 11110000, 10111000, …have been counted twice!
CSIS1121 Discrete Maths he clusion xclusion rinciple The The Inclusion Inclusion Exclusion Exclusion Principle Principle Let A be the set of ways to do task T and 1 1 A 2 be the set of ways to do task T 2 . A 1 A 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 =|A +|A A | 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 ith a 1 bit or end with the two bits 00 is 2 7 + 2 6 5 3 with a 1 bit or end with the two bits 00 is 2 2 2 = 128 + 64 – 32 = 160 (1xxxxx00)

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

View Full Document
CSIS1121 Discrete Maths ore examples More examples What is the total number of positive integers that is 100 nd is either divisible by 4 or 5? 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 = 3 4 = 81 3 81. Total number of length-4 digits containing no 3 or no 5 = 2 4 + 2 4 –1±=±31 (4554, 3433, 4444) 4 Ans = 81 – 31 = 50
CSIS1121 Discrete Maths 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| + |C|: ouble counted Double counted Triple counted C |A B| = |A| + |B| - |A B| . |A| + |B| + |C| - |A B| - |B C| - |A C| + |A B C| Ans: 100/4 + 100/5 + 100/3 - 100/20 100/15 00/12 + 00/60 100/12 100/60 Do you know how to generalize the principle of clusion xclusion to n finite sets? 5 inclusion-exclusion to n finite sets?

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

View Full Document
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 ubject: mathematics, physics, chemistry, and economics. What is subject: mathematics, physics, chemistry, and economics. What is the number of possible schedules that devote at least one day to each subject? et A1 be the no of schedules that do not contain math (P1) Let A1 be the no. of schedules that do not contain math (P1). A2 be the no. of schedules that do not contain physics (P2).
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 19

09in-exclusion-pig_10 - CSIS1121 Discrete Mathematics...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online