Chapter 8 The principle of Inclusion and Exclusion

  • Slides: 35
Download presentation
Chapter 8 The principle of Inclusion and Exclusion Yen-Liang Chen Dept of Information Management

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

8. 1 The principle of Inclusion and Exclusion

Four sets For each element x, we have five cases: (0) x satisfies none

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. 2. 3. 4. 5. Say x satisfies no condition. x is

Four sets 1. 2. 3. 4. 5. Say x satisfies no condition. x is counted once on the left side and once on the right side. 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). 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). 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). 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.

Theorem 8. 1.

Symbol Sk

Symbol Sk

Ex 8. 4. n Determine the number of positive integers n where n 100

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

Ex 8. 5. n Determine the number of nonnegative integer solutions to the equation

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

Ex 8. 6. n For finite sets A, B, where A =m n= B

Ex 8. 6. n For finite sets A, B, where A =m n= B , and function f: A B, determine the number of onto functions f. n Let A={a 1, a 2, …, am} and B={b 1, b 2, …, bn}. n Let ci be the condition that bi is not in the range of f. n Then the answer to this problem is

Ex 8. 8. n Let (n) be the number of positive integers m, where

Ex 8. 8. n 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. n Consider. n For 1 i 4, let ci denote that n is divisible by pi. n Then the answer to this problem is

Ex 8. 9. n Six married couples are to be seated at a circular

Ex 8. 9. n 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? n For 1 i 6, let ci denote the condition that where a seating arrangement has couple i seated next to each other. n Then the answer to this problem is

8. 2. Generalizations of the principle n Em denotes the number of elements in

8. 2. Generalizations of the principle n Em denotes the number of elements in S that satisfy exactly m of the t conditions. n 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)]+3 N(c 1 c 2 c 3) =S 1 -2 S 2+3 S 3 =S 1 -C(2, 1)S 2+C(3, 2)S 3 n E 2=N(c 1 c 2)+N(c 1 c 3)+N(c 2 c 3)-3 N(c 1 c 2 c 3) =S 2 -3 S 3=S 2 -C(3, 1)S 3 n E 3=S 3

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

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

Theorem 8. 2.

Theorem 8. 2.

Corollary 8. 2. n Let Lm denotes the number of elements in S that

Corollary 8. 2. n Let Lm 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 n Derangement means that all

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

The general formula

The general formula

Examples n Ex 8. 14. We have seven books and seven reviewers. Each book

Examples n Ex 8. 14. 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. n The second week has d 7 ways to assign referees. n Totally, we have 7! d 7 ways of possible assignments. n

8. 4. Rook polynomials n In Fig. 8. 6, we want to determine the

8. 4. Rook polynomials n 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 rk(C). 3 2 1 5 6 4

Rook polynomials n In Fig. 8. 6, we have r 0=1, r 1=6, r

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

disjoint subboards n In Fig. 8. 7, the chessboard contains two disjoint subboards that

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

Multiple disjoint subboards n In general, if C is a chessboard made up of

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

Recursive formula n For a given designated square, (1) we either place one root

Recursive formula n For a given designated square, (1) we either place one root here, or (2) we do not use this square. n rk(C)=rk-1(Cs)+rk(Ce) n rk(C) xk =rk-1(Cs) xk +rk(Ce) xk for 1 k n.

Recursive formula

Recursive formula

Apply the recursive formula

Apply the recursive formula

8. 5. Arrangements with forbidden positions n Ex 8. 15. The shaded square of

8. 5. Arrangements with forbidden positions n Ex 8. 15. The shaded square of Ri. Tj means Ri will not sit at Tj. n Determine the number of ways that we can seat these four relatives on unshaded squares. n Let S be the total number of ways we can place these four relatives, one to a table. n Let ci be the condition that Ri is seated in a forbidden position but at different tables. T T T 1 R 2 R 3 R 4 2 3 4 5

Ex 8. 15 n Let ri be the number of ways in which it

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

Ex 8. 16. n We roll two dice six times, where one is red

Ex 8. 16. n We roll two dice six times, where one is red die and n n n 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+4 x+2 x 2)(1+x)3=1+7 x+17 x 2+19 x 3+10 x 4+2 x 5 ci 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

1 2 3 4 5 6 1 1 1 2 2 3 4 4

1 2 3 4 5 6 1 1 1 2 2 3 4 4 3 5 5 6 6 5 3 4 2 6

Ex 8. 17. n How many one-to-one functions from A to B satisfy none

Ex 8. 17. n How many one-to-one functions from A to B satisfy none of the following conditions shown in Fig. 8. 11. n r(C, x)= (1+2 x)(1+6 x+9 x 2+2 x 3) =1+8 x+21 x 2+20 x 3+4 x 4 u 1 2 3 4 v w x y z