Inclusion-Exclusion Selected Exercises

Slides:



Advertisements
Similar presentations
Homework Answers 1. {3} 2. {1, 3} 5. {3, 4, 6} 6. {} 10. {2, 3, 4}
Advertisements

The Rational Zero Theorem
5.1 Rules for Exponents Review of Bases and Exponents Zero Exponents
Mathematical Preliminaries
Verify Unit of Measure in a Multivariate Equation ©
Functions and Their Representations
Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums (1)
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Year 6 mental test 5 second questions
Around the World AdditionSubtraction MultiplicationDivision AdditionSubtraction MultiplicationDivision.
Illustration collectées par Jean Burdy - 8/09/20111.
The Pigeonhole Principle: Selected Exercises
Learning Objectives for Section 7.2 Sets
1 Learning Objectives for Section 7.3 Basic Counting Principles After this lesson, you should be able to apply and use the addition principle. draw and.
The Basics of Counting: Selected Exercises. Copyright © Peter Cappello2 Sum Rule Example There are 3 sizes of pink shirts & 7 sizes of blue shirts. How.
22C:19 Discrete Math Counting Fall 2011 Sukumar Ghosh.
ABC Technology Project
9.5 Counting Subsets of a Set: Combinations
Counting. Counting in Algorithms How many comparisons are needed to sort n numbers? How many steps to compute the GCD of two numbers ? How many steps.
Basic Permutations and Combinations
Real Numbers and Complex Numbers
SC&RA June Transportation Safety Through Uniformity SC&RA Pilot Car Escort Training Program.
Recurrence Relations: Selected Exercises
Basic Counting Rosen 4.1. Sum Rule If a first task can be done in n 1 ways and a second task can be done in n 2 ways, and if these tasks cannot be done.
Adding Integers Absent Copy
Generalized Permutations & Combinations: Selected Exercises.
Applications of Inclusion-Exclusion: Selected Exercises.
Counting. Counting = Determining the number of elements of a finite set.
Copyright © 2013, 2009, 2006 Pearson Education, Inc.
Copyright © 2013, 2009, 2006 Pearson Education, Inc.
SYSTEMS OF EQUATIONS.
Strictly embargoed until 0001hrs Monday 16 th May 2011 Survey reveals police fear cuts will result in poor public service and increased crime Please note:
Copyright © 2013, 2009, 2006 Pearson Education, Inc. 1 Section 5.4 Polynomials in Several Variables Copyright © 2013, 2009, 2006 Pearson Education, Inc.
Finite-state Recognizers
Slaying the Feisty Little Foxes Song of Solomon 2:15 Dr. Russell Rosser Chinese Grace Bible Church July 3, 2011.
Counting Techniques: Permutations of Selected Elements Addition Rule, Difference Rule, Inclusion/Exclusion Rule.
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| = ?
Permutations and Combinations Rosen 4.3. Permutations A permutation of a set of distinct objects is an ordered arrangement these objects. An ordered arrangement.
Inclusion-Exclusion Formula
Lecture 14: Oct 28 Inclusion-Exclusion Principle.
Equivalence Relations: Selected Exercises
The Basics of Counting: Selected Exercises. Copyright © Peter Cappello2 Sum Rule Example There are 3 sizes of pink shirts & 7 sizes of blue shirts. How.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Combinatorics 3/15 and 3/ Counting A restaurant offers the following menu: Main CourseVegetablesBeverage BeefPotatoesMilk HamGreen BeansCoffee.
Binomial Coefficients, Inclusion-exclusion principle
Inclusion-Exclusion Selected Exercises Powerpoint Presentation taken from Peter Cappello’s webpage
Counting Techniques. L172 Agenda Section 4.1: Counting Basics Sum Rule Product Rule Inclusion-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.
1 CS 140 Discrete Mathematics Combinatorics And Review Notes.
Binomial Coefficients: Selected Exercises
Copyright © Peter Cappello 2011 Simple Arrangements & Selections.
Permutations & Combinations: Selected Exercises. Copyright © Peter Cappello2 Preliminaries Denote the # of arrangements of some k elements of a set of.
Recurrence Relations: Selected Exercises. Copyright © Peter Cappello2 Exercise 10 (a) A person deposits $1,000 in an account that yields 9% interest compounded.
Equivalence Relations: Selected Exercises
MAT 2720 Discrete Mathematics
Permutations and Combinations
ALGEBRA II H/G - SETS : UNION and INTERSECTION
CS 2210 Discrete Structures Counting
Set Operations Section 2.2.
Set, Combinatorics, Probability & Number Theory
Permutations and Combinations
15.1 Venn Diagrams.
ALGEBRA I - SETS : UNION and INTERSECTION
ALGEBRA II H/G - SETS : UNION and INTERSECTION
Inclusion-Exclusion Principle
Copyright © Zeph Grunschlag,
Copyright © Zeph Grunschlag,
Counting Elements of Disjoint Sets: The Addition Rule
Equivalence Relations: Selected Exercises
Presentation transcript:

Inclusion-Exclusion Selected Exercises

