Inclusion-Exclusion Formula

Slides:



Advertisements
Similar presentations
Applications of Inclusion-Exclusion: Selected Exercises.
Advertisements

7.6 Applications of Inclusion/Exclusion Problem: Find the number of elements in a set that have none of n properties P1, P2,.. Pn.
4/16/2015 MATH 224 – Discrete Mathematics Counting Basic counting techniques are important in many aspects of computer science. For example, consider the.
EQ: What are compound events?
EXAMPLE 1 Construct a probability distribution Let X be a random variable that represents the sum when two six-sided dice are rolled. Make a table and.
Counting Techniques: Combinations
Counting and Probability The outcome of a random process is sure to occur, but impossible to predict. Examples: fair coin tossing, rolling a pair of dice,
Generalized Derangements Anthony Fraticelli Missouri State University REUJuly 30, 2009 Advisor: Dr. Les Reid.
CSE115/ENGR160 Discrete Mathematics 04/17/12
CSE115/ENGR160 Discrete Mathematics 04/21/11 Ming-Hsuan Yang UC Merced 1.
Lecture 14: Oct 28 Inclusion-Exclusion Principle.
1 Discrete Math CS 280 Prof. Bart Selman Module Probability --- Part a) Introduction.
1 Section 5.1 Discrete Probability. 2 LaPlace’s definition of probability Number of successful outcomes divided by the number of possible outcomes This.
Counting Elements in a List How many integers in the list from 1 to 10? How many integers in the list from m to n? (assuming m
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.
4.4.2 Combinations of multisets
Arithmetic Sequences A sequence in which each term after the first is obtained by adding a fixed number to the previous term is an arithmetic sequence.
Counting and Probability Sets and Counting Permutations & Combinations Probability.
Combinatorics 3/15 and 3/ Counting A restaurant offers the following menu: Main CourseVegetablesBeverage BeefPotatoesMilk HamGreen BeansCoffee.
Copyright © 2007 Pearson Education, Inc. Slide 8-1.
1 9/23/2015 MATH 224 – Discrete Mathematics Basic finite probability is given by the formula, where |E| is the number of events and |S| is the total number.
Chapter 6 The Inclusion-Exclusion Principle and Applications
Counting. Techniques for counting Rule 1 Suppose we carry out have a sets A 1, A 2, A 3, … and that any pair are mutually exclusive (i.e. A 1  A 2 =
College Algebra Sixth Edition James Stewart Lothar Redlin Saleem Watson.
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.
Slide 7- 1 Copyright © 2006 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
15.3 Counting Methods: Combinations ©2002 by R. Villar All Rights Reserved.
4.5.2 Applications of Inclusion-Exclusion principle
Chapter 7 Advance Counting Techniques. Content Recurrence relations Generating function The principle of inclusion-exclusion.
Inclusion-Exclusion Selected Exercises Powerpoint Presentation taken from Peter Cappello’s webpage
1 Binomial Coefficients CS 202 Epp, section ??? Aaron Bloomfield.
Simple Arrangements & Selections. Combinations & Permutations A permutation of n distinct objects is an arrangement, or ordering, of the n objects. An.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.hw, terms, etc. 2.WSOP example 3. permutations, and combinations.
Great Theoretical Ideas in Computer Science.
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.
The Pigeonhole Principle. The pigeonhole principle Suppose a flock of pigeons fly into a set of pigeonholes to roost If there are more pigeons than pigeonholes,
Discrete Distributions. Random Variable - A numerical variable whose value depends on the outcome of a chance experiment.
Sixth lecture Concepts of Probabilities. Random Experiment Can be repeated (theoretically) an infinite number of times Has a well-defined set of possible.
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.
Some other set notation We will use the notation to mean that e is an element of A. We will use the notation to mean that e is not an element of A.
CS Lecture 11 To Exclude Or Not To Exclude? + -
+ Chapter 5 Overview 5.1 Introducing Probability 5.2 Combining Events 5.3 Conditional Probability 5.4 Counting Methods 1.
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.
Copyright © Peter Cappello 2011 Simple Arrangements & Selections.
3/7/20161 Now it’s time to look at… Discrete Probability.
7.6 Applications of Inclusion-Exclusion An Alternative Form of Inclusion-Exclusion Example 1: How many solutions does x 1 + x 2 +x 3 =11 have,where x 1,
L14: Permutations, Combinations and Some Review EECS 203: Discrete Mathematics.
Section The Pigeonhole Principle If a flock of 20 pigeons roosts in a set of 19 pigeonholes, one of the pigeonholes must have more than 1 pigeon.
Section 11.2 Arithmetic Sequences and Series Copyright ©2013, 2009, 2006, 2005 Pearson Education, Inc.
Permutations & Combinations: Selected Exercises. Copyright © Peter Cappello2 Preliminaries Denote the # of arrangements of some k elements of a set of.
COUNTING Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Introduction to probability (3) Definition: - The probability of an event A is the sum of the weights of all sample point in A therefore If A1,A2,…..,An.
1 What Is Probability?. 2 To discuss probability, let’s begin by defining some terms. An experiment is a process, such as tossing a coin, that gives definite.
The Pigeonhole Principle
COCS DISCRETE STRUCTURES
Permutations and Combinations
9. Counting and Probability 1 Summary
To Exclude Or Not To Exclude?
Chapter 8: Further Topics in Algebra
Permutations and Combinations
Chapter 11: Further Topics in Algebra
Discrete Distributions
Mutually Exclusive Events
Mrs.Volynskaya Alg.2 Ch.1.6 PROBABILITY
Inclusion-Exclusion Principle
Discrete Distributions.
Counting Elements of Disjoint Sets: The Addition Rule
Presentation transcript:

Inclusion-Exclusion Formula

Sk Let A1, A2, …, An be n sets in a universe U of N elements. Let: S1 = |A1| + |A2| + …+ |An| S2 = |A1 A2| + |A1 A3| + …+ |An-1 An|, i.e., the size of all AiAj for i  j. Sk = |A1 A2 …Ak| + |A1 A2 …Ak+1| + …+ |An-k+1 An-k+2 … An-1An|, i.e., the sizes of all k-ary intersections of the sets. How many terms are there in S1 , S2 , Sn , Sk?

The Inclusion-Exclusion Formula The # of elements in none of the sets is: | A1 A2 …An | = N - S1 + S2 - S3 + …+(-1)n Sn Proof We show that the formula counts each element in: none of the sets once 1 or more of the sets a net of 0 times.

Case: An element that is in none. Such an element is added once in the 1st term: N Since this element is in none of the Ais, it is in none of the Si, thus is counted a net of 1 time. Case: An element is in exactly 1 of the Ais. It is added once in the 1st term, N. It is subtracted once in S1. It is in no other term, thus is counted a net of 0.

Case: An element is in exactly 2 of the Ais. It is added once in the 1st term, N. It is subtracted twice in S1. It is added once in S2. It is in no other term, thus is counted a net of 0 times.

Case: An element is in exactly k of the Ais. It is added once in the 1st term, N. It is subtracted C(k, 1) times in S1. It is added C(k,2) times in S2. It is subtracted C(k,3) times in S3. . . . An element in exactly k sets cannot be in any intersection of more than k of the Ais.

The net count for such an element is: This binomial sum equals (1 + x)k, for x = -1. Thus, its value is exactly 0. In general, the formula counts elements in 1 or more of the sets exactly 0 times.

Corollary |A1 + A2 +. . .+ An| = S1 - S2 + S3 - S1 - ...+ (-1)n-1Sn. Proof: A1 + A2 +. . .+ An = U - A1 A2 …An Thus, a count is: N - [N - S1 + S2 - S3 + …+(-1)n Sn] = S1 - S2 + S3 - S1 - ...+ (-1)n-1Sn.

Inclusion-Exclusion Pattern To count the elements of a set that has: property 1 and property 2 and … and property n Define: A1 as the set of elements that do not have property 1 A2 as the set of elements that do not have property 2 etc. Then, A1 A2 …An is the set of all elements that have property 1 and property 2 and … and property n.

Inclusion-Exclusion Pattern To count the elements of a set that has: property 1 or property 2 or … or property n Define: A1 as the set of elements that have property 1 A2 as the set of elements that have property 2 etc. Then, A1 + A2 +. . .+ An is the set of all elements that have property 1 or property 2 or … or property n.

Example 1 How many ways are there to roll 10 distinct dice so that all 6 faces appear? Let Ai be the set of ways that face i does not appear. Then, we want |A1 A2 A3 A4 A5 A6 | = N - S1 + S2 - S3 + S4 - S5 + S6 = 610 - C(6,1)510 + C(6,2)410 + C(6,3)310 + C(6,4)210 + C(6,5)110

Example 2 What is the probability that a 10-card hand has at least one 4-of-a-kind? Let A1 be the set of all 10-card hands with 4 aces. … Let AK be the set of all 10-card hands with 4 kings. Then, we want |A1+ A2+ . . . AK| = S1 - S2 + S3 - . . . S13 = C(13,1)C(48,6) - C(13,2)C(44,2) The probability = [C(13,1)C(48,6) - C(13,2)C(44,2)] / C(52,10)

Example 3 How many integer solutions of x1 + x2 + x3 + x4 = 30 are there with: 0  xi, x1  5, x2  10, x3  15, x4  21 ? Let A1 be the set of solutions where x1  6. Let A2 be the set of solutions where x2  11. Let A3 be the set of solutions where x3  16. Let A4 be the set of solutions where x4  22. We want |A1 A2 A3 A4| = N - S1 + S2 - S3 + S4

N = C(30 + 4 - 1, 4 - 1) A1 = C(30 - 6 + 4 - 1, 4 - 1) A2 = C(30 - 11 + 4 - 1, 4 - 1) A3 = C(30 - 16 + 4 - 1, 4 - 1) A4 = C(30 - 22 + 4 - 1, 4 - 1) A1 A2 = C(30 - 17 + 4 - 1, 4 - 1) A1 A3 = C(30 - 22 + 4 - 1, 4 - 1) A1 A4 = C(30 - 28 + 4 - 1, 4 - 1) A2 A3 = C(30 - 27 + 4 - 1, 4 - 1) A2 A4 = 0 = A3 A4 All 3-intersections & 4-intersections have 0 elements in them.

Derangements What is the probability that if n people randomly reach into a dark closet to retrieve their hats, no person receives their own hat? Let Ai be the set outcomes where person i receives his/her own hat. We need |A1 A2 ... An| = N - S1 + S2 - S3 + … + (-1)n Sn N = n! |Ai| = (n-1)!, |AiAj| = (n-2)!, …, |A1A2... An|= 0!

N - S1 + S2 - S3 + … + (-1)n Sn= n! - C(n,1)(n-1)! + C(n,2)(n-2)! - … + (-1)n C(n,n)0! Since C(n,k) = n!/[k!(n-k)!], C(n,k) (n-k)! = n!/k!. Thus, the sum equals n! - n!/1! + n!/2! - n!/3! + … + (-1)n n!/n! =

This sum is the number of good outcomes. The probability, then, is this number over all possible outcomes (n!) :

This is the 1st n + 1 terms of the power series for This power series converges quickly. The numerator of the probability, the number of permutations that leave no element fixed, denoted Dn, is called the number of derangements of n elements.