Chapter 8 The principle of Inclusion and Exclusion Yen-Liang Chen Dept of Information Management National Central University.

Slides:



Advertisements
Similar presentations
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.
Advertisements

+ or -?.
Chapter 5 Relations and Functions
7.6 Applications of Inclusion/Exclusion Problem: Find the number of elements in a set that have none of n properties P1, P2,.. Pn.
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| = ?
1 More Counting by Mapping Lecture 16: Nov 7. 2 This Lecture Division rule Catalan number.
Recursive Definitions and Structural Induction
COUNTING AND PROBABILITY
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.
EXAMPLE 1 Construct a probability distribution
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 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,
Chapter 9 Generating functions Yen-Liang Chen Dept of Information Management National Central University.
More Counting Lecture 16: Nov 9 A B …… f. Counting Rule: Bijection If f is a bijection from A to B, then |A| = |B| A B …… f.
Discrete Mathematics Lecture 6 Alexander Bukharovich New York University.
1 Chapter 3 Set Theory Yen-Liang Chen Dept of Information Management National Central University.
1 Chapter 6 The principle of inclusion and exclusion 6.1 排容原則 (the principle of inclusion and exclusion) 6.2 亂序 (derangements) 6.3 城堡多項式 (the rook polynomial)
4.4.2 Combinations of multisets
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Chapter 1 Fundamental principles of counting 陳彥良 中央大學資管系.
Systems of Linear Equation and Matrices
More Counting Lecture 13 A B …… f. Counting Rule: Bijection If f is a bijection from A to B, then |A| = |B| A B …… f.
More Counting Lecture 16: Nov 9 A B …… f. This Lecture We will study how to define mappings to count. There will be many examples shown. Bijection rule.
Copyright © Cengage Learning. All rights reserved. CHAPTER 9 COUNTING AND PROBABILITY.
Chapter 6 The Inclusion-Exclusion Principle and Applications
Chapter 4 Polynomials TSWBAT determine if an expression is a monomial, binomial, or polynomial; determine the degree of a monomial or polynomial; add and.
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
Basic Counting. This Lecture We will study some basic rules for counting. Sum rule, product rule, generalized product rule Permutations, combinations.
Copyright © Cengage Learning. All rights reserved. CHAPTER 9 COUNTING AND PROBABILITY.
1 Relations and Functions Chapter 5 1 to many 1 to 1 many to many.
Binomial Coefficients, Inclusion-exclusion principle
Chapter 3 – Set Theory  .
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
Chapter 3 Permutations and 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.
Groups Definition A group  G,  is a set G, closed under a binary operation , such that the following axioms are satisfied: 1)Associativity of  :
4.5.2 Applications of Inclusion-Exclusion principle
Chapter 3 Polynomial and Rational Functions Copyright © 2014, 2010, 2007 Pearson Education, Inc Zeros of Polynomial Functions.
Chapter 7 Advance Counting Techniques. Content Recurrence relations Generating function The principle of inclusion-exclusion.
Section Section Summary The Product Rule The Sum Rule The Subtraction Rule The Division Rule Examples, Examples, and Examples Tree Diagrams.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.1,
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
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,
The Rational Zero Theorem The Rational Zero Theorem gives a list of possible rational zeros of a polynomial function. Equivalently, the theorem gives all.
Math 344 Winter 07 Group Theory Part 1: Basic definitions and Theorems.
1 CS 140 Discrete Mathematics Combinatorics And Review Notes.
CS Lecture 11 To Exclude Or Not To Exclude? + -
UNIT 3. OUTLINE: Sets and Subsets Set Operations the Laws of Set Theory Counting and Venn Diagrams. A First Word on Probability. The Axioms of Probability.
Spring 2016 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University.
Counting II: Recurring Problems And Correspondences Great Theoretical Ideas In Computer Science V. AdamchikCS Spring 2006 Lecture 6Feb 2, 2005Carnegie.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
SECTION 2 BINARY OPERATIONS Definition: A binary operation  on a set S is a function mapping S X S into S. For each (a, b)  S X S, we will denote the.
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.
Section Basic Counting Principles: The Product Rule The Product Rule: A procedure can be broken down into a sequence of two tasks. There are n 1.
3/7/20161 Now it’s time to look at… Discrete Probability.
CS336 F07 Counting 2. Example Consider integers in the set {1, 2, 3, …, 1000}. How many are divisible by either 4 or 10?
Principle of Inclusion and Exclusion
Now it’s time to look at…
The Pigeonhole Principle
COCS DISCRETE STRUCTURES
To Exclude Or Not To Exclude?
CS100: Discrete structures
Set, Combinatorics, Probability & Number Theory
Basic Counting.
More Counting A B … f Lecture 16: Nov 9.
Basic Counting Lecture 9: Nov 5, 6.
Permutations and Combinations
Now it’s time to look at…
Now it’s time to look at…
4.4 Permutations and Combinations of multisets
Presentation transcript:

