7.6 Applications of Inclusion/Exclusion Problem: Find the number of elements in a set that have none of n properties P1, P2,.. Pn.

Slides:



Advertisements
Similar presentations
5.3 Permutations and Combinations
Advertisements

Applications of Inclusion-Exclusion: Selected Exercises.
THE WELL ORDERING PROPERTY Definition: Let B be a set of integers. An integer m is called a least element of B if m is an element of B, and for every x.
Mathematical Induction
Inclusion-Exclusion Rosen 6.5 & 6.6
Lecture & 6.6 Inclusion-Exclusion. 6.5 Inclusion-Exclusion A AB U It’s simply a matter of not over-counting the blue area in the intersection.
Practice Quiz 3 Recursive Definitions Relations Basic Counting Pigeonhole Principle Permutations & Combinations Discrete Probability.
7.5 Inclusion/Exclusion. Definition and Example- 2 sets |A  B| =|A| + |B| - |A ∩ B| Ex1: |A|=9, |B|=11, |A∩B|=5, |A  B| = ?
MA/CSSE 473/474 How (not) to do an induction proof.
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Inclusion-Exclusion Formula
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.
Discrete Mathematics Lecture 6 Alexander Bukharovich New York University.
Sequence A list of objects arranged in a particular order.
6 6.3 © 2012 Pearson Education, Inc. Orthogonality and Least Squares ORTHOGONAL PROJECTIONS.
Chapter 8 The principle of Inclusion and Exclusion Yen-Liang Chen Dept of Information Management National Central University.
1 Strong Mathematical Induction. Principle of Strong Mathematical Induction Let P(n) be a predicate defined for integers n; a and b be fixed integers.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Mathematical Maxims and Minims, 1988
Exam 2 Review 8.2, 8.5, 8.6, Thm. 1 for 2 roots, Thm. 2 for 1 root Theorem 1: Let c 1, c 2 be elements of the real numbers. Suppose r 2 -c 1.
Exam 2 Review 7.5, 7.6, |A1  A2  A3| =∑|Ai| - ∑|Ai ∩ Aj| + |A1∩ A2 ∩ A3| |A1  A2  A3  A4| =∑|Ai| - ∑|Ai ∩ Aj| + ∑ |Ai∩ Aj ∩ Ak| - |A1∩
Chapter 6 Mathematical Induction
Discrete Mathematics, 1st Edition Kevin Ferland
Chapter 6 The Inclusion-Exclusion Principle and Applications
Binomial Coefficients, Inclusion-exclusion principle
Permutations and Combinations
Notes 9.2 – The Binomial Theorem. I. Alternate Notation A.) Permutations – None B.) Combinations -
March 10, 2015Applied Discrete Mathematics Week 6: Counting 1 Permutations and Combinations How many different sets of 3 people can we pick from a group.
Chapter 7 Advance Counting Techniques. Content Recurrence relations Generating function The principle of inclusion-exclusion.
Section 2.6 Representation of numbers. Decimal representation (base 10) Given a positive integer X, the decimal representation of X is a string of digits.
Combinatorial Mathematics III B.Sc(Maths). Inclusion and exclusion principle Let A be cthe collections of objects given along with a list of r properties.
8.4 Mathematical Induction
Section 3.3: Mathematical Induction Mathematical induction is a proof technique that can be used to prove theorems of the form:  n  Z +,P(n) We have.
CompSci 102 Discrete Math for Computer Science March 1, 2012 Prof. Rodger Slides modified from Rosen.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.6,
1 Mathematical Induction CS 202 Epp, chapter 4. 2.
1 CS 140 Discrete Mathematics Combinatorics And Review Notes.
CS Lecture 11 To Exclude Or Not To Exclude? + -
Mathematical Induction
6 6.3 © 2016 Pearson Education, Inc. Orthogonality and Least Squares ORTHOGONAL PROJECTIONS.
Chapter 5. Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach.
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,
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.
Chapter 4 With Question/Answer Animations 1. Chapter Summary Divisibility and Modular Arithmetic - Sec 4.1 – Lecture 16 Integer Representations and Algorithms.
Ch. 10 – Infinite Series 9.1 – Sequences. Sequences Infinite sequence = a function whose domain is the set of positive integers a 1, a 2, …, a n are the.
Chapter 2 – Polynomial and Rational Functions 2.5 – The Fundamental Theorem of Algebra.
Section 6.3. Section Summary Permutations Combinations.
Induction (chapter of the book and chapter of the notes)
Direct Proof and Counterexample IV: Division into Cases and the Quotient-Remainder Theorem For each of the following values of n and d, find integers q.
The Theory of NP-Completeness
The Pigeonhole Principle
Chapter 6: Discrete Probability
Counting by Complement and the Inclusion/Exclusion Principle
CSC 321: Data Structures Fall 2016 Counting and proofs
Advanced Algorithms Analysis and Design
9. Counting and Probability 1 Summary
To Exclude Or Not To Exclude?
Linear Sorting Sorting in O(n) Jeff Chastine.
The principle of inclusion and exclusion; inversion formulae
Applications of Inclusion-Exclusion: Selected Exercises
Inclusion-Exclusion Principle
Advanced Analysis of Algorithms
2.Derangements A derangement of {1,2,…,n} is a permutation i1i2…in of {1,2,…,n} in which no integer is in its natural position: i11,i22,…,inn. We denote.
4.4 Permutations and Combinations of multisets
Mathematical Induction
Counting Elements of Disjoint Sets: The Addition Rule
Counting Elements of Disjoint Sets: The Addition Rule
THE WELL ORDERING PROPERTY
From the last time: gcd(a, b) can be characterized in two different ways: It is the least positive value of ax + by where x and y range over integers.
Presentation transcript:

