Principle of Inclusion and Exclusion

Slides:



Advertisements
Similar presentations
Inclusion-Exclusion Rosen 6.5 & 6.6
Advertisements

COUNTING AND PROBABILITY
Recursively Defined Functions
Week 21 Basic Set Theory A set is a collection of elements. Use capital letters, A, B, C to denotes sets and small letters a 1, a 2, … to denote the elements.
Copyright © Cengage Learning. All rights reserved.
Lecture 14: Oct 28 Inclusion-Exclusion Principle.
Copyright © Zeph Grunschlag, Counting Techniques Zeph Grunschlag.
Union… The union of two events is denoted if the event that occurs when either or both event occurs. It is denoted as: A or B We can use this concept to.
The Inclusion/Exclusion Rule for Two or Three Sets
Recursive Definitions Rosen, 3.4 Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
Copyright © Cengage Learning. All rights reserved. CHAPTER 9 COUNTING AND PROBABILITY.
Chapter 8 The principle of Inclusion and Exclusion Yen-Liang Chen Dept of Information Management National Central University.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Operations on Sets – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Operations on Sets Reading: Kolman, Section 1.2.
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProbability.
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProbability.
Slide 1 Definition Figures 3-4 and 3-5 Events A and B are disjoint (or mutually exclusive) if they cannot both occur together.
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
Topics to be covered: Produce all combinations and permutations of sets. Calculate the number of combinations and permutations of sets of m items taken.
Discrete Mathematical Structures (Counting Principles)
Counting and Probability. Counting Elements of Sets Theorem. The Inclusion/Exclusion Rule for Two or Three Sets If A, B, and C are finite sets, then N(A.
Binomial Coefficients, Inclusion-exclusion principle
9.3 Addition Rule. The basic rule underlying the calculation of the number of elements in a union or difference or intersection is the addition rule.
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
The Principle of Inclusion-Exclusion
15.1 Inclusion/Exclusion OBJ:  to use the inclusion- exclusion principle to solve counting problems involving intersections and unions of sets.
CS201: Data Structures and Discrete Mathematics I
2.2 Set Operations. The Union DEFINITION 1 Let A and B be sets. The union of the sets A and B, denoted by A U B, is the set that contains those elements.
Counting Techniques. L172 Agenda Section 4.1: Counting Basics Sum Rule Product Rule Inclusion-Exclusion.
3.3 Finding Probability Using Sets. Set Theory Definitions Simple event –Has one outcome –E.g. rolling a die and getting a 4 or pulling one name out of.
1 Section 3.3 Principle of Inclusion and Exclusion.
1 Section 6.5 Inclusion/Exclusion. 2 Finding the number of elements in the union of 2 sets From set theory, we know that the number of elements in the.
Probability theory is the branch of mathematics concerned with analysis of random phenomena. (Encyclopedia Britannica) An experiment: is any action, process.
Spring 2016 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
Week 21 Rules of Probability for all Corollary: The probability of the union of any two events A and B is Proof: … If then, Proof:
2/24/20161 One, two, three, we’re… Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: “How many different 8-letter.
Pigeonhole Principle. If n pigeons fly into m pigeonholes and n > m, then at least one hole must contain two or more pigeons A function from one finite.
Venn Diagrams.
Adding Probabilities 12-5
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
The Pigeonhole Principle
Chapter 7: Counting Principles
Counting by Complement and the Inclusion/Exclusion Principle
Probability Imagine tossing two coins and observing whether 0, 1, or 2 heads are obtained. It would be natural to guess that each of these events occurs.
Copyright © Zeph Grunschlag,
Introduction to Combinatorics
COCS DISCRETE STRUCTURES
What is Probability? Quantification of uncertainty.
Applied Discrete Mathematics Week 7: Probability Theory
The Pigeonhole Principle
9. Counting and Probability 1 Summary
Copyright © Zeph Grunschlag,
Recursively Defined Functions
Copyright © Cengage Learning. All rights reserved.
CS100: Discrete structures
Set, Combinatorics, Probability & Number Theory
Probability Probability underlies statistical inference - the drawing of conclusions from a sample of data. If samples are drawn at random, their characteristics.
COUNTING AND PROBABILITY
COUNTING AND PROBABILITY
Counting Elements of Disjoint Sets: The Addition Rule
The Pigeonhole Principle
Probability General Addition Rule Multiplication Rule
Representations of Integers
Inclusion-Exclusion Principle
Copyright © Zeph Grunschlag,
Copyright © Zeph Grunschlag,
Counting Elements of Disjoint Sets: The Addition Rule
Counting Elements of Disjoint Sets: The Addition Rule
Sets, Combinatorics, Probability, and Number Theory
Presentation transcript:

Principle of Inclusion and Exclusion

Disjoint Sets Universal set S Sets A and B |A  B| = |A| + |B| S: the domain Sets A and B subsets of a universal set S If A and B are disjoint |A  B| = |A| + |B| Example: A={3, 5, 7, 9}, B={2,4,6} What if A and B are not disjoint?

Exercises Exercise 1: A = {1, 3, 5, 7}, B={0,2,4,6,8} How many elements in A  B? 0 B. 8 C. 9 D. not sure How many elements in A  B? 0 B. 2 C. 9 D. not sure Exercise 2: A = {2, 3, 5, 7, 11}, B={1, 3, 5, 7, 9} 10 B. 5 C. 7 D. not sure 0 B. 3 C. 5 D. not sure

Disjoint Sets in A  B and A  B Study the figure relating to two non-disjoint sets A and B Finding Subsets: A-B, B-A, A  B Mutually disjoint A = (A-B)  (A  B), therefore, |A|=|A-B|+|A  B| i.e. |A-B| = |A| - |A  B| Similarly |B-A| = |B|- |A  B| Furthermore, (A-B)  (B-A)  (A  B) is the same as A  B.

Principle of Inclusion & Exclusion For three disjoint sets |(A-B)  (B-A)  (A  B)| = |A-B| + |B-A| + |A  B| We have solved for two finite sets A and B |A-B| = |A| - |A  B| |B-A| = |B|- |A  B| Hence, using this, we get |(A-B)  (B-A)  (A  B)| = |A-B| + |B-A| + |A  B| = |A| - |A  B| + |B| - |A  B| + |A  B| Hence, |A  B| = |A| + |B| - |A  B|

Principle of Inclusion & Exclusion |A  B| = |A| + |B| - |A  B| The above equation represents the principle of inclusion and exclusion for two sets A and B. The name comes from the fact that to calculate the elements in a union, we include the individual elements of A and B but subtract the elements common to A and B so that we don’t count them twice. This principle can be generalized to n sets.

Exercise A = {2, 3, 5, 7, 11,13}, B={1, 3, 5, 7, 9} What is |A  B| + | A  B|? 11 B. 6 C. 5 D. not sure What is |A  B|? 0 B. 3 C. 5 D. not sure What is |A  B| ? 11 B. 8 C. 6 D. 5 E. not sure

Example 1 Example 1: How many integers from 1 to 1000 are either multiples of 3 or multiples of 5? Assume A = set of all integers from 1 to 1000 that are multiples of 3. Assume B = set of all integers from 1 to 1000 that are multiples of 5. A  B = The set of all integers from 1 to 1000 that are multiples of either 3 or 5. A  B = The set of all integers that are both multiples of 3 and 5, which also is the set of integers that are multiples of 15. To use the inclusion/exclusion principle to obtain |A  B|, we need |A|, |B| and |A  B|.

Solution to Example 1 Suggested Solution From 1 to 1000, every third integer is a multiple of 3, each of this multiple can be represented as 3p, for any integer p from 1 through 333, Hence |A| = 333. Similarly for multiples of 5, each multiple of 5 is of the form 5q for some integer q from 1 through 200. Hence, we have |B| = 200. To determine the number of multiples of 15 from 1 through 1000, each multiple of 15 is of the form 15r for some integer r from 1 through 66. Hence, |A  B| = 66. From the principle, we have the number of integers either multiples of 3 or multiples of 5 from 1 to 1000 given by |A  B| = 333 + 200 – 66 = 467.

Example 2: Inclusion/Exclusion for three Sets Example 2: In a class of students undergoing a computer course the following were observed. Out of a total of 50 students: 30 know Java, 18 know C++, 26 know Basic, 9 know both Java and C++, 16 know both Java and Basic, 8 know both C++ and Basic, 47 know at least one of the three languages. From this we have to determine a. How many students know none of these languages? b. How many students know all three languages?

Example2 Solution We know that 47 students know at least one of the three languages in the class of 50. The number of students who do not know any of three languages is given by the difference between the number of students in class and the number of students who know at least one language. Hence, the students who know none of these languages = 50 – 47 = 3. Students know all three languages, so we need to find |A  B  C|. A = All the students who know Java in class. B = All the students who know C++ in the class. C = All the students who know BASIC in class. We have to derive the inclusion/exclusion formula for three sets |A  B  C| = |A  (B  C)| = |A| + |B  C| - |A  (B  C)|

Example2 Solution (Continued) |A  B  C| = |A  (B  C)| = |A| + |B  C| - |A  (B  C)| = |A| + |B| + |C| - |B  C| - |(A  B)  (A  C)| = |A| + |B| + |C| - |B  C| - (|A  B| + |A  C| - |A  B  C|) = |A| + |B| + |C| - |B  C| - |A  B| - |A  C| + |A  B  C| Given in the problem are the following: |B  C| = 8 |A  B| = 9 |A  C| =16 |A  B  C| = 47 Hence, using the above formula, we have 47 = 30 + 26 + 18 -9 -16 -8 + |A  B  C| Hence, |A  B  C| = 6

Pigeonhole Principle Principle Exercises If more than k items are placed into k bins, then at least one bin has more than one item. Exercises At least how many people must be in a room to guarantee that two people have the last name begin with the same initial? A. 2 B. 26 C. 52 D. 27 E. not sure At least how many times must a single die be rolled in order to guarantee getting the same value twice? (note: a die has 6 faces) A. 6 B. 12 C. 2 D. 7 E. not sure