Chapter 8 The principle of Inclusion and Exclusion Yen-Liang Chen Dept of Information Management National Central University

8.1 The principle of Inclusion and Exclusion

Four sets For each element x, we have five cases: (0) x satisfies none of the four conditions; (1) x satisfies only one of the four conditions; (2) x satisfies exactly two of the four conditions; (3) x satisfies exactly three of the four conditions; (4) x satisfies all the four conditions.

Four sets 1. Say x satisfies no condition. x is counted once on the left side and once on the right side. 2. Say x satisfies c 1. It is not counted on the left side. It is counted once in N and once in N(c 1 ). 3. Say x satisfies c 2 and c 4. It is not counted on the left side. It is counted once in N, N(c 2 ), N(c 4 ) and N(c 2 c 4 ). 4. Say x satisfies c 1, c 2 and c 4. It is not counted on the left side. It is counted once in N, N(c 1 ), N(c 2 ), N(c 4 ), N(c 1 c 2 ), N(c 1 c 4 ), N(c 2 c 4 ) and N(c 1 c 2 c 4 ). 5. Say x satisfies all conditions. It is not counted on the left side. It is counted once in all the subsets on the right side.

Theorem 8.1.

Symbol S k

Ex 8.4. Determine the number of positive integers n where n  100 and n is not divisible by 2, 3 or 5. Condition c 1 if n is divisible by 2. Condition c 2 if n is divisible by 2. Condition c 3 if n is divisible by 2. Then the answer to this problem is

Ex 8.5. Determine the number of nonnegative integer solutions to the equation x 1 +x 2 +x 3 +x 4 =18 and x i  7 for all i. We say that a solution x 1, x 2, x 3, x 4 satisfies condition c i if x i >7. Then the answer to this problem is

Ex 8.6. For finite sets A, B, where  A  =m  n=  B , and function f: A  B, determine the number of onto functions f. Let A={a 1, a 2,…, a m } and B={b 1, b 2, …, b n }. Let c i be the condition that b i is not in the range of f. Then the answer to this problem is

Ex 8.8. Let  (n) be the number of positive integers m, where 1  m<n and gcd(m, n)=1—that is, m and n are relatively prime. Consider. For 1  i  4, let c i denote that n is divisible by p i. Then the answer to this problem is

Ex 8.9. Six married couples are to be seated at a circular table. In how many ways can they arrange themselves so that no wife sits next to her husband? For 1  i  6, let c i denote the condition that where a seating arrangement has couple i seated next to each other. Then the answer to this problem is

8.2. Generalizations of the principle E m denotes the number of elements in S that satisfy exactly m of the t conditions. E 1 =N(c 1 )+N(c 2 )+N(c 3 )-2[N(c 1 c 2 )+ N(c 1 c 3 )+ N(c 2 c 3 )]+3N(c 1 c 2 c 3 ) =S 1 -2S 2 +3S 3 =S 1 -C(2,1)S 2 +C(3, 2)S 3 E 2 =N(c 1 c 2 )+N(c 1 c 3 )+N(c 2 c 3 )-3N(c 1 c 2 c 3 ) =S 2 -3S 3 =S 2 -C(3, 1)S 3 E 3 =S 3

