33 PS4 Solutions

33 PS4 Solutions - Handout #33 April 30, 2010 CS103 Robert...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Handout #33 April 30, 2010 CS103 Robert Plummer PS4 Solutions Problem 1. Determine whether the relation R on the set of all integers is reflexive, symmetric, antisymmetric and/or transitive, where (x,y) is in R if and only if: a) x = y+1 or x = y‐1 b) x is a multiple of y c) x and y are both negative or both nonnegative d) x = y2 e) x y2 a) Symmetric b) Reflexive, transitive c) Reflexive, symmetric d) Antisymmetric e) Antisymmetric, transitive Problem 2. (included with PS3 solutions) Problem 3. Suppose R is an equivalence relation on set A, and that a and b are elements of A. Prove that the following three statements are equivalent: (i) aRb (ii) [a] = [b] (iii) [a] [b] Recall from lecture that [a] = {x | (a, x) R}. So [b] = = {x | (b, x) R}. (i) (ii). Suppose aRb. Note that bRa by symmetry of R. Suppose that x [a], which means that aRx. Since bRa by transitivity of R, bRx by transitivity of R. Thus x [b]. Since (x [a]) (x [b]), we have [a] [b]. A similar argument shows that [b] [a], so [a] = [b]. (ii) (iii). Suppose [a] = [b]. bRb by reflexivity of R, so b [b]. aRb, so b [a]. Since b is in both sets, [a] [b] . (iii) (i). Suppose [a] [b] . The x (aRx bRx). ThenxRb by symmetry of R, and aRb by transitivity of R. These three proofs establish the equivalence of the three statements. Problem 4. (included with PS3 solutions) 2 Problem 5. Suppose that R and S are reflexive relations on a set A. Prove or disprove that R o S is reflexive. Proof: R o S = {(x, y) | x A , y A, and there is some z A such that xSz and zRy}. Since R and S are reflexive relations on A, (a,a) S and (a,a) R for every a A. Thus we see that (a,a) R o S (where z = a). Problem 6. Let R1*, R2* and (R1 R2)* be the reflexive closures of R1, R2 and R1 R2 respectively, where R1* = R1 {(x, x)|x A} R2* = R2 {(x, x)|x A} (R1 R2)* = (R1 R2) {(x, x)|x A} Then, we have R1* R2* = (R1 {(x, x)|x A}) (R2 {(x, x)|x A}) = (R1 R2) {(x, x|x A)} (Commutative, Idempotent Laws) = (R1 R2)* Problem 7. To prove that (P(A),) is a poset, we need to show that ⊆is a reflexive, antisymmetric and transitive on P(A) (the power set of A). 1. Reflexivity S P(A), S S since every set is a subset of itself. So is reflexive on P(A). 2. Antisymmetry S, T P(A), if S T and T S, then S = T , because two sets are equal if and only if they are subsets of each other. So is antisymmetric on P(A). 3. Transitivity Simple version: S, T, V P(A), S T and T V → S V , so is transitive on P(A). Full version: S, T, V P(A), by definition of subset, we have S T T V x ((x S → x T ) (x T → x V )) → x (x S → x V ) (Hypothetical syllogism) S V (Definition of subset) Since S T T V → S V , is transitive on P(A). Hasse diagram of (P(A), ) for A = {1, 2, 3}: 3 Problem 8. a. f(x) = ‐3x + 4 Yes, it is a one‐to‐one correspondence (bijection). Note that f(x) is invertible as: f ‐1(y) = (4 ‐ y)/3, and (4 ‐ y)/3 is in R for any value of y in R . A function is only invertible if it is a one‐to‐one correspondence. b. f(x) = ‐3x2 + 7 No, it is not a one‐to‐one correspondence (bijection). Note that f is not one‐to‐one since f(1) = 4 = f(‐1), but clearly ‐1 ≠ 1. c. f(x) = (x + 1)/(x + 2) No, it is not a one‐to‐one correspondence (bijection). Note that f is not a one‐to‐one correspondence since there is no value of x such that f(x) = 1, so f is not onto. As x get large in either the positive or negative direction, f(x) approaches 1 asymptotically, but never reaches it. It can also be argued that that f is not a one‐to‐one correspondence because f is not actually a function from R to R since f(‐2) is undefined. This would also be a valid justification for why f is not a one‐to‐one correspondence. d. f(x) = x5 + 1 Yes, it is a one‐to‐one correspondence (bijection). Note that f is invertible as: f ‐1(y) = (1‐y)1/5, and (1‐y)1/5 is in R for any value of y in R (the 5th root of a negative real number is just a negative real number – there is never an imaginary component). A function is only invertible if it is a one‐to‐one correspondence. Problem 9. Let g be a function from A to B and f be a function from B to C. Prove or disprove: if g and f are both one‐to‐one and onto, then (f o g) is one‐to‐one and onto. 4 First, we show that f o g is one‐to‐one: (direct proof) To show that f o g is one‐to‐one, we need to show if (f o g)(a) = (f o g)(a’) for elements a and a’ in A, then a = a’. Since this statement is vacuously true when the antecedent is false, we only care about the case where the antecedent is true (and need to show that the consequent is also true). So, we assume (f o g)(a) = (f o g)(a’) and need to show a = a’. 1. (f o g)(a) = (f o g)(a’) means that f(g(a)) = f(g(a’)) Definition of composition 2. Let b = g(a) and b’ = g(a’), where b and b’ are in B Just defining variables 3. f(b) = f(b’) Substituting step 2 into step 1 4. Since f is one‐to‐one, f(b) = f(b’) implies b = b’, and thus g(a) = g(a’) Definition of one‐to‐one 5. Since g is one‐to‐one, g(a) = g(a’) implies a = a’. Definition of one‐to‐one Since, through the steps above we see that (f o g)(a) = (f o g)(a’) implies a = a’, it follows that f o g is one‐to‐one by definition. Now, we show that f o g is onto: (direct proof) To show that f o g is onto, we need to show that for every element c in C, there is an element a in A such that (f o g)(a) = c. Let c be any element in C. Since f is onto, c = f(b) for some b in B. Now, since g is onto, b = g(a) for some a in A. Hence, c = f(b) = f(g(a)) = (f o g)(a). Thus, since for any element c in C, we have shown there is an element a in A such that c = (f o g)(a), it follows that f o g is onto (by definition). Problem 10. Suppose f is a function from a set A to a set B, and suppose that S and T are subsets of A. Show that (a) f(S T) = f(S) f(T) (b) f(S T) f(S) f(T) Recall that we defined functions like this: Given two sets A and B, a function f : A B is a subset of A B such that (a) If x A, there exists y B such that (x, y) f, and (b) If (x, y) f and (x, z) f, then y = z. So, a function is a set of ordered pairs from A B and is thus a special kind of relation. If (x, y) f, we write f(x) = y. 5 We also need to define the notation f(S), where S A: (i) f(S) = {y | x(x S (x,y) f)}. Using the other notation, f(S) = {y | x(x S y = f(x))} We could also write it like this: y f(S) x(x S (x,y) f), or y f(S) x(x S y = f(x)) (a) f(S T) = {y | x(x (S T) (x,y) f)} (i) above Def. union = {y | x((x S x T) (x,y) f)} = {y | x((x S (x,y) f ) ((x T) (x,y) f))} De Morgan = {y | x((x S (x,y) f )) x( ((x T) (x,y) f))} *** y f(S) y f(T) (i) above = {y | (y f(S)) (y f(T))} Rewriting = f(S) f(T) Def. union The step *** uses the fact that x(P(x) Q(x)) xP(x) xQ(x), which we may not have stated previously. (a) (alternate) It's also possible to do the traditional proof of set equality, i.e., a membership proof in both directions. The steps are essentially the same as the above and the reverse of the above. (b) Show f(S T) f(S) f(T). Suppose y f(S T). Then there must be an x such that x (S T) and y = f(x), by (i) above. But x (S T) means x S, so y f(S); and also x T, so y f(T). Since y is in both sets, y (f(S) f(T)). That's all we need to show to have f(S T) f(S) f(T). ...
View Full Document

This document was uploaded on 02/08/2011.

Ask a homework question - tutors are online