ñòð. 10 |

Proof. For, modulo 2,

IAâ—¦(Bâ—¦C) = IA + IBâ—¦C = IA + IB + IC = IAâ—¦B + IC = I(Aâ—¦B)â—¦C mod 2.

Thus P (S) is a group under â—¦. Checking the group axioms we get:

â€¢ Given A, B âˆˆ P (S), A â—¦ B âˆˆ P (S) â€” closure,

â€¢ A â—¦ (B â—¦ C) = (A â—¦ B) â—¦ C â€” associativity,

â€¢ A â—¦ âˆ… = A for all A âˆˆ P (S) â€” identity,

â€¢ A â—¦ A = âˆ… for all A âˆˆ P (S) â€” inverse.

We note that A â—¦ B = B â—¦ A so that this group is abelian.

3.1.1 De Morganâ€™s Laws

Â¯Â¯

1. A âˆ© B = A âˆª B

Proposition.

Â¯Â¯

2. A âˆª B = A âˆ© B

Proof.

IAâˆ©B = 1 âˆ’ IAâˆ©B = 1 âˆ’ IA IB

= (1 âˆ’ IA ) + (1 âˆ’ IB ) âˆ’ (1 âˆ’ IA )(1 âˆ’ IB )

= IA + IB âˆ’ IAâˆ©B

Â¯ Â¯ Â¯Â¯

= IAâˆªB .

Â¯Â¯

Â¯ Â¯

We prove 2 by using 1 on A and B.

A more general version of this is: Suppose A1 , . . . , An âŠ† S. Then

Â¯

n n

Ai = Ai

1. i=1 i=1

Â¯

n n

Ai = Ai .

2. i=1 i=1

These can be proved by induction on n.

3.1.2 Inclusion-Exclusion Principle

Note that |A| = sâˆˆS IA (s).

Theorem 3.1 (Principle of Inclusion-Exclusion). Given A1 , . . . , An âŠ† S then

(âˆ’1)|J|âˆ’1 |AJ | , where AJ =

|A1 âˆª Â· Â· Â· âˆª An | = Ai .

iâˆˆJ

âˆ…=JâŠ†{1,...,n}

3.1. SETS AND INDICATOR FUNCTIONS 25

Proof. We consider A1 âˆª Â· Â· Â· âˆª An and note that

IA1 âˆªÂ·Â·Â·âˆªAn = IA1 âˆ©Â·Â·Â·âˆ©An

Â¯ Â¯

= IA1 IA2 . . . IAn

Â¯ Â¯ Â¯

= (1 âˆ’ IA1 )(1 âˆ’ IA2 ) . . . (1 âˆ’ IAn )

(âˆ’1)|J| IAJ ,

=

JâŠ†{1,...,n}

Summing over s âˆˆ S we obtain the result

(âˆ’1)|J| |AJ | ,

A1 âˆª Â· Â· Â· âˆª An =

JâŠ†{1,...,n}

which is equivalent to the required result.

Just for the sake of it, weâ€™ll prove it again!

Proof. For each s âˆˆ S we calculate the contribution. If s âˆˆ S but s is in no Ai then

there is a contribution 1 to the left. The only contribution to the right is +1 when J = âˆ….

If s âˆˆ S and K = {i âˆˆ {1, . . . , n} : s âˆˆ Ai } is non-empty then the contribution to the

k

right is IâŠ†K (âˆ’1)|I| = i=0 k (âˆ’1)i = 0, the same as on the left.

i

Example (Eulerâ€™s Phi Function).

1

Ï†(m) = m 1âˆ’ .

p

p prime

p|m

n

Solution. Let m = i=1 pai , where the pi are distinct primes and ai âˆˆ N. Let Ai be

i

Â¯

n

the set of integers less than m which are divisible by pi . Hence Ï†(m) = i=1 Ai .

Now |Ai | = pi , in fact for J âŠ† {1, . . . , m} we have |AJ | = Q m pi . Thus

m

iâˆˆJ

m m m

Ï†(m) = m âˆ’ âˆ’ âˆ’ Â·Â·Â· âˆ’

p1 p2 pn

m m m m

+ + + Â·Â·Â· + + Â·Â·Â· +

p1 p2 p1 p3 p2 p3 pnâˆ’1 pn

.

.

.

m

+ (âˆ’1)n

p1 p2 . . . pn

1

=m 1âˆ’ as required.

p

p prime

p|m

Example (Derangements). Suppose we have n psychologists at a meeting. Leaving

the meeting they pick up their overcoats at random. In how many ways can this be

done so that none of them has his own overcoat. This number is Dn , the number of

derangements of n objects.

CHAPTER 3. SETS, FUNCTIONS AND RELATIONS

26

Solution. Let Ai be the number of ways in which psychologist i collects his own coat.

Â¯ Â¯

Then Dn = A1 âˆ© Â· Â· Â· âˆ© An . If J âŠ† {1, . . . , n} with |J| = k then |AJ | = (n âˆ’ k)!.

ñòð. 10 |