1.4
Relations and the equivalence principle
The equivalence principle applies to combinatorial problems that exhibit certain symme- tries. Two canonical problems involve counting the possible ways to seat a group of people around a circular table and counting the possible ways to pair off a group of people, say for the first round of a round-robin tournament. Both problems involve subtleties that we have not yet encountered.
Our purposes in this section are first to lay the groundwork for the equivalence prin- ciple and second to illustrate how to apply it. In Chapter 5, we study P´olya’s enumeration theorem which is a very powerful generalization of the equivalence principle.
Equivalence relation
The equivalence principle rests on the idea of equivalence relation which is one of the most ubiquitous in all of mathematics. Recall that a relation on a set A is a subset of A A. Definition 1.4.1 (equivalence relation) A relation E on a setA is an equivalence relation onA provided that E has the following three properties.
Reflexive: For each a 2 A, .a; a/ 2 E.
Symmetric: For each a; b 2 A, if .a; b/ 2 E then .b; a/ 2 E.
Transitive: For each a; b; c 2 A, if .a; b/ 2 E and .b; c/ 2 E, then .a; c/ 2 E. The idea of equivalence relation abstracts three properties that ordinaryD (equals) enjoys on any set of numbers. It is reflexive (because aD a for any number a), symmetric (order doesn’t matter because a D b and b D a mean the same thing), and transitive (if a D b and bD c then a D c).
It’s customary to write aE b to mean .a; b/ 2 E. With this notation the symmetric property, for example, becomes: for each a; b 2 A, if aEb then bEa. We use the two notations interchangeably.
Examples
(a) One important equivalence relation is congruence modulo n on the set Z of integers. That is, fix a positive integer n and define, for any integers a and b, the relation
a b .mod n/ if and only if nˇˇ.a b/: (1.5) So for example 5 54 .mod 7/ because 5 54 D 49 and 7ˇˇ. 49/. On the other hand, 56 3 .mod 7/ because 5 . 3/ D 8 and 7 is not a factor of 8. (See Exercise 4 for the proof that this is an equivalence relation.)
Question 36 Is45 106 .mod 2/? Is 47 97 .mod 2/? Determine exactly when a b .mod 2/ is true.
(b) Define a relation on the power set of Œ3 by S T if and only if jSj D jT j. In other words, two sets are related when they have the same size. Then for example f3g f1g because both sets have size 1, and f1; 2g f2; 3g because both sets have size 2. However,; 6 f1g because they do not have the same size. This relation is reflexive becausejSj D jSj is true of any set S. It is symmetric because if jSj D jT j thenjT j D jSj. It is transitive because if jSj D jT j and jT j D jU j, then jSj D jU j. It is an equivalence relation.
(c) For any set A, the identity relation on A is the relation IAWD f.a; a/ W a 2 Ag: It is an equivalence relation.
Equivalence class
Given an equivalence relation on a set A and any a2 A, the equivalence class containing ais the set of all elements of A that are related to a.
Definition 1.4.2 (equivalence class) Let E be an equivalence relation on a setA. For any a2 A, the equivalence class containing a is that set
E .a/WD fx 2 A W .a; x/ 2 Eg:
Examples
(a) If E is the congruence modulo 3 relation on the integers, then the equivalence class containing the integer 0 is the set of all integers whose remainder is 0 when divided by 3, i.e., the multiples of 3:
E .0/D f: : : ; 9; 6; 3; 0; 3; 6; 9; : : :g:
The equivalence class containing 1 is the set of all integers whose remainder is 1 when divided by 3:
E .1/D f: : : ; 8; 5; 2; 1; 4; 7; 10; : : :g: Question 37 Find E.2/ and E .40/.
(b) If is the has-the-same-size relation on the power set of Œ3, then the equivalence class containing the setf1g is˚f1g; f2g; f3g .
Question 38 For this same relation, find the equivalence class containing; and the equivalence class containingf2; 3g.
Related elements are in the same equivalence class
This next result says that if two elements are related by an equivalence relation, then their equivalence classes are equal.
Theorem 1.4.3 If E is an equivalence relation on a setA and .a; b/ 2 E, then E.a/ D E .b/.
Proof:Let E be an equivalence relation on a set A, and let .a; b/ 2 E. To prove E.a/ D E .b/, we show that each is a subset of the other.
First, let x 2 E.a/. This means .a; x/ 2 E. Since .b; a/ 2 E because E is symmetric, this implies .b; x/2 E because E is transitive. But then x 2 E.b/. Therefore E.a/ E.b/. The proof that E .b/ E.a/ is similar and left to the Question below. This completes the proof that E .a/D E.b/.
1.4. Relations and the equivalence principle 35
Partition
Definition 1.4.4 (partition) For any setS , a partition of S is a set of nonempty, disjoint subsets ofS whose union is S .
For example, here are three possible partitions of Œ6: P1D˚f1; 6g; f2g; f3; 4; 5g P2D˚f1; 2; 3; 4; 5; 6g
P3D˚f1g; f2g; f3g; f4; 5g; f6g :
The elements of a partition are called the blocks of the partition. Thus P1has three blocks, P2has one block, and P3has five blocks. (We will learn how to count partitions in Sections 2.3 and 3.1.)
Equivalence relations and partitions
The concepts of equivalence relation and partition are intimately related: there is a natural bijection between the equivalence relations on a given set and the partitions of that same set. We now prove this. The first step is to understand how an equivalence relation induces a partition.
Theorem 1.4.5 If E is an equivalence relation on a setA, then the set
P WD˚E .a/W a 2 A (1.6)
of equivalence classes of E is a partition ofA.
Proof:Let E be an equivalence relation on a set A. Following Definition 1.4.4, we first verify that each block of P is nonempty. Let E .a/ be a block of P . Since E is reflexive, we know .a; a/2 E. This means a 2 E.a/, so E.a/ is nonempty. Also, since a 2 E.a/ for all a2 A, we see that the union of the blocks of P equals A.
The last thing to prove is that the blocks of P are disjoint. If P has only one block (namely A itself) then there is nothing to do. So, assume that E .a/ and E .b/ are two differ- ent blocks of P . We must show that they are disjoint.
Suppose they are not disjoint. Then there is some c 2 A for which c 2 E.a/ and c2 E.b/. The first implies that .a; c/ 2 E and the second that .c; b/ 2 E. Transitivity then implies .a; b/2 E. But Theorem 1.4.3 then implies that E.a/ D E.b/, which contradicts our original assumption that these are different blocks of P . Therefore they are disjoint.
Next, we show how a partition induces an equivalence relation.
Theorem 1.4.6 IfP is a partition of a set A, then the relation R on A defined by
RWD˚.a; b/2 A A W a is in the same block of P as is b (1.7) is an equivalence relation onA.
Proof:Let P D fP1; : : : ; Pkg be a partition of the set A. We must prove that the relation Rdefined in (1.7) is an equivalence relation.
Reflexive:Let a2 A. Since P is a partition of A, the element a belongs to exactly one block Pi. Clearly a is in the same block as itself, so .a; a/2 R. Therefore R is reflexive.
Symmetric:Suppose .a; b/ 2 R. This means that a is in the same block of P as b. But then b is in the same block of P as a, so .b; a/2 R. Therefore R is symmetric.
Transitive:Suppose .a; b/2 R and .b; c/ 2 R. This means that a is in the same block of P as b, and also that b is in the same block of P as c. But, since P is a partition and hence each element of A belongs to exactly one block, this means that a is in the same block of P as c, so .a; c/2 R. Therefore R is transitive.
We can now demonstrate the bijection between equivalence relations and partitions. Theorem 1.4.7 IfA is a finite set, then the number of possible equivalence relations on A equals the number of possible partitions ofA.
Proof:Let A be a finite set. We use the bijection principle. Define the sets EWD fE W E is an equivalence relation on Ag PWD fP W P is a partition of Ag
and the function f W E ! P by
f .E /D˚E .a/W a 2 A :
We must prove that this is a bijection. First note that, by Theorem 1.4.5, that f .E / is indeed a partition of A.
One-to-one: Let E1 and E2 be two unequal equivalence relations on A. This means, without loss of generality, that there exists a 2-list .a1; a2/in E1but not E2.
Since .a1; a2/ 2 E1, we know that a2 2 E1.a1/and hence that a1and a2are in the same block of the partition f .E1/. But since .a1; a2/62 E2, we know that a262 E2.a1/and hence that a1and a2are not in the same block of the partition f .E2/. Therefore these two partitions are not the same: f .E1/6D f .E2/.
Onto:Let P be a partition of A. Construct the set E shown in (1.7), which Theorem 1.4.6 guarantees is an equivalence relation. Then it quickly follows that f .E /D P , for the equivalence classes of E are exactly the blocks of P .
The equivalence principle
Now we return to counting and show how to exploit equivalence relations for combinatorial purposes.
Example: counting circular arrangements
In how many ways can we seat a group of four people around a circular table? Consider two seatings the same provided that each person has the same left- and right-neighbors.
Let Œ4 be the set of people. Begin with the 4Š D 24 permutations of Œ4, and then consider two permutations equivalent if, when placed around a table, each person has the same left- and right-neighbors. Given a permutation such as .3; 4; 2; 1/, it is equivalent to itself and three other permutations, namely
.3; 4; 2; 1/ .4; 2; 1; 3/ .2; 1; 3; 4/ .1; 3; 4; 2/
where we have used to denote the equivalence relation. These are obtained by rotating the original seating .3; 4; 2; 1/ around the table. They are equivalent because any such
1.4. Relations and the equivalence principle 37 rotation preserves each person’s left- and right-neighbors. Each permutation’s equivalence class has size 4, so our initial count of 4Š must be too large by a factor of 4. The answer is thus 4Š=4D 6.
It is helpful to arrange all 24 permutations according to their equivalence classes: class 1: .1; 2; 3; 4/ .2; 3; 4; 1/ .3; 4; 1; 2/ .4; 1; 2; 3/ class 2: .1; 2; 4; 3/ .2; 4; 3; 1/ .4; 3; 1; 2/ .3; 1; 2; 4/ class 3: .1; 3; 2; 4/ .3; 2; 4; 1/ .2; 4; 1; 3/ .4; 1; 3; 2/ class 4: .1; 3; 4; 2/ .3; 4; 2; 1/ .4; 2; 1; 3/ .2; 1; 3; 4/ class 5: .1; 4; 2; 3/ .4; 2; 3; 1/ .2; 3; 1; 4/ .3; 1; 4; 2/ class 6: .1; 4; 3; 2/ .4; 3; 2; 1/ .3; 2; 1; 4/ .2; 1; 4; 3/
Notice that we counted equivalence classes (there are six) and not permutations (24).
Statement of the principle
The previous example typifies the use of the equivalence principle: make an over-count, introduce an equivalence relation, and then divide the over-count by the size of each equiv- alence class. The equivalence principle only applies when all the equivalence classes have the same size. Chapter 5, on P´olya’s theory of counting, extends the equivalence principle to when the equivalence classes have unequal sizes.
Theorem 1.4.8 (equivalence principle) Let E be an equivalence relation on a finite set A. If for some positive integer C every equivalence class of E has size C , then E hasjAjC equivalence classes.
Proof:Assume that E is an equivalence relation on a finite set A, and also that there exists a positive integer C such that every equivalence class of E has size C . Let k be the number of equivalence classes of E . We need to prove that kD jAj=C .
By Theorem 1.4.5, the equivalence classes of E partition A. Say this partition into equivalence classes isfP1; P2; : : : ; Pkg. This means, in particular, that
jP1j C jP2j C C jPkj D jAj:
ButjPij D C for all i, so the equation reads kC D jAj, or k D jAj=C .
Question 40 In how many ways can we seat a group ofn people around a circular table?
Example: counting pairings
In how many different ways can we arrange 10 people into five pairs?
Let Œ10 be the set of people. Consider the 10Š permutations of Œ10, of which one example is .3; 2; 9; 10; 1; 5; 8; 7; 4; 6/. Then build an arrangement from each permutation by placing adjacent pairs together. The example permutation leads to the pairing
f3; 2g f9; 10g f1; 5g f8; 7g f4; 6g:
Consider two permutations of Œ10 equivalent if they result in the same pairing. There are many permutations of Œ10 that are equivalent to the given permutation. If we swap the position of the elements in positions 1 and 2, and/or those in positions 3 and 4, and so on, we obtain the same pairing. Using to denote the equivalence relation, one way to do this on the example permutation is
.3; 2; 9; 10; 1; 5; 8; 7; 4; 6/ .3; 2; 10; 9; „ƒ‚… swap 1; 5; 7; 8; „ƒ‚… swap 6; 4 „ƒ‚… swap /:
We may also rearrange the positions of the pairs as a unit, as in . 3; 2; „ƒ‚… pair 1 9; 10; „ƒ‚… pair 2 1; 5; „ƒ‚… pair 3 8; 7; „ƒ‚… pair 4 4; 6 „ƒ‚… pair 5 / . 8; 7; „ƒ‚… pair 4 3; 2; „ƒ‚… pair 1 9; 10; „ƒ‚… pair 2 4; 6; „ƒ‚… pair 5 1; 5 „ƒ‚… pair 3 /:
Question 41 Give two permutations equivalent to.10; 9; 8; 7; 6; 5; 4; 3; 2; 1/ under. In general, any permutation of Œ10 is equivalent to 25 5Š D 3840 permutations, cor- responding to the 25ways to rearrange the pairs and the 5Š ways to order the pairs. By the equivalence principle, there are
10Š
25 5ŠD 945
different ways to pair 10 people into five pairs. In fact, we have counted the number of partitions of Œ10 into five blocks where each block has size 2.
Question 42 In how many different ways can we arrange2n people into n pairs?
Example: formula for
knHere is how to use the equivalence principle to justify the formula kn D .n/k
kŠ that we mentioned in Section 1.1. First we examine the special case nD 5 and k D 3. How many 3-subsets does the set Œ5 have?
First list all of the 3-permutations of Œ5, of which there are .5/3 D 60. They are shown in Figure 1.5. Recall that order matters in a permutation but not in a set. Let’s define the following equivalence relation on the set of 3-permutations: consider two 3-permutations equivalent if they contain exactly the same elements. This an equivalence relation. Also, each equivalence class has size 3Š because there are 3Š ways to reorder the three elements. (The boxes in Figure 1.5 delineate the equivalence classes.) By the equivalence principle there are .5/3
3Š equivalence classes. Each equivalence class corresponds to a different 3- subset of Œ5, so the number of 3-subsets of Œ5 is.5/3
3Š . Question 43 Now generalize to prove the formula nkD .n/k
kŠ .
Are they equivalence relations?
We didn’t formally prove that the notions of equivalence used in the last three examples were indeed equivalence relations. For many examples a justification along informal lines would suffice. In the circular arrangement question, one could do this for “equivalent under rotation” as follows. Is any seating of four people equivalent to itself? Yes, just don’t rotate it. Also if seating A is equivalent to seating B via some rotation, then B is equivalent to seating A by reversing the original rotation. Finally, if A is equivalent to B and B to C, then A is equivalent to C by composing the two rotations.
An application of the equivalence principle that requires a relatively complex equiva- lence relation should include a proof of such. However, many don’t.
Summary
An equivalence relation is a relation on a set that is reflexive, symmetric, and transitive. There is a natural correspondence between an equivalence relation on a set and a partition of that set. That an equivalence relation partitions a set leads to the equivalence principle.
1.4. Relations and the equivalence principle 39 .1; 2; 3/ .1; 2; 4/ .1; 2; 5/ .1; 3; 4/ .1; 3; 5/ .1; 3; 2/ .1; 4; 2/ .1; 5; 2/ .1; 4; 3/ .1; 5; 3/ .2; 1; 3/ .2; 1; 4/ .2; 1; 5/ .3; 1; 4/ .3; 1; 5/ .2; 3; 1/ .2; 4; 1/ .2; 5; 1/ .3; 4; 1/ .3; 5; 1/ .3; 1; 2/ .4; 1; 2/ .5; 1; 2/ .4; 1; 3/ .5; 1; 3/ .3; 2; 1/ .4; 2; 1/ .5; 2; 1/ .4; 3; 1/ .5; 3; 1/ .1; 4; 5/ .2; 3; 4/ .2; 3; 5/ .2; 4; 5/ .3; 4; 5/ .1; 5; 4/ .2; 4; 3/ .2; 5; 3/ .2; 5; 4/ .3; 5; 4/ .4; 1; 5/ .3; 2; 4/ .3; 2; 5/ .4; 2; 5/ .4; 3; 5/ .4; 5; 1/ .3; 4; 2/ .3; 5; 2/ .4; 5; 2/ .4; 5; 3/ .5; 1; 4/ .4; 2; 3/ .5; 2; 3/ .5; 2; 4/ .5; 3; 4/ .5; 4; 1/ .4; 3; 2/ .5; 3; 2/ .5; 4; 2/ .5; 4; 3/ f1; 2; 3g f1; 2; 4g f1; 2; 5g f1; 3; 4g f1; 3; 5g f1; 4; 5g f2; 3; 4g f2; 3; 5g f2; 4; 5g f3; 4; 5g Figure 1.5.The 3-permutations of Œ5 and their corresponding 3-subsets.
When we use the equivalence principle we re-cast the original problem as one of counting the equivalence classes of a convenient equivalence relation. It applies only when each equivalence class has the same size.
Exercises
1. Consider a small version of the problem solved in this section: How many ways are there to arrange four people into two pairs? Write out all the permutations of Œ4 and then group them into equivalence classes. What is the size of each equivalence class and what then is the answer to the original question?
2. Let AD Œn. What are, respectively, the maximum and minimum possible size of an equivalence relation on A? Prove that you are correct.
3. Let E be an equivalence relation on a set A. What is E 1? Prove your answer. 4. Prove that congruence modulo n, as defined in (1.5) on page 33, is an equivalence
relation on Z.
5. Fill in the blank and then prove the statement: An equivalence relation on A is a
function A ! A if and only if .
6. Let f W A ! B. Define a relation on A by a1 a2if and only if f .a1/D f .a2/. Give a quick proof that this is an equivalence relation. What are the equivalence classes? Explain intuitively.
7. Solve the circular seating arrangements problem for four people, but with two seatings considered equivalent provided that each person has the same set of neighbors. (I.e., we don’t distinguish between left- and right-neighbors.)
8. How many ways are there to seat five women and five men around a circular table if the seating alternates man-woman-man-woman, etc.?
9. In how many ways can we arrange 10 chairs of nine different colors (there are two chairs of one color, hence they are indistinguishable) around a circular table? 10. In how many ways can we split a group of 10 people into two groups of size 3 and
one group of size 4?
11. How many partitions of Œn into two blocks are there? How many partitions of Œn into n 1blocks are there?
12. Prove that the product of any k consecutive positive integers is divisible by kŠ. 13. Use the equivalence principle to prove the formula .n/k D .n k/ŠnŠ . In other words,
count the k-permutations of Œn by first counting the permutations of n (of which there are nŠ) and then defining an appropriate equivalence relation on the set of permutations of Œn.
14. Use the equivalence principle to prove the formula nkD nŠ
kŠ .n k/Š. (This requires a different proof than the one we gave in this section, because the numerator here is nŠ and not .n/k. That is, your equivalence relation should be on the set of permutations of Œn, not on the set of k-permutations of Œn.)
15. How many different necklaces can we make from n beads of different colors? Con- sider two necklaces the same if (like in a circular arrangement) one can be obtained from the other via rotation or if (unlike in a circular arrangement) one can be obtained from the other via flipping the necklace over.
16. Let R1and R2be equivalence relations on a set A.
(a) Is R1[ R2an equivalence relation on A? Prove or disprove. (b) Is R1\ R2an equivalence relation on A? Prove or disprove.