The Inclusion Exclusion Principle and Its More General Version

Similar documents
ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS

1. (B) The union of sets A and B is the set whose elements belong to at least one of A

Properties of the Integers

a + b = b + a and a b = b a. (a + b) + c = a + (b + c) and (a b) c = a (b c). a (b + c) = a b + a c and (a + b) c = a c + b c.

Complete Induction and the Well- Ordering Principle

The following techniques for methods of proofs are discussed in our text: - Vacuous proof - Trivial proof

Problem 1: Suppose A, B, C and D are finite sets such that A B = C D and C = D. Prove or disprove: A = B.

We want to show P (n) is true for all integers

The Inclusion Exclusion Principle

MATH 324 Summer 2011 Elementary Number Theory. Notes on Mathematical Induction. Recall the following axiom for the set of integers.

Contradiction MATH Contradiction. Benjamin V.C. Collins, James A. Swenson MATH 2730

MATH 802: ENUMERATIVE COMBINATORICS ASSIGNMENT 2

Balance properties of multi-dimensional words

Show Your Work! Point values are in square brackets. There are 35 points possible. Some facts about sets are on the last page.

Logic, Sets, and Proofs

In N we can do addition, but in order to do subtraction we need to extend N to the integers

NOTES (1) FOR MATH 375, FALL 2012

6 CARDINALITY OF SETS

Climbing an Infinite Ladder

n n P} is a bounded subset Proof. Let A be a nonempty subset of Z, bounded above. Define the set

Linear Algebra (part 1) : Vector Spaces (by Evan Dummit, 2017, v. 1.07) 1.1 The Formal Denition of a Vector Space

( V ametavariable) P P true. even in E)

Homework 1 Solutions ECEn 670, Fall 2013

Introduction to Decision Sciences Lecture 10

INDEPENDENCE OF THE CONTINUUM HYPOTHESIS

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4

D-MATH Algebra I HS18 Prof. Rahul Pandharipande. Solution 1. Arithmetic, Zorn s Lemma.

A Readable Introduction to Real Mathematics

Math 42, Discrete Mathematics

Chapter 1 : The language of mathematics.

Discrete Mathematics 2007: Lecture 5 Infinite sets

Basic Proof Examples

3.1 Basic properties of real numbers - continuation Inmum and supremum of a set of real numbers

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Math Fall 2014 Final Exam Solutions

In N we can do addition, but in order to do subtraction we need to extend N to the integers

Counting. Mukulika Ghosh. Fall Based on slides by Dr. Hyunyoung Lee

Near-domination in graphs

SETS AND FUNCTIONS JOSHUA BALLEW

Baire measures on uncountable product spaces 1. Abstract. We show that assuming the continuum hypothesis there exists a

1 Basic Combinatorics

MATH 220 (all sections) Homework #12 not to be turned in posted Friday, November 24, 2017

CDM Combinatorial Principles

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

Economics 204 Summer/Fall 2017 Lecture 1 Monday July 17, 2017

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007)

Lecture 9. The Principle of Inclusion/Exclusion. 9.1 Introduction: a familiar example

Chapter 1. Sets and Mappings

ACO Comprehensive Exam March 17 and 18, Computability, Complexity and Algorithms

RMT 2013 Power Round Solutions February 2, 2013

Models of Computation. by Costas Busch, LSU

Elementary 2-Group Character Codes. Abstract. In this correspondence we describe a class of codes over GF (q),

Cardinality and ordinal numbers

Overview. I Review of natural deduction. I Soundness and completeness. I Semantics of propositional formulas. I Soundness proof. I Completeness proof.

Fractional Roman Domination

Denitive Proof of the Twin-Prime Conjecture

Sequences of height 1 primes in Z[X]

Coins with arbitrary weights. Abstract. Given a set of m coins out of a collection of coins of k unknown distinct weights, we wish to

Equations and Colorings: Rado s Theorem Exposition by William Gasarch

a 2 = ab a 2 b 2 = ab b 2 (a + b)(a b) = b(a b) a + b = b

Combinations. April 12, 2006

On a Balanced Property of Compositions

Fundamental gaps in numerical semigroups

Introduction to Automata

Meaning of Proof Methods of Proof

COMP2411 Lecture 6: Soundness and Completeness. Reading: Huth and Ryan, Sections 1.4

Jónsson posets and unary Jónsson algebras

MULTIPLICITIES OF MONOMIAL IDEALS

Parity Versions of 2-Connectedness

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws

,... We would like to compare this with the sequence y n = 1 n

1. Determine (with proof) the number of ordered triples (A 1, A 2, A 3 ) of sets which satisfy

SOLUTIONS TO EXERCISES FOR. MATHEMATICS 205A Part 1. I. Foundational material

Climbing an Infinite Ladder

