190 likes | 225 Views
Counting Elements of Disjoint Sets: The Addition Rule. Lecture 26 Section 6.3 Fri, Feb 25, 2005. Counting Elements in Disjoint Sets. Theorem: Let { A 1 , …, A n } be a partition of a set A . Then |A | = |A 1 | + … + |A n |.
E N D
Counting Elements of Disjoint Sets: The Addition Rule Lecture 26 Section 6.3 Fri, Feb 25, 2005
Counting Elements in Disjoint Sets • Theorem: Let {A1, …, An} be a partition of a set A. Then |A| = |A1| + … + |An|. • Corollary: Let {A1, …, An} be a collection of pairwise disjoint finite sets. Then |A1 … An| = |A1| + … + |An|.
Counting Elements in Subsets • Theorem: Let A and B be finite sets with B A. Then |A – B| = |A| – |B|. • Proof: • {B, A – B} is a partition of A. • Therefore, |B| + |A – B| = |A|. • So, |A – B| = |A| – |B|.
Counting Elements in Subsets • Corollary: Let A and B be finite sets with B A. Then |B| = |A| – |A – B|. • Corollary: Let S be the sample space of an experiment and let E be an event. Then P(Ec) = 1 – P(E).
Counting Elements in Unions of Sets • Theorem: Let A and B be any finite sets. Then |AB| = |A| + |B| – |A B|. • Proof: • (AB) – B = A – (A B). • Furthermore, B AB and A B A. • Therefore, |AB| – |B| = |A| – |A B|. • So, |AB| = |A| + |B| – |A B|.
Probability • Corollary: Given an experiment, let A and B be two events. Then P(A B) = P(A) + P(B) – P(A B). • Example: Draw two cards from a deck. What is the probability that at least one of them is black?
Putnam Problem A-1 (1983) • How many positive integers n are there such that n is an exact divisor of at least one of the numbers 1040, 2030? • Let A = {n | n divides 1040}. • Let B = {n | n divides 2030}. • Then |AB| = |A| + |B| – |A B|.
Putnam Problem A-1 (1983) • Prime factorization: 1040 = 240 540. • Therefore, n | 1040 if and only if n = 2a5b where 0 a 40 and 0 b 40. • There are 41 41 = 1681 such numbers. • Similarly, 2030 = 260530, so there are 61 31 = 1891 divisors of 2030.
Putnam Problem A-1 (1983) • Finally, an integer is in A B if it divides both 1040 and 2030. • That means that it divides the gcd of 1040 and 2030. • The gcd of 240 540 and 260 530 is 240 530. • Therefore, there are 41 31 = 1271 such numbers. • Thus, 1681 + 1891 – 1271 = 2301 numbers divide either 1040 or 2030.
Number of Elements in the Union of Three Sets • Theorem: Let A, B, and C be any three finite sets. Then |ABC| = |A| + |B| + |C| – |A B| – |A C| – |B C| + |A B C|. • The pattern is to add “one at a time”, subtract “two at a time”, and add “three at a time.”
Proof, continued • Proof: • |ABC| = |AB| + |C| – |(AB) C|.
Proof, continued • Proof: • |ABC| = |AB| + |C| – |(AB) C| = |A| + |B| – |A B| + |C| – |(AB) C|.
Proof, continued • Proof: • |ABC| = |AB| + |C| – |(AB) C| = |A| + |B| – |A B| + |C| – |(AB) C| = |A| + |B| – |A B| + |C| – |(A C) (B C)|.
Proof, continued • Proof: • |ABC| = |AB| + |C| – |(AB) C| = |A| + |B| – |A B| + |C| – |(AB) C| = |A| + |B| – |A B| + |C| –|(A C) (B C)| = |A| + |B| – |A B| + |C| – |A C| – |B C| + |(A C) (B C)|.
Proof, continued • Proof: • |ABC| = |AB| + |C| – |(AB) C| = |A| + |B| – |A B| + |C| – |(AB) C| = |A| + |B| – |A B| + |C| – |(A C) (B C)| = |A| + |B| – |A B| + |C| – |A C| – |B C| + |(A C) (B C)| = |A| + |B| – |A B| + |C| – |A C| – |B C| + |A B C|.
Proof, continued • Proof: • |ABC| = |AB| + |C| – |(AB) C| = |A| + |B| – |A B| + |C| – |(AB) C| = |A| + |B| – |A B| + |C| – |(A C) (B C)| = |A| + |B| – |A B| + |C| – |A C| – |B C| + |(A C) (B C)| = |A| + |B| – |A B| + |C| – |A C| – |B C| + |A B C|. = |A| + |B| + |C| – |A B| – |A C| – |B C| + |A B C|.
Proof, continued • Proof: • |ABC| = |AB| + |C| – |(AB) C| = |A| + |B| – |A B| + |C| – |(AB) C| = |A| + |B| – |A B| + |C| – |(A C) (B C)| = |A| + |B| – |A B| + |C| – |A C| – |B C| + |(A C) (B C)| = |A| + |B| – |A B| + |C| – |A C| – |B C| + |A B C|. = |A| + |B| + |C| – |A B| – |A C| – |B C| + |A B C|.
Number of Elements in the Union of Three Sets • Corollary: Let A, B, and C be any three events. Then P(ABC) = P(A) + P(B) + P(C) – P(A B) – P(A C) – P(B C) + P(A B C).
The Inclusion/Exclusion Rule • Theorem: Let A1, …, An be finite sets. Then |A1 … An| = i|Ai| – i j > i|Ai Aj| + i j > i k > j|Ai Aj Ak| : |A1 … An|.