Page 236 - HOW TO PROVE IT: A Structured Approach, Second Edition
P. 236

P1: PIG/  P2: OYK/
                   0521861241c04  CB996/Velleman  October 20, 2005  2:54  0 521 86124 1  Char Count= 0






                                   222                        Relations
                                   To see that C m is transitive, suppose that x ≡ y (mod m) and y ≡ z (mod
                                   m). Then m | (x − y) and m | (y − z), so by exercise 18(a) in Section 3.3,
                                   m | [(x − y) + (y − z)]. But (x − y) + (y − z) = x − z, so it follows that
                                   m | (x − z), and therefore x ≡ z (mod m). For more about these equivalence
                                   relations, see exercise 10.
                                     Equivalence relations often come up when we want to group together ele-
                                   ments of a set that have something in common. For example, if you’ve studied
                                   vectors in a previous math course or perhaps in a physics course, then you may
                                   have been told that vectors can be thought of as arrows. But you were probably
                                   also told that different arrows that point in the same direction and have the same
                                   length must be thought of as representing the same vector. Here’s a more lucid
                                   explanation of the relationship between vectors and arrows. Let A be the set of
                                   all arrows, and let R ={(x, y) ∈ A × A | the arrows x and y point in the same
                                   direction and have the same length}. We will let you check for yourself that R
                                   is an equivalence relation on A. Each equivalence class consists of arrows that
                                   all have the same length and point in the same direction. We can now think
                                   of vectors as being represented, not by arrows, but by equivalence classes of
                                   arrows.
                                     Students who are familiar with computer programming may be interested in
                                   our next example. Suppose we let P be the set of all computer programs, and
                                   for any computer programs p and q we say that p and q are equivalent if they
                                   always produce the same output when given the same input. Let R ={(p, q) ∈
                                   P × P | the programs p and q are equivalent}. It is not hard to check that R is
                                   an equivalence relation on P. The equivalence classes group together programs
                                   that produce the same output when given the same input.



                                                              Exercises

                                     1. Find all partitions of the set A ={1, 2, 3}.
                                    ∗
                                     2. Find all equivalence relations on the set A ={1, 2, 3}.
                                     3. Let W = the set of all words in the English language. Which of the
                                    ∗
                                       following relations on W are equivalence relations? For those that are
                                       equivalence relations, what are the equivalence classes?
                                       (a) R ={(x, y) ∈ W × W | the words x and y start with the same
                                          letter}.
                                       (b) S ={(x, y) ∈ W × W | the words x and y have at least one letter in
                                          common}.
                                       (c) T ={(x, y) ∈ W × W | the words x and y have the same number of
                                          letters}.
   231   232   233   234   235   236   237   238   239   240   241