CHARACTER-FREE APPROACH TO PROGRESSION-FREE SETS

Finite and Infinite Sets

9 - The Combinatorial Nullstellensatz

The integers. Chapter 3

Three-dimensional Stable Matching Problems. Cheng Ng and Daniel S. Hirschberg. Department of Information and Computer Science

ICS141: Discrete Mathematics for Computer Science I

1 Ordinary points and singular points

Sets, Functions and Relations

AN INVESTIGATION OF THE CHUNG-FELLER THEOREM AND SIMILAR COMBINATORIAL IDENTITIES

Lecture 8: Equivalence Relations

COT 2104 Homework Assignment 1 (Answers)

Any Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City?

MAT115A-21 COMPLETE LECTURE NOTES

Assignment #2 COMP 3200 Spring 2012 Prof. Stucki

Chapter 5: The Integers

Topological properties

The rest of the paper is organized as follows: in Section 2 we prove undecidability of the existential-universal ( 2 ) part of the theory of an AC ide

Topology. Xiaolong Han. Department of Mathematics, California State University, Northridge, CA 91330, USA address:

In 1854, Karl Weierstrauss gave an example of a continuous function which was nowhere di erentiable: cos(3 n x) 2 n. sin(3 n x), 2

INVERSE LIMITS AND PROFINITE GROUPS

An Introduction to Combinatorics

Notes on counting. James Aspnes. December 13, 2010

Contribution of Problems

3. G. Groups, as men, will be known by their actions. - Guillermo Moreno

2030 LECTURES. R. Craigen. Inclusion/Exclusion and Relations

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

Transcription:

The Inclusion Exclusion Principle and Its More General Version Stewart Weiss June 28, 2009 1 Introduction The Inclusion-Exclusion Principle is typically seen in the context of combinatorics or probability theory. In combinatorics, it is usually stated something like the following: Theorem 1 (Combinatorial Inclusion-Exclusion Principle). Let A 1, A 2,..., A n be nite sets. Then n A i = n A i1 i 1=1 n 1 n k+1 +... i 1=1 n i 1=1 i 2=i 1+1 n i k =i k 1 +1 A i1 A i2 + n 2 n 1 n i 1=1 i 2=i 1+1 i 3=i 2+1 ( 1) k 1 A i1 A i2... A ik + A i1 A i2 A i3 + ( 1) n 1 A 1 A n. (1) To illustrate, when n = 3, this reduces to 3 A i = Eq. (1) is more succinctly written as 3 2 3 A i A i A j + A 1 A 2 A 3. j=i+1 n A i = S U( 1) S 1 A j (2) j S where U = {1, 2,..., n}. Example. Suppose we ask how many integers less than 120 are relatively prime to it. Since 120 has prime factors 2, 3, and 5, any number that is relatively prime to it is not a multiple of any of these. We can solve this using the Inclusion-Exclusion Principle as follows. Let A = {1, 2,..., 120}, the set of integers from 1 to 120. Let S 1 be the multiples of 2 in A, S 2 be the multiples of 3 in A, and S 3 be the multiples of 5 in A. The set of numbers relatively prime to 120 are the numbers not in S 1 S 2 S 3, so there are 120 S 1 S 2 S 3 many of them. By the theorem, 3 S i = 3 S i 2 3 j=i+1 S i S j + S 1 S 2 S 3 A set such as S 1 obviously has 120/2 = 60 elements. Since a set such as S 1 S 2 is the set of numbers that are multiples of both 2 and 3, it is the set of multiples of 6, and has 120/6 = 20 elements. Applying this idea to the formula, we get 1

3 S i = 3 2 3 S i S i S j + S 1 S 2 S 3 j=i+1 = (60 + 40 + 24) (20 + 12 + 8) + 4 = 124 40 + 4 = 88 so there are 120 88 = 32 numbers less than 120 that are relatively prime to it. 2 Generalized Inclusion-Exclusion Principle The Inclusion-Exclusion Principle actually has a more general form, which can be used to derive the probabilistic and combinatorial versions. This general form, however, is more broadly applicable (which is why it is more general.) It follows. Theorem 2. Let S be a set of N elements and let g and f be functions from the powerset of S into the real numbers with the property that, for any subset A S g(a) = f(s ). Then f(a) = ( 1) A S g(s ). Remark. The theorem takes a while to absorb. Restating it informally, what it says is that if there are two functions f and g, each of which is dened on subsets of a set S, having the property that g(a) is always the sum of the function f applied to every subset of A, including A itself, then it turns out that f(a) can also be expressed as an alternating sum of the function g applied to every subset of A, where what determines whether or not g(s ) is added or subtracted from the sum is whether it has an even or an odd number of elements. Proof. Assume that f and g are functions from the powerset of S into the reals and that, for any subset A S g(a) = f(s ). (3) We show by induction on the cardinality of A that f(a) = ( 1) A S g(s ). (4) To start, let A = 0. Then A is the empty set and has no subsets other than itself. Since the premise is true for this A, g( ) = f( ). Therefore, f( ) = g( ) = ( 1) g( ), so the conclusion is true when A = 0. We now assume that the hypothesis is true for all sets B such that B < n, and we let A be a set of cardinality n. We need to show that if g(a) = f(s ) (5) then Eq. (4) is true. Let us rewrite (5) as follows: g(a) = S A f(s ) + f(a). 2

