Download presentation
Presentation is loading. Please wait.
Published byRegina Gibbs Modified over 9 years ago
1
1 Inclusion-Exclusion Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong
2
2 e.g.1 (Page 3) What is the size of E, denoted by S(E)? E b c F a d e f What is the size of F, denoted by S(F)? What is the size of E U F, denoted by S(E U F)? 3 4 6 Please express S(E U F) in terms of S(E), S(F) and S(E F). What is the size of E F, denoted by S(E F)? 1 S(E U F) = S(E) + S(F) – S(E F)
3
3 e.g.2 (Page 5) We know that S(E U F) = S(E) + S(F) – S(E F) where S(E) is the size of E E b c F a d e f This principle also applies in probabilities Let E and F be two events. We have P(E U F) = P(E) + P(F) – P(E F) where P(E) is the probability of event E
4
4 e.g.3 (Page 6) Consider we roll two dice. Let E be the event that the sum of the two dice is even Let F be the event that the sum of the two dice is 8 or more. E: sum is even F: sum is 8 or more What is P(E)? What is P(F)? What is P(E F)? What is P(E U F)? What is P(E)? What is P(F)? What is P(E F)? What is P(E U F)?
5
5 e.g.3 E: sum is even F: sum is 8 or more What is P(E)? What is P(F)? What is P(E F)? What is P(E U F)? Dice 1Dice 2Sum 112 123 134 145 156 167 213 224 235 246 257 268 Dice 1Dice 2Sum 314 325 336 347 358 369 415 426 437 448 459 4610 Dice 1Dice 2Sum 516 527 538 549 5510 5611 617 628 639 6410 6511 6612 We want to find P(sum is even)= 1/2 1/2
6
6 e.g.3 E: sum is even F: sum is 8 or more What is P(E)? What is P(F)? What is P(E F)? What is P(E U F)? Dice 1Dice 2Sum 112 123 134 145 156 167 213 224 235 246 257 268 Dice 1Dice 2Sum 314 325 336 347 358 369 415 426 437 448 459 4610 Dice 1Dice 2Sum 516 527 538 549 5510 5611 617 628 639 6410 6511 6612 We want to find P(sum is 8 or more) 1/2 P(sum is 8) P(sum is 9) P(sum is 10) P(sum is 11) P(sum is 12) = 5/36 = 4/36 = 3/36 = 2/36 = 1/36 = 5/36 + 4/36 + 3/36 + 2/36 + 1/36= 15/36 15/36
7
7 e.g.3 E: sum is even F: sum is 8 or more What is P(E)? What is P(F)? What is P(E F)? What is P(E U F)? Dice 1Dice 2Sum 112 123 134 145 156 167 213 224 235 246 257 268 Dice 1Dice 2Sum 314 325 336 347 358 369 415 426 437 448 459 4610 Dice 1Dice 2Sum 516 527 538 549 5510 5611 617 628 639 6410 6511 6612 We want to find P(even sum is 8 or more) 1/2 P(sum is 8) P(sum is 10) P(sum is 12) = 5/36 = 3/36 = 1/36 = 5/36 + 3/36 + 1/36= 9/36 15/36 9/36
8
8 e.g.3 E: sum is even F: sum is 8 or more What is P(E)? What is P(F)? What is P(E F)? What is P(E U F)? We want to find P(E U F) 1/2 15/36 9/36 (By the Principle of Inclusion and Exclusion) P(E U F) = P(E) + P(F) – P(E F) = 1/2 + 15/36 – 9/36 = 2/3 2/3
9
9 e.g.4 (Page 6) What is the size of E, denoted by S(E)? E b c F a d e f What is the size of F, denoted by S(F)? What is the size of E U F U G, denoted by S(E U F U G)? 5 6 11 Is “S(E U F U G) = S(E) + S(F) + S(G) - S(E F) – S(E G) – S(F G)”? G g h i j k What is the size of G, denoted by S(G)? 5 What is the size of E F, denoted by S(E F)? 2 What is the size of E G, denoted by S(E G)? 2 What is the size of F G, denoted by S(F G)? 2 What is the size of E F G, denoted by S(E F G)? 1 No RHS = 5 + 6 + 5 – 2 – 2 – 2 = 16 – 6 = 10 LHS = 11
10
10 e.g.4 What is the size of E, denoted by S(E)? E b c F a d e f What is the size of F, denoted by S(F)? What is the size of E U F U G, denoted by S(E U F U G)? 5 6 11 “S(E U F U G) = S(E) + S(F) + S(G) - S(E F) – S(E G) – S(F G) + S(E F G)” G g h i j k What is the size of G, denoted by S(G)? 5 What is the size of E F, denoted by S(E F)? 2 What is the size of E G, denoted by S(E G)? 2 What is the size of F G, denoted by S(F G)? 2 What is the size of E F G, denoted by S(E F G)? 1 RHS = 5 + 6 + 5 – 2 – 2 – 2 + 1 = 16 – 6 + 1= 11 LHS = 11
11
11 e.g.5 (Page 6) We know that S(E U F U G) = S(E) + S(F) + S(G) - S(E F) – S(E G) – S(F G) + S(E F G) where S(E) is the size of E This principle also applies in probabilities Let E, F and G be three events. We have P(E U F U G) = P(E) + P(F) + P(G) - P(E F) – P(E G) – P(F G) + P(E F G) where P(E) is the probability of event E
12
12 e.g.6 (Page 10) We have seen P(E U F) = P(E) + P(F) – P(E F) We re-write as P(E 1 U E 2 ) = P(E 1 ) + P(E 2 ) – P(E 1 E 2 ) We further re-write as
13
13 e.g.7 (Page 10) We have seen P(E U F U G) = P(E) + P(F) + P(G) - P(E F) – P(E G) – P(F G) + P(E F G) We re-write as P(E 1 U E 2 U E 3 ) = P(E 1 ) + P(E 2 ) + P(E 3 ) - P(E 1 E 2 ) – P(E 1 E 3 ) – P(E 2 E 3 ) + P(E 1 E 2 E 3 ) We further re-write as
14
14 e.g.7 From we further re-write as
15
15 e.g.7
16
16 e.g.7 we can re-write as
17
17 e.g.7
18
18 e.g.8 (Page 13) According to we deduce a general formula as follows Prove that Why is it correct?
19
19 e.g.8 Prove that Let P(n) be Step 1: Prove that P(2) (i.e., the base case) is true. We want to show that (*) RHS of (*) In some slides, we know that P(E 1 U E 2 ) = P(E 1 ) + P(E 2 ) – P(E 1 E 2 ) Thus, P(2) is true.
20
20 e.g.8 Prove that Let P(n) be Step 2: Prove that “ P(n-1) P(n) ” is true for all n > 2. Step 2(a): Assume that P(n-1) is true for n > 2. That is, In other words, for any sets F 1, F 2, …, F n-1, we have
21
21 e.g.8 Prove that Let P(n) be Step 2: Prove that “ P(n-1) P(n) ” is true for all n > 2. Step 2(a): Assume that P(n-1) is true for n > 2. Step 2(b): According to P(n-1), we deduce that P(n) is true. In other words, for any sets F 1, F 2, …, F n-1, we have We want to show that Objective:
22
22 e.g.8 Prove that Let P(n) be Step 2: Prove that “ P(n-1) P(n) ” is true for all n > 2. Step 2(a): Assume that P(n-1) is true for n > 2. Step 2(b): According to P(n-1), we deduce that P(n) is true. In other words, for any sets F 1, F 2, …, F n-1, we have Objective: Consider P(E U F) = P(E) + P(F) – P(E F) (proved in the base case)
23
23 e.g.8 Let P(n) be In other words, for any sets F 1, F 2, …, F n-1, we have Objective: Consider Inductive Hypothesis:
24
24 e.g.8 Let P(n) be In other words, for any sets F 1, F 2, …, F n-1, we have Objective: Consider Inductive Hypothesis: (By Distributive Law) Let G i = E i E n for i < n
25
25 e.g.8 Let P(n) be In other words, for any sets F 1, F 2, …, F n-1, we have Objective: Consider Inductive Hypothesis: Let G i = E i E n for i < n
26
26 e.g.8 Let P(n) be In other words, for any sets F 1, F 2, …, F n-1, we have Objective: Consider Inductive Hypothesis: Let G i = E i E n for i < n Consider
27
27 e.g.8 Let P(n) be In other words, for any sets F 1, F 2, …, F n-1, we have Objective: Consider Inductive Hypothesis: Let G i = E i E n for i < n
28
28 e.g.8 Let P(n) be Objective: Consider
29
29 e.g.8 Let P(n) be Objective: Consider …………(**)
30
30 e.g.8 Consider
31
31 e.g.8 Consider (where k+1 = a)
32
32 e.g.8
33
33 e.g.8 Let P(n) be Objective: From (**), we have
34
34 e.g.8 Let P(n) be Objective: From (**), we have
35
35 e.g.8 Let P(n) be Objective: From (**), we have Thus, P(n) is true.
36
36 e.g.8 Let P(n) be Objective: We prove that “ P(n-1) P(n) ” is true for all n > 2 By Mathematical Induction, n 2,
37
37 e.g.9 (Page 22) We know that What is P(E 1 U E 2 U E 3 U E 4 )? P(E 1 U E 2 U E 3 U E 4 )= P(E 1 ) + P(E 2 ) + P(E 3 ) + P(E 4 ) - P(E 1 E 2 ) - P(E 1 E 3 ) - P(E 1 E 4 ) - P(E 2 E 3 ) - P(E 2 E 4 ) - P(E 3 E 4 ) + P(E 1 E 2 E 3 ) + P(E 1 E 2 E 4 ) + P(E 1 E 3 E 4 ) + P(E 2 E 3 E 4 ) - P(E 1 E 2 E 3 E 4 )
38
38 e.g.10 (Page 23) There are 5 students who have the same model and color of backpack. They put their backpacks randomly along the wall. Someone mixed up the backpacks so students get back “random” backpacks. Suppose that there are two students called “Raymond” and “Peter” (a) What is the probability that Raymond gets his OWN backpack back? (b) What is the probability that Raymond and Peter get their OWN backpacks back? (a) What is the probability that Raymond gets his OWN backpack back? (b) What is the probability that Raymond and Peter get their OWN backpacks back?
39
39 e.g.10 (a) What is the probability that Raymond gets his OWN backpack back? (b) What is the probability that Raymond and Peter get their OWN backpacks back? Raymond Peter (a) There are (5-1)! cases that Raymond gets his OWN backpack back. There are totally 5! cases P(Raymond gets his OWN backpack back) = (5-1)! 5!
40
40 e.g.10 (a) What is the probability that Raymond gets his OWN backpack back? (b) What is the probability that Raymond and Peter get their OWN backpacks back? Raymond Peter (b) There are (5-2)! cases that Raymond and Peter get their OWN backpacks back. There are totally 5! cases P(Raymond and Peter get their OWN backpacks back) = (5-2)! 5!
41
41 e.g.11 (Page 23) There are n students who have the same model and color of backpack. They put their backpacks randomly along the wall. Someone mixed up the backpacks so students get back “random” backpacks. Suppose that there are two students called “Raymond” and “Peter” (a) What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back? (a)What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back?
42
42 e.g.11 Raymond Peter … n There are (n-1)! cases that 1 specified student gets his OWN backpack back. There are totally n! cases P(1 specified student gets his OWN backpack back) = (n-1)! n! (a)What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back? (a) = (n-1)! (n-1)!. n = 1 n 1 n
43
43 e.g.11 Raymond Peter … n … k There are (n-k)! cases that k specified students get their OWN backpacks back. There are totally n! cases P(k specified students their OWN backpacks back) = (n-k)! n! (a)What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back? (b) 1 n (n-k)! n!
44
44 e.g.12 (Page 26) Suppose that there are 5 students (i.e., n = 5) Let E i be the event that student i gets his own backpack back. What is the probability that at least one person gets his own backpack? (a)What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back? 1 n (n-k)! n! P(at least one person gets his own backpack) = P(E 1 U E 2 U E 3 U E 4 U E 5 )
45
45 e.g.12 (a)What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back? 1 n (n-k)! n! P(at least one person gets his own backpack) = P(E 1 U E 2 U E 3 U E 4 U E 5 ) P(k specified students get their own backpacks back) Let E i be the event that student i gets his own backpack back. How many possible tuples in form of (i 1, i 2, …, i k ) where 1 i 1 < i 2 < … < i k 5? 5 k
46
46 e.g.12 (a)What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back? 1 n (n-k)! n! P(at least one person gets his own backpack) Let E i be the event that student i gets his own backpack back.
47
47 e.g.12 (a)What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back? 1 n (n-k)! n! P(at least one person gets his own backpack) Let E i be the event that student i gets his own backpack back. P(at least one person gets his own backpack)
48
48 e.g.13 (Page 28) Suppose that there are 5 students (i.e., n = 5) Let E i be the event that student i gets his own backpack back. What is the probability that nobody gets his own backpack? (a)What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back? 1 n (n-k)! n! P(nobody gets his own backpack) = 1 – P(at least one person gets his own backpack) P(at least one person gets his own backpack)
49
49 e.g.14 (Page 29) Suppose that there are n students Let E i be the event that student i gets his own backpack back. What is the probability that at least one person gets his own backpack? (a)What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back? 1 n (n-k)! n! P(at least one person gets his own backpack) = P(E 1 U E 2 U … U E n )
50
50 e.g.14 (a)What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back? 1 n (n-k)! n! P(at least one person gets his own backpack) = P(E 1 U E 2 U … U E n ) P(k specified students get their own backpacks back) Let E i be the event that student i gets his own backpack back. How many possible tuples in form of (i 1, i 2, …, i k ) where 1 i 1 < i 2 < … < i k n? n k
51
51 e.g.12 (a)What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back? 1 n (n-k)! n! P(at least one person gets his own backpack) Let E i be the event that student i gets his own backpack back.
52
52 e.g.12 (a)What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back? 1 n (n-k)! n! P(at least one person gets his own backpack) Let E i be the event that student i gets his own backpack back. P(at least one person gets his own backpack)
53
53 e.g.15 (Page 29) Suppose that there are n students Let E i be the event that student i gets his own backpack back. What is the probability that nobody gets his own backpack? (a)What is the probability 1 specified student gets his OWN backpack back? (b) What is the probability k specified students get their OWN backpacks back? 1 n (n-k)! n! P(nobody gets his own backpack) = 1 – P(at least one person gets his own backpack) P(at least one person gets his own backpack) Dearrangement Problem
54
54 e.g.15 P(nobody gets his own backpack) = 1 – P(at least one person gets his own backpack) Note that from calculus, we have if n is a large number
55
55 e.g.15 P(nobody gets his own backpack) if n is a large number
56
56 e.g.15 P(nobody gets his own backpack) if n is a large number n e -1 = 0.367879441
57
57 e.g.16 (Page 33) Principle of Inclusion and Exclusion for Probability Principle of Inclusion and Exclusion for Counting
58
58 e.g.17 (Page 33) How many functions from a 6-element set N to a 5-element set M = {y 1, y 2, …, y 5 } are there? N M 1 2 y1y1 y2y2 5 choices Total no. of functions = 5 x 5 x 5 x 5 x 5 x 5= 5 6 3 5 choices 4 5 6 y3y3 y4y4 y5y5
59
59 e.g.18 (Page 33) How many functions from a 6-element set N to a 5-element set M = {y 1, y 2, …, y 5 } map nothing to y 1 ? N M 1 2 y1y1 y2y2 4 choices Total no. of functions = 4 x 4 x 4 x 4 x 4 x 4= 4 6 3 4 choices 4 5 6 y3y3 y4y4 y5y5
60
60 e.g.19 (Page 33) How many functions from a 6-element set N to a 5-element set M = {y 1, y 2, …, y 5 } map nothing to y 1 and y 2 ? N M 1 2 y1y1 y2y2 3 choices Total no. of functions = 3 x 3 x 3 x 3 x 3 x 3= 3 6 3 3 choices 4 5 6 y3y3 y4y4 y5y5
61
61 e.g.20 (Page 33) How many functions from a 6-element set N to a 5-element set M = {y 1, y 2, …, y 5 } map nothing to a given set K of k elements in M (e.g., {y 1, y 2 })? N M 1 2 y1y1 y2y2 (5-k) choices Total no. of functions = (5-k) x (5-k) x (5-k) x (5-k) x (5-k) x (5-k) = (5-k) 6 3 4 5 6 y3y3 y4y4 y5y5 (5-k) choices Total no. of functions that map nothing to a given set K of k elements in M= (5-k) 6
62
62 e.g.21 (Page 34) How many functions from a 6-element set N to a 5-element set M = {y 1, y 2, …, y 5 } map nothing to at least one element in M? Total no. of functions that map nothing to a given set K of k elements in M= (5-k) 6 Let E i be a set of functions which map nothing to element y i Total no. of functions that map nothing to at least one element in M = E 1 U E 2 U … U E 5 N M 1 2 y1y1 y2y2 3 4 5 6 y3y3 y4y4 y5y5 = Principle of Inclusion-and-Exclusion
63
63 e.g.21 How many functions from a 6-element set N to a 5-element set M = {y 1, y 2, …, y 5 } map nothing to at least one element in M? Total no. of functions that map nothing to a given set K of k elements in M= (5-k) 6 Let E i be a set of functions which map nothing to element y i Total no. of functions that map nothing to at least one element in M N M 1 2 y1y1 y2y2 3 4 5 6 y3y3 y4y4 y5y5
64
64 e.g.21 How many functions from a 6-element set N to a 5-element set M = {y 1, y 2, …, y 5 } map nothing to at least one element in M? Total no. of functions that map nothing to a given set K of k elements in M= (5-k) 6 Let E i be a set of functions which map nothing to element y i Total no. of functions that map nothing to at least one element in M Total no. of functions that map nothing to a given set K of k elements where K = {y i 1, y i 2, …, y i k } How many possible tuples in form of (i 1, i 2, …, i k ) where 1 i 1 < i 2 < … < i k 5? 5 k N M 1 2 y1y1 y2y2 3 4 5 6 y3y3 y4y4 y5y5 Total no. of functions that map nothing to at least one element in M=
65
65 e.g.22 (Page 37) How many onto functions from a 6-element set N to a 5-element set M = {y 1, y 2, …, y 5 } are there? Total no. of functions that map nothing to at least one element in M= N M 1 2 y1y1 y2y2 3 4 5 6 y3y3 y4y4 y5y5
66
66 e.g.22 Onto function (or surjection) N M N M Total no. of functions that map nothing to at least one element in M=
67
67 e.g.22 Not onto function (or not surjection) N M NS M Total no. of functions that map nothing to at least one element in M=
68
68 e.g.22 How many onto functions from a 6-element set N to a 5-element set M = {y 1, y 2, …, y 5 } are there? Total no. of functions that map nothing to at least one element in M= Total no. of onto functions from a 6-element set N to a 5-element set M = Total no. of functions from a 6-element set N to a 5-element set M - Total no. of functions that are NOT onto N M 1 2 y1y1 y2y2 3 4 5 6 y3y3 y4y4 y5y5 From “e.g.,17”, Total no. of functions from a 6-element set N to a 5-element set M = 5 6 = 5 6 -= 5 6 += (-1) 0 (5-0) 6 + 5 0 = Total no. of functions from a 6-element set N to a 5-element set M - Total no. of functions that map nothing to at least one element in M =
69
69 e.g.22 How many onto functions from a 6-element set N to a 5-element set M = {y 1, y 2, …, y 5 } are there? Total no. of onto functions from a 6-element set N to a 5-element set M N M 1 2 y1y1 y2y2 3 4 5 6 y3y3 y4y4 y5y5 =
70
70 e.g.22 How many onto functions from a 6-element set N to a 5-element set M = {y 1, y 2, …, y 5 } are there? Total no. of onto functions from a 6-element set N to a 5-element set M N M 1 2 y1y1 y2y2 3 4 5 6 y3y3 y4y4 y5y5 =
71
71 e.g.23 (Page 37) How many onto functions from a 6-element set N to a 5-element set M = {y 1, y 2, …, y 5 } are there? Total no. of onto functions from a 6-element set N to a 5-element set M N M 1 2 y1y1 y2y2 3 4 5 6 y3y3 y4y4 y5y5 n m … n … ymym m = n m n m m m
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.