COS 550 F08 HW #7 DUE Thursday 11/06/08 1. (30 points). Partitions and Equivalence Relations. Please prove the following result. a. State carefully the definition of an equivalence relation. b. If R is an equivalence relation on X and a is an element of X, let [a] = { b in X | aRb }. Prove that if b is in [a], then a is in [b]. c. If R is an equivalence relation on X, and a and b are in X prove that either [a] = [b] or [a] and [b] have an empty intersection. d. Define a partition of a set. e. Show that if R is an equivalence relation on X, the collection { [a] | a is in X } is a partition of X. f. Suppose X is a set and P = { S1, S2, ..., Sk } is a partition of X. Define a relation R on X by aRb iff there is an i such that a and b are both in Si. Prove R is an equivalence relation. 2. (50 points). Fractions. Let Z be the integers ({0, -1, 1, -2, 2, …}) and Z0 = Z – {0}. Let W = Z x Z0. Define a relation R on W as follows: (a,b)R(c,d) iff ad = bc. a. Prove that R is an equivalence relation. b. Define [(a,b)] + [(e,f)] to be [(af+be),bf)] 1. Prove that + is well-defined on the equivalence classed of R. In other words, if you use difference representatives from equivalence classes and apply the + operator you end up in the same equivalence class. 2. Prove that + is commutative and associative. 3. Prove that for every (a,b) there is a (c,d) such that [(a,b)] + [(c,d)] = [(0,1)]. c. Define [(a,b)]*[(c,d)] = [(ac,bd)]. 1. Prove that * is well-defined on the equivalence classes of R. 2. Prove that * is commutative and associative. 3. Prove that for each (a,b) not in [(0,1)], there exists (c,d) such that [(a,b)]*[(c,d)] = [(1,1)]. 4. Prove the distributive law: [(a,b)]*([(c,d)]+[(e,f)]) = ([(a,b)]*[(c,d)])+([(a,b)]*[(e,f)]). 3. (20 points) Write programs to implement the equivalence relationship and operations defined in problem 2 above. Show some non-trivial examples that will verify that R is well-defined and that show that the various associative, commutative and distributive laws hold.