Mathematics for Computer Science Inclusion-Exclusion MIT 6.042J/18.062J |A ∪ B| = |A|+|B|-|A ∩ B| Inclusion- A B Exclusion 2 set proof Albert R Meyer, April 24, 2013 Albert R Meyer, April 24, 2013 incexcI.1 incexcI.2 Inc-Exc from Sum Rule Inc-Exc from Sum Rule A B A B proof: proof: ∪ B = A ∪ (B − A) A |A B| = |A| + |B − A| ∪ by Sum Rule disjoint Albert R Meyer, April 24, 2013 Albert R Meyer, April 24, 2013 incexcI.3 incexcI.4 1
|B − A| = |B| − |A ∩ B | Inc-Exc from Sum Rule Lemma: A B A B proof: |A B| = |A| + |B − A| ∪ = (B ∩ A) ∪ (B − A) B � �� � � |B| | A ∩ B| − disjoint Albert R Meyer, April 24, 2013 Albert R Meyer, April 24, 2013 incexcI.5 incexcI.6 |B − A| = |B| − |A ∩ B| Lemma: Inclusion-Exclusion (3 Sets) A B |A � B � C| =� QED |A| + |B| + |C| � |A � B| � |A � C| � |B � C| + |A � B � C| proof: |B| = |B ∩ A| + |B − A| A B by Sum Rule C Albert R Meyer, April 24, 2013 Albert R Meyer, April 24, 2013 incexcI.7 incexcI.8 2
Incl-Excl Formula: Proofs Incl-Excl (n sets) by induction on n A ∪ 1 ∪ A 2 ∪ ⋯ ∪ A n = --uninformative S + 1 ∩ A i by binomial counting ∑ ( − 1) --next { } ∅≠ S ⊆ 1,2,…,n i ∈ S by distributivity --also Albert R Meyer, April 24, 2013 Albert R Meyer, April 24, 2013 incexcI.10 incexcI.13 3
MIT OpenCourseWare http://ocw.mit.edu 6.042J / 18.062J Mathematics for Computer Science Spring 20 15 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
Recommend
More recommend