No of conditions =4 E 1 =S 1 -C(2,1)S 2 + C(3, 2)S 3 -C(4, 3)S 4 E 2 =S 2 -C(3,1)S 3 + C(4, 2)S 4 E 3 =S 3 -C(4,1)S 4 E 4 =S 4

Theorem 8.2.

Corollary 8.2. Let L m denotes the number of elements in S that satisfy at least m of the t conditions.

8.3. Derangements: nothing is in its right place Derangement means that all numbers are in the wrong positions. e -1 =1-1+(1/2!)-(1/3!)+(1/4!)-(1/5!)+….. = Ex Determine the number of derangements of 1,2,…, 10. Let c i be the condition that integer i is in the i-th position. d 10 can be computed as follows.

The general formula

Examples Ex We have seven books and seven reviewers. Each book needs to be reviewed by two persons. How many ways can we assign the referees? The first week has 7! ways to assign referees. The second week has d 7 ways to assign referees. Totally, we have 7!  d 7 ways of possible assignments.

8.4. Rook polynomials In Fig. 8.6, we want to determine the number of ways in which k rooks can be placed on the unshaded squares of this chessboard so that no two of them can take each other—that is, no two of them are in the same row or column of the chessboard. This number is denoted as r k (C)

Rook polynomials In Fig. 8.6, we have r 0 =1, r 1 =6, r 2 =8, r 3 =2 and r k =0 for k  4. r(C, x)=1+6x+8x 2 +2x 3. For each k  0, the coefficient of x k is the number of ways we can place k nontaking rooks on chessboard C.

disjoint subboards In Fig. 8.7, the chessboard contains two disjoint subboards that have no squares in the same column or row of C. r(C, x)=r(C 1, x). r(C 2, x).

Multiple disjoint subboards In general, if C is a chessboard made up of pairwise disjoint subboards C 1, C 2,…, C n, then r(C, x)= r(C 1, x). r(C 2, x)…. r(C n, x).

Recursive formula For a given designated square, (1) we either place one root here, or (2) we do not use this square. r k (C)=r k-1 (C s )+r k (C e ) r k (C) x k =r k-1 (C s ) x k +r k (C e ) x k for 1  k  n.

Recursive formula

Apply the recursive formula

8.5. Arrangements with forbidden positions Ex The shaded square of R i T j means R i will not sit at T j. Determine the number of ways that we can seat these four relatives on unshaded squares. Let S be the total number of ways we can place these four relatives, one to a table. Let c i be the condition that R i is seated in a forbidden position but at different tables. T1T1 T2T2 T3T3 T4T4 T5T5 R1R1 R2R2 R3R3 R4R4

Ex 8.15 Let r i be the number of ways in which it is possible to place i nontaking rooks on the shaded chessboard. For all 0  i  4, S i =r i (5-i)! R(C, x)=(1+3x+x 2 )(1+4x+3x 2 ) =1+7x+16x 2 +13x 3 +3x 4

Ex We roll two dice six times, where one is red die and the other green die. We know the following pairs did not occur: (1, 2), (2, 1), (2, 5), (3, 4), (4, 1), (4, 5) and (6, 6). What is the probability that we obtain all six values both on red die and green die? One of solutions is like (1, 1), (2, 3), (4, 4), (3, 2), (5, 6), (6, 5). r(C, x)=(1+4x+2x 2 )(1+x) 3 =1+7x+17x 2 +19x 3 +10x 4 +2x 5 c i denotes that all six values occur on both the red and green dies, but i on the red die is paired with one of the forbidden numbers on the green die

Ex How many one-to-one functions from A to B satisfy none of the following conditions shown in Fig r(C, x)= (1+2x)(1+6x+9x 2 +2x 3 ) =1+8x+21x 2 +20x 3 +4x 4 uvwxyz