Download Note

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Georg Cantor's first set theory article wikipedia , lookup

Positional notation wikipedia , lookup

List of first-order theories wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Infinity wikipedia , lookup

List of important publications in mathematics wikipedia , lookup

Large numbers wikipedia , lookup

Law of large numbers wikipedia , lookup

Series (mathematics) wikipedia , lookup

Theorem wikipedia , lookup

Non-standard analysis wikipedia , lookup

Fundamental theorem of calculus wikipedia , lookup

Central limit theorem wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Arithmetic wikipedia , lookup

Birkhoff's representation theorem wikipedia , lookup

Addition wikipedia , lookup

Naive set theory wikipedia , lookup

Order theory wikipedia , lookup

Elementary mathematics wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Transcript
Notes on the Principle of Inclusion-Exclusion (“P.I.E.”)
1
P.I.E. Identities
Suppose A1 and A2 and A3 are finite sets, then
1. |A1 ∪ A2 | = |A1 | + |A2 | − |A1 ∩ A2 |
2. |A1 ∪ A2 ∪ A3 | = |A1 | + |A2 | + |A3 | − |A1 ∩ A2 | − |A2 ∩ A3 | − |A2 ∩ A3 | +
|A1 ∩ A2 ∩ A3 |
More generally, we have the following theorem:
P.I.E. Theorem If A1 , A2 , . . . An are any finite sets,then
|A1 ∪ A2 ∪ · · · ∪ An | =
n
X
|Ai | −
i=1
X
|Ai1 ∩ Ai2 | +
i1 <i2
X
|Ai1 ∩ Ai2 ∩ Ai3 | . . .
i1 <i2 <i3
Here is the same theorem with a different notation that might seem less vague
(no dots!):
P.I.E. Theorem: If A1 , A2 , . . . , An are any finite sets,then
n
[
X
|
As | =
(−1)|I|+1 |AI |,
i=1
I∈Fn
where Fn = {I : ∅ ( I ⊆ [n]}, and for any I ⊆ [n], AI =
T
Ai .
i∈I
To make sure you understand the notation, lets check that the first P.I.E. identity agrees with the case n = 2. We are summing over the non-empty subsets
of [2], namely {1}, {2}, and {1, 2}:
|
n
[
As | =
i=1
X
(−1)|I|+1 |AI |
∅(I⊆[2]
= (1)2 |A{1} | + (−1)2 |A{2} | + (−1)3 |A{1,2} |
\
= |A1 | + |A2 | − |
Ai |
i∈{1,2}
= |A1 | + |A2 | − |A1 ∩ A2 |.
With the convention that A∅ = U , we have the following important corollary
to the P.I.E. Thoerem:
Corollary If A1 , A2 , . . . , An are subsets of a finite set U , then
\
n
[
X
n
Ai = |U | − |
Ai | =
(−1)|I| |AI |.
i=1
i=1
I⊆[n]
Comment: There are 2n terms in this sum, which is a pain in the aneck.
However it is often comparatively easy to evaluate the cardinalities |AI |, and
sometimes many of the terms are essentially the same because of symmetry.
Furthermore, we’ we’ll see later that the alternating sum can be truncated to
yield upper and lower bounds that are easier to compute and often convenient.
2
Basic Arithmetic Facts used for the the Examples in the Next Section
For any real number x, define bxc = the greatest integer that is less than or
equal to x= the integer that is obtained from x by rounding down. For example,
b5.257c = 5, b 11
2 c = 5, b3c = 3, bπc = 3, b−πc = −4 .
In primary school you learn long division: for any positive integers n and d,
there are unique integers q and r such that nd = q + dr , where 0 ≤ r < q. The
number q = b nd c is called the quotient, and the number r = n − qd is called the
remainder. Note that q is just the number of multiples of d that are less than
or equal to n. For example the number of multiples of 7 that are less than or
equal to 100 is 14. We can see this three ways:
• By listing them (since 14 is small): 7,14,21,28,35,42, 49, 56,63,70,77,84,91,98
• Using long division: divide 7 into 100 and get quotient 14 with remainder
2.
• Use a calculator (since n is small or moderate) to find
and round down to get 14.
100
7
≈ 14.2857142857,
Another basic fact about numbers: n is divisible by both a and b if and only
of n is divisible by the least common multiple of a and b. For example, if
a = 360 = 23 · 32 · 5 and b = 525 = 3 · 52 · 7, then the least common multiple of
a and b is
LCM (360, 525) = 2max(3,0) 3max(2,1) 5max(1,2) 7max(0,1) = 23 · 32 · 52 · 7 = 12600.
3
Examples
For each of the following, we are given a set S, and asked to calculate |S| using
inclusion exclusion
1. Freshman at Fictitious College are required to take Physics 101 or Chemistry 101. According to the registrar, there are 1000 Freshman, with 550
taking Physics and 600 taking Chemistry. How many students are taking
both courses?
Answer: By elementary algebra, the first P.I.E. identity is equivalent to
|A1 ∩ A2 | = |A| + |A2 | − |A1 ∪ A2 |.
(1)
Let A1 be the set of freshmen taking Physics 101 and let A2 be the set
of freshmen taking Chemistry 101. We are given that |A1 ∪ A2 | = 1000,
|A1 | = 550 and |A2 | = 600. Plugging these numbers in into (1), we get
|A1 ∩ A2 | = 550 + 600 − 1000 = 150.
2. S = {n ∈ [1000] : n is divisible by 8 or 14}
Answer:Let A1 = {n ∈ [1000] : n is divisible by 8 } and A2 = {n ∈
[1000] : n is divisible by 14 }. Then S = A1 ∪ A2 and |S| = |A1 | + |A2 | −
|A1 ∩ A2 |. Using the previous section, we get |A1 | = b 1000
8 c = 125 and
c
=
71.
Note
that
LCM
(8,
14)
=
56.
Therefore
|A1 ∩ A2 | =
|A2 | = b 1000
14
b 1000
c
=
17
and
56
|S| = 125 + 71 − 17 = 179.
3. S = {n ∈ [10000] : n is NOT divisible by any of the numbers 2,5, and 31}
Answer Let A1 = {n ∈ [10000] : n is divisible by 2 }, A2 = {n ∈ [10000] :
n is divisible by 5 }, A3 = {n ∈ [10000] : n is divisible by 31 }. Then
|S| = 10000−|{n ∈ [10000] : n is divisible by at least one of the numbers 2,5, and 31}|
= 10000 − |A1 ∪ A2 ∪ A3 |
= 10000−(|A1 | + |A2 | + |A3 | − |A1 ∩ A2 | − |A1 ∩ A3 | − |A2 ∩ A3 | + |A1 ∩ A2 ∩ A3 |)
= 10000 − b
−b
10000
10000
10000
10000
10000
10000
c−b
c−b
c+b
c+b
c+b
c
2
5
31
10
62
155
10000
c = 10000 − 5000 − 2000 − 322 + 1000 + 161 + 64 − 32 = 3871
310
4. S = the ways to shuffle a deck of cards so that no card stays in its original
position.
Answer Let U be the set of 52! bijective functions that have [52] as both
the domain and the codomain. (These correspond in the obvious way to
ways of shuffling: f (i) = j if and only if the card in position i is moved
to position j.) Let Ai be the ways to shuffle so that card i stays in its
original position, i. More precisely,
|Ai | = |{f ∈ U : f (i) = i}|
The corollary is now directly applicable. The size of |AI | depends
only on
|I|. Hence the 52 sets |Ai | all have cardinality 51!, The 52
sets Ai ∩Aj all
2
have cardinality 50!, etc. Since [52] has 52
k subsets of size k,the answer
is
52 X
52
|S| =
(−1)k+1 (52 − k)!
k
k=0
Comment For a truly random permutation of the cards, the probability
|S|
that every card moves is exactly 52!
, and this is approximately 1e . Too see
this, note that
52
52
k=0
k=0
X (−1)k
|S|
1 X
52!
=
(−1)k+1 (52 − k)! =
52!
52!
k!(52 − k)!
k!
You might remember from calculus that the Taylor-Maclaurin series for x
gives
∞
X
(−1)k
e−1 =
.
k!
k=0