Any set S such that S A is strictly smaller than A, so S < n and the induction hypothesis applies to it. Therefore for each such S, f(s ) = ( 1) S T g(t ) (6) T S Substituting Eq. (6) into (5), we get g(a) = S A Subtracting and rearranging Eq. (7), we get f(a) = g(a) = ( 1) S T g(t ) + f(a). (7) T S S A ( 1) 1+ S S A T S ( 1) S T g(t ) T S T g(t ) + g(a). (8) Let T be a xed subset in the sum and assume that T = r. Since T A and A = n, r < n. Although T occurs only once in the inner sum T S ( 1)1+ S T g(t ), it may occur multiple times in the entire expression, because it may be a subset of multiple subsets S A. We now do some counting. There are n r elements of A that are not in T. Each of these may be independently included or not in a subset containing T. Therefore, there are 2 (n r) subsets of A that contain T. One of these is A itself. Since we are enumerating only the proper subsets of A, we have to exclude A from the count, so there are 2 (n r) 1 proper subsets S such that T S. Claim 3. Let A be a set such that A = n. Then A has 2 n/2 subsets of even cardinality and 2 n/2 subsets of odd cardinality. Proof. This is easy to prove by induction on the cardinality of A. Claim 4. Let A be a set such that A = n and let T be a subset of A such that T = r. Then A T has 2 (n r)/2 subsets of even cardinality and 2 (n r)/2 subsets of odd cardinality. Proof. This follows from Claim 3. Claim 5. Let A be a set such that A = n and let T be a subset of A such that T = r. Then there are 2 (n r)/2 subsets of A of even cardinality that contain T, and 2 (n r)/2 subsets of A of odd cardinality that contain T. Proof. There is a one-to-one correspondence between the subsets of A T and the subsets of A containing T : for each subset S of A T, there is a unique S T = S T, and for each S T containing T, the set S T T is a unique subset of A T. By Claim 4, the claim is proved. Claim 6. Let A be a set such that A = n and let T be a subset of A such that T = r. Let M = 2 (n r). If n is odd, then there are M/2 proper subsets of A of even cardinality and (M/2) 1 proper subsets of A of odd cardinality containing T. If n is even, then there are M/2 proper subsets of A of odd cardinality and (M/2) 1 proper subsets of A of even cardinality containing T. Proof. The proper subsets of A do not include A. Since the number of even and odd subsets is equal when A is included, then if n is odd, there is one fewer odd subset than even ones, and if n is even, there is one fewer even subset than odd. Consider the coecient ( 1) 1+ S T of g(t ) in Eq. (8). It is either +1 or 1. For a xed subset T, this depends only on whether S is even or odd. Claim 6 established that, for xed T, the number of subsets S containing T and of even cardinality diers from the number of those with odd cardinality by exactly one. Therefore, all but one of the terms ( 1) 1+ S T g(t ) 3

will cancel out, leaving either +g(t ) or g(t ). Suppose r is even, then ( 1) 1+ S T g(t ) = ( 1) 1+ S g(t ). If S is even, ( 1) 1+ S = 1 and if S is odd, then ( 1) 1+ S = 1. Therefore, if the number of even subsets S is one greater than the number of odd subsets S, then the sum of the coecients of all terms containing g(t ) is 1, and if the number of even subsets is one less, then the coecient is +1. Claim 6 shows that when n is odd, there is one more even subset than odd subset and so the sum of the coecients is 1. When n is even, there is one more odd subset than even, and so the sum of the coecients is 1. Therefore, when r is even and n is odd, the coecient of g(t ) is 1 and when r is even andn is even, the coecient of g(t ) is +1. On the other hand, when r is odd, ( 1) 1+ S T g(t ) = ( 1) S g(t ) and the signs reverse, so when n is even and r is odd, the coecient of g(t ) is 1 and when n is odd and r is odd, the coecient of g(t ) is 1. In short, the coecient of g(t ) is ( 1) A T. Therefore f(a) = T g(t ) + g(a) ( 1) 1+ S S A T S = T A( 1) A T g(t ) + g(a) = T A( 1) A T g(t ). This is exactly what we needed to prove, so by the axiom of induction, the theorem is proved. 3 The Combinatorial Version as an Instance of the General Version We now show that Theorem 1 is an instance of Theorem 2. We introduce some notation. Notation. If A and B are sets, then A B is the set of all elements in A that are not in B. This is sometimes called the set dierence between A and B, or the complement of B in A. For example, {1, 2, 3, 4, 5} {3, 4, 6, 7} = {1, 2, 5}. When all of the sets being considered are subsets of some larger, xed universe of discourse U, then we dene, for each set S, the complement of S in U, denoted S, by S = U S. When the universe is understood, for simplicity we call S the complement of S. Suppose that A 1, A 2, A 3,..., A n is a collection of nite sets. Let A = A i. Let U = {1, 2, 3,..., n}. The set U will act as our universe. Let S be a subset of U and dene the function A j A j S U F (S) = j S j S S = U For example, let n = 6 and let S = {3, 4, 5}. Then S = {1, 2, 6} and F (S) = (A 1 A 2 A 6 ) (A 3 A 4 A 5 ). In other words, F (S) is the set of all elements, each of which is in A 1, A 2, and A 6 but not in any of A 3, A 4, or A 5. 4

