CSE 215: Foundations of Computer Science Recitation Exercises Set #9 Stony Brook University Name: ID#: Section #: Score: / 4 Unit 14: Set Theory: Definitions and Properties 1. Let C = {n Z n = 6r 5 for some integer r} and D = {m Z m = 3s + 1 for some integer s}. Prove or disprove each of the following statements. a. C D This is true. We will show that every element of C is in D. Suppose n is any element of C. Then n = 6r 5 for some integer r. Let s = 2r 2. Then s is an integer (because products and differences of integers are integers) and 3s + 1 = 3(2r 2) + 1 = 6r 6 + 1 = 6r 5 which equals n. Thus n satisfies the condition for being in D. Hence, every element in C is in D. b. D C This is false, since there are elements of D that are not in C. For example, 4 is in D because 4 = 3 1 + 1. But 4 is not in C because if it were, then 4 = 6r 5, for some integer r, which would imply that 9 = 6r, or, equivalently,that r = 3, which contradicts the fact that r is an integer. 2 2. Let D i = {x R i x i} = [ i, i] for all non-negative integers i. a. 4 i=0 D i =? 4 i=0 D i = {0} [ 1, 1] [ 2, 2] [ 3, 3] [ 4, 4] = [ 4, 4] b. 4 i=0 D i =? 4 i=0 D i = {0} [ 1, 1] [ 2, 2] [ 3, 3] [ 4, 4] = {0} c. Are D 0, D 1, D 2,... mutually disjoint? Explain. D 0, D 1, D 2,... are not mutually disjoint, each D k D k+1. CSE 215 R01/R02/R06 Page 1 of 9
3. Let the universal set be the set R of all real numbers and let A = {x R 0 < x 2}, B = {x R 1 x < 4} and C = {x R 3 x < 9}. Find each of the following: a. A B b. A c A B = {x R 0 < x < 4} A c = {x R x 0 or x > 2} c. A C A C = d. A c B c A c B c {x R x 0 or x 4} e. (A B) c (A B) c {x R x < 1 or x > 2} CSE 215 R01/R02/R06 Page 2 of 9
4. Use an element argument to prove the following statement. Assume all sets are subsets of a universal set U. For all sets A and B, (A B) (A B c ) = A. Proof that (A B) (A B c ) A: Suppose x (A B) (A Bc). [We must show that x A.] By definition of union, x A B or x (A B c ). Case 1: (x A B): In this case x is in A and x is in B, and so, in particular, x A. Case 2: (x A B c ): In this case x is in A and x is not in B, and so, in particular, x A. Thus, in either case, x A [as was to be shown]. [Thus (A B) (A B c ) A by definition of subset.] Proof that A (A B) (A B c ): Suppose x A. [We must show that x (A B) (A B c ).] Either x B or x B. Case 1: (x B): In this case we know that x is in A and we are also assuming that x is in B. Hence, by definition of intersection, x A B. Case 2: (x A B c ): In this case we know that x is in A and we are also assuming that x is in B c. Hence, by definition of intersection, x A B c. Thus, x A B or x A B c, and so, by definition of union, x (A B) (A B c ) [as was to be shown. Thus A (A B) (A B c ) by definition of subset.] Conclusion: Since both set containments have been proved, it follows by definition of set equality that (A B) (A B c ) = A. CSE 215 R01/R02/R06 Page 3 of 9
5. Use an element argument to prove the following statement. Assume all sets are subsets of a universal set U. For all sets A, B and C, A (B C) = (A B) (A C). Proof: Suppose A, B, and C are arbitrarily chosen sets. A (B C) (A B) (A C): Suppose (x, y) A (B C). [We must show that (x, y) (A B) (A C).] Then x A and y B C. By definition of union, this means that y B or y C. Case 1 (y B): Then, since x A, (x, y) A B by definition of Cartesian product. Hence (x, y) (A B) (A C) by the inclusion in union property. Case 2 (y C): Then, since x A, (x, y) A C by definition of Cartesian product. Hence (x, y) (A B) (A C) by the inclusion in union property. Hence, in either case, (x, y) (A B) (A C) [as was to be shown]. Thus A (B C) (A B) (A C) by definition of subset. (A B) (A C) A (B C): Suppose (x, y) (A B) (A C). Then (x, y) A B or (x, y) A C. Case 1 ((x, y) A B): In this case, x A and y B. By definition of union, since y B, then y B C. Hence x A and y B C, and so, by definition of Cartesian product, (x, y) A (B C). Case 2 ((x, y) A C): In this case, x A and y C. By definition of union, since y C, then y B C. Hence x A and y B C, and so, by definition of Cartesian product, (x, y) A (B C). Thus, in either case, (x, y) A (B C). [Hence, by def- inition of subset, (A B) (A C) A (B C).] [Since both subset relations have been proved, we can con- clude that A (B C) = (A B) (A C) by definition of set equality.] CSE 215 R01/R02/R06 Page 4 of 9
6. Illustrate one of the distributive laws by shading in the region corresponding to A (B C) on one copy of the diagram and (A B) (A C) on the other. 7. Use the element method for proving a set equals the empty set to prove the following statement. Assume that all sets are subsets of a universal set U. For all sets A and B, (A B) (A B c ) =. Proof by contradiction: Suppose not. That is, suppose there exist sets A and B such that (A B) (A B c ) 6=. Then there is an element x in (A B) (A B c ). By definition of intersection, x (A B) and x (A B c ). Applying the definition of intersection again, we have that since x (A B), x A and x B, and since x (A B c ), x A, and x 6 B. Thus, in particular, x B and x 6 B, which is a contradiction. It follows that the supposition is false, and so (A B) (A B c ) =. CSE 215 R01/R02/R06 Page 5 of 9
8. Use the element method for proving a set equals the empty set to prove the following statement. Assume that all sets are subsets of a universal set U. For all sets A, B and C, if C B A, then A C =. Proof by contradiction: Let A, B, and C be any sets such that C B A. Suppose A C. Then there is an element x such that x A C. By definition of intersection, x A and x C. Since C B A, then x B and x A. So x A and x A, which is a contradiction. Hence the supposition is false, and thus A C = CSE 215 R01/R02/R06 Page 6 of 9
Unit 15: Set Theory: Disproofs and Algebraic Proofs 9. Given the statement below, prove that the statement if it is true or find a counterexample if the statement is false. Assume all sets are subsets of a universal set U. For all sets A, B, and C, if A C and B C then A B C. True. Proof: Suppose A, B, and C are sets and A C and B C. Let x A B. By definition of union, x A or x B. But if x A then x C (because A C), and if x B then x C (because B C). Hence, in either case, x C. [So, by definition of subset, A B C.] 10. Given the statement below, prove that the statement if it is true or find a counterexample if the statement is false. Assume all sets are subsets of a universal set U. For all sets A and B, if A B then P(A) P(B). True. Proof: Suppose A and B are any sets with A B. [We must show that P(A) P(B).] So suppose X P(A). Then X A by definition of power set. But because A B, we also have that X B by the transitive property for subsets, and thus, by definition of power set, X P(B). This proves that for all X, if X P(A) then X P(B), and so P(A) P(B) [as was to be shown]. CSE 215 R01/R02/R06 Page 7 of 9
11. Given the statement below, prove that the statement if it is true or find a counterexample if the statement is false. Assume all sets are subsets of a universal set U. For all sets A and B, P(A B) P(A) P(B). False. Counterexample: For any sets A and B, P(A) P(B) contains only sets that are subsets of either A or B, whereas the sets in P(A B) can contain elements of both A and B. Thus, if at least one of A or B contains elements that are not in the other set, P(A) P(B) and P(A B) will not be equal. For instance, let A = {1} and B = {2}. Then {1, 2} P(A B) but {1, 2} / P(A) P(B). 12. Construct an algebraic proof for the following statement, citing a relevant property for every step. For all sets A, B, and C, (A B) C = (A C) (B C). Proof: Let sets A, B, and C be given. Then (A B) C = C (A B) by the commutative law for = (C A) (C B) by the distributive law = (A C) (B C) by the commutative law for. CSE 215 R01/R02/R06 Page 8 of 9
13. Construct an algebraic proof for the following statement, citing a relevant property for every step. For all sets A and B, ((A C B C ) A) C = A. Proof: Let A and B, be any sets. Then ((A C B C ) A) C = ((A C B C ) A C ) C by the set difference law = (A C B C ) C (A C ) C by De Morgan s law = ((A C ) C (B C ) C ) (A C ) C by De Morgan s law = (A B) A by the double complement law = A (A B) by the commutative law for = A by the absorption law CSE 215 R01/R02/R06 Page 9 of 9