Copyright © Peter Cappello 2011 Exercise 10 Find the number of positive integers not exceeding 100 that are not divisible by 5 or 7. (Numbers  100 that are not divisible by 5 and are not divisible by 7.) See Venn diagram. Copyright © Peter Cappello 2011

Copyright © Peter Cappello 2011 Exercise 10 Solution Let the “bad” numbers be those that are divisible by 5 or 7. Subtract the number of “bad” numbers from the size of the universe: 100. Let A5 denote the numbers  100 that are divisible by 5. Let A7 denote the numbers  100 that are divisible by 7. | A5  A7 | = | A5 | + | A7 | - | A5  A7 | = └ 100/5 ┘ + └ 100/7 ┘ - └ 100/(5 .7) ┘ = 20 + 14 – 2 = 32. The answer is 100 – 32 = 68. Copyright © Peter Cappello 2011

Copyright © Peter Cappello 2011 Exercise 14 How many permutations of the 26 letters of the English alphabet do not contain any of the strings fish, rat, or bird? See Venn diagram. Copyright © Peter Cappello 2011

Copyright © Peter Cappello 2011 Exercise 14 Solution Start with the universe: 26! Subtract the permutations that contain: fish. To count the number of permutations with a fixed substring: Treat the fixed substring as 1 letter. There are (26 – 4 + 1)! such permutations. rat: (26 – 3 + 1)! bird: : (26 – 4 + 1)! Add the permutations that contain: fish & rat: (26 – 4 – 3 + 2)! fish & bird: 0 rat & bird: 0 Subtract the permutations that contain all 3 strings There are 0 such permutations. Answer: 26! – 23! – 24! – 23! + 21! Copyright © Peter Cappello 2011

The Principle of Inclusion-Exclusion | A1  A2 | = | A1 | + | A2 | - | A1  A2 | | A1  A2  A3 | = | A1 | + | A2 | + | A3 | - | A1  A2 | - | A1  A3 | - | A2  A3 | + | A1  A2  A3 | Copyright © Peter Cappello 2011

The Principle of Inclusion-Exclusion | A1  A2  . . .  An | = Σ | Ai | - Σ | Ai  Aj | + Σ | Ai  Aj  Ak | - . . . + (-1)n-1 Σ | A1  A2  ...  An | Copyright © Peter Cappello 2011

Copyright © Peter Cappello 2011 Proof An element in exactly 0 of the sets is counted by the RHS 0 times. An element in exactly 1 of the sets is counted by the RHS 1 time. An element in exactly 2 of the sets is counted by the RHS 2 – 1 = 1 time. An element in exactly 3 of the sets is counted by the RHS 3 – 3 + 1 = 1 time. m. An element in exactly m of the sets is counted by the RHS C( m, 1 ) – C( m, 2) + C( m, 3 ) - . . . + (-1)m-1C( m, m ) times. Copyright © Peter Cappello 2011

Copyright © Peter Cappello 2011 Proof ( x + y )n = C( n, 0 )xny0 + C( n, 1 )xn-1y1 + … C( n, n )x0yn Evaluate the Binomial Theorem, at x = 1, y = -1, we obtain (1 – 1)n = C( n, 0 ) – C( n, 1 ) + C( n, 2 ) - … + (-1)n-1C( n, n )  C( n, 1 ) – C( n, 2 ) + … + (-1)nC( n, n ) = C( n, 0 ) = 1. Copyright © Peter Cappello 2011

Copyright © Peter Cappello 2011 Exercise 18 How many terms are there in the formula for the # of elements in the union of 10 sets given by the inclusion-exclusion principle? Copyright © Peter Cappello 2011

Copyright © Peter Cappello 2011 Exercise 18 Solution It is the sum of the: Terms with 1 set: C( 10, 1 ) Terms with 2-way intersections: C( 10, 2 ) Terms with 3-way intersections: C( 10, 3 ) Terms with 4-way intersections: C( 10, 4 ) Terms with 5-way intersections: C( 10, 5 ) Terms with 6-way intersections: C( 10, 6 ) Terms with 7-way intersections: C( 10, 7 ) Terms with 8-way intersections: C( 10, 8 ) Terms with 9-way intersections: C( 10, 9 ) Terms with 10-way intersections: C( 10, 10 ) The total is 210 – 1 = 1,023. Copyright © Peter Cappello 2011

Copyright © Peter Cappello 2011 Exercise 20 How many elements are in the union of 5 sets if: The sets contain 10,000 elements Each pair of sets has 1,000 common elements Each triple of sets has 100 common elements Each quadruple of sets has 10 common elements All 5 sets have 1 common element. Copyright © Peter Cappello 2011

Copyright © Peter Cappello 2011 Exercise 20 Solution To count the size of the union of the 5 sets: Add the sizes of each set: C(5, 1)10,000 Subtract the sizes of the 2-way intersections: C(5, 2)1,000 Add the sizes of the 3-way intersections: C(5, 3)100 Subtract the sizes of the 4-way intersections: C(5, 4)10 Add the size of the 5-way intersection: C(5, 5)1 C(5, 1)10,000 - C(5, 2)1,000 + C(5, 3)100 - C(5, 4)10 + C(5, 5)1 Copyright © Peter Cappello 2011