A1 A2 a d b e f g c A3 Figure 1: Example If it seems at rst that F () is an arcane function with little practical value, then consider the following example, illustrated by Figure 1. Let A 1 = {a, d, e, f}, let A 2 = {b, d, f, g}, and let A 3 = {c, e, f, g}. Let U = {1, 2, 3}. Consider the subset S = {1, 3} of U. For this subset, F (S) = A 2 (A 1 A 3 ) = {b, d, f, g} {a, d, e, f, c, g} = {b}. Notice that {b} is exactly that part of A 2 not in any other set. Note that F ({1}) = (A 2 A 3 ) A 1 = {f, g} {a, d, e, f} = {g}, which is the element in another distinct region of the gure. The function F () is actually creating a partition of the set of all elements, with each cell of that partition corresponding to each one of the 2 n subsets of U. This is the essence of the next two lemmas. Lemma 7. If S 1 U and S 2 U and S 1 S 2, then F (S 1 ) F (S 2 ) =. Proof. Since S 1 S 2, there is a number m such that 1 m n and either m S 1 and m / S 2, or m S 2 and m / S 1. Without loss of generality, we can assume that m S 1 and m / S 2. Suppose that the theorem is false and that F (S 1 ) F (S 2 ) Let x F (S 1 ) F (S 2 ). Since x F (S 1 ), x A j A j. j S 1 j S 1 This implies that Since m S 1, this implies in turn that Since x F (S 2 ), which implies, in particular, that x x / j S 1 A j x / A m. (9) j S 2 A j x j S 2 A j. j S 2 A j Sincem / S 2, m S 2 and so x A m. But this contradicts (9) above, so we have reached a contradiction. Therefore F (S 1 ) F (S 2 ) = and the lemma is proved. Lemma 8. For each x A, there exists a set S U such that x F (S). Proof. Let x A. Then x is in at least one of the sets A i. Let S be the set of all numbers j such that x / A j. If x is a member of all sets A j then S =. Since x / A j for all j S, x / j S A j (10) 5

Suppose k is a number such that k / S. Consider the set A k. Since k / S, A k must contain x. This is true for all of the sets A k for which k / S. In other words, for all k S, x A k. Therefore x k S A k (11) Eqs. (10) and (11) combined show that x j S A j j S A j. which implies that proving the lemma. x F (S) Lemmas 7 and 8 together show that, for each element x of A, there is a unique S U such that x F (S). Therefore, the sum of the cardinalities of the sets F (S) ranging over all subsets S U equals the number of elements in A, i.e., n A i = F (S). S U Let f be dened by and let g be dened by f(s) = F (S). (12) g(s) = A j j S n A j j=1 S U S = U (13) Then g(u) = S U f(s). By Theorem 2, f(u) = S U( 1) U S g(s) Since f(u) = F (U) = 0, 0 = S U( 1) U S g(s) = S U( 1) U S g(s) + g(u) which implies that g(u) = S U( 1) U S 1 g(s) Substituting (), 6

n A j = ( 1) U S 1 g(s) (14) j=1 S U The right-hand side of (14) is a sum over all subsets of U except for U itself. For any subset S U, let T = S. Then S = T. Since T = U T, U T 1 = T 1. Also, g(t ) = A j. Therefore ( 1) U S 1 g(s) = ( 1) U T 1 g(t ) = ( 1) T 1 A j If Eq. (14) is true when the right-hand side ranges over all subsets of U except U, then if we replace the subsets by their complements, Eq. (14) will be true when the right-hand side ranges over all subsets except U =. Therefore, j T j T n A j = j=1 ( 1) T 1 A j (15) =T U j T and replacing the variable T by S we see that this is identical to Eq. (2). This proves that the combinatorial version of the IEP is just a special case of Theorem 2. 7