7.6 Applications of Inclusion/Exclusion Problem: Find the number of elements in a set that have none of n properties P1, P2,.. Pn.

Intro Ex: not divisible by 5 or 7 Div by 5Div by 7

Let A i =subset containing elements with property P i N(P 1 P 2 P 3 …P n )=|A 1 ∩A 2 ∩…∩A n | N(P 1 ’ P 2 ‘ P 3 ‘…P n ‘)= number of elements with none of the properties P1, P2, …Pn =N - |A1  A2  …  An| =N- (∑|Ai| - ∑|Ai ∩ Aj| + … +(-1) n+1 |A1∩ A2 ∩…∩ An|) = N - ∑ N (Pi) + ∑(PiPj) -∑N(PiPjPk) +… +(-1) n N(P1P2…Pn)

N(P 1 ’ P 2 ‘ P 3 ‘…P n ‘) Number of elements with none of the properties P1, P2, …Pn N(P 1 ’ P 2 ‘ P 3 ‘…P n ‘) = N - ∑ N (Pi) + ∑(PiPj) -∑N(PiPjPk) +… +(-1) n N(P1P2…Pn)

Ex 1: How many solutions does x 1 +x 2 +x 3 = 11 have where xi is a nonnegative integer with x 1 ≤ 3, x 2 ≤ 4, x 3 ≤ 6 (note: harder than previous problems) Let P1: x1≥4, P2: x2≥5, P3: x3≥7 N(P 1 ’ P 2 ‘ P 3 ‘ ) = N – N(P1) – N(P2) – N(P3) + N(P1P2)+ N(P1P3)+N(P2P3) –N(P1P2P3) =13C11 – 9C7 – 8C6 – 6C4 + 4C2 + 2C0 + 0 – 0 =78 – 36 – 28 – – 0 = 6

Check the solution Check:

Ex: 2: How many onto functions are there from a set A of 7 elements to a set B of 3 elements Let A={a1,a2,a3,a4,a5,a6,a7}, B={b1,b2,b3} Let Pi be the property that bi is not an element of range(f) N(P 1 ’ P 2 ‘ P 3 ‘ ) = N – N(P1) – N(P2) – N(P3) + N(P1P2)+ N(P1P3)+N(P2P3) –N(P1P2P3)

answer =3 7 -3C1*2 7 +3C2* = =1806 Note: Theorem 1 covers these problems in general.

Application: How many ways are there to assign 7 different jobs to 3 different employees if every employee is assigned at least one job?

Sieve of Eratosthenes

Sieve- on numbers 2 to 100 The number of primes from will be 4+N(P 1 ’ P 2 ‘ P 3 ‘P 4 ‘ ) Define: P1: numbers divisible by 2 … P2: P3: P4: N(P 1 ’ P 2 ‘ P 3 ‘P 4 ‘ ) = N – N(P1) – N(P2) – N(P3) - N(P4) +N(P1P2)+ N(P1P3)+N(P1P4)+N(P2P3)+N(P2P3)+N(P3P4) –N(P1P2P3)-N(P1P2P4)-N(P1P3P4)-N(P2P3P4) +N(P1P2P3P4) =… =

Hatcheck problem Question: A new employee checks the hats of n people and hands them back randomly. What is the probability that no one gets the right hat. (Similar question: If I don’t know anyone’s names, what’s the probability no one gets the right test back?) Term: “Derangement”- permutation of objects that leave NO object in its original place

Examples of derangements For 1,2,3,4,5, make some examples of a derangement: Some non-examples:

Thm. 2: The number of derangements of a set with n elements is… Dn= n![1 - ] In order to prove this, we will use the N(P 1 ’ P 2 ‘ P 3 ‘…P n ‘) formula. But, first we calculate: N=___ N(Pi)=___ N(PiPj)=___

Proof of derangement formula Since N=n!, N(Pi)=(n-1)!, N(PiPj)=(n-2)!,… Dn = N(P 1 ’ P 2 ‘ P 3 ‘…P n ‘)= = N - ∑N(Pi) + ∑N(PiPj) + -∑N(PiPjPk) +…+(-1) n N(P1P2…Pn) =

Dn = N - ∑N(Pi) + ∑N(PiPj) + -∑N(PiPjPk) +…+(-1) n N(P1P2…Pn) =n! – nC1* (n-1)! + nC2*(n-2)!- … + (-1) n *nCn(n- n)! = … = n! – n!/1! + n!/2! - …+(-1) n n!/n! = n![1 - ]

Probability no one gets the same hat back… is Dn/n!= 1 – 1/1! + ½! - … (-1) n 1/n! As n , Dn/n!  1/e =.368… N2345 Dn/n!

Other applications Matching cards Mailboxes Passing tests back