October 2, 1995 cs330 - Discrete Structures =========================== Fall 1995 Hw #2 - Solutions ================= Note: In the following solutions V stands for the universal quantifier E stands for the existential quantifier ^ stands for conjunction v stands for disjunction == means equal != means not equal For the sake of readability, I've left a space between succesive quantifiers. 10/34 ==== a) Vx F(x, Jerry) b) Vx F(Evelyn, x) or Vy F(Evelyn, y) whichever you prefer c) Vx Ey F(x, y) d) ~Ex Vy F(x, y) e) Vx Ey F(y, x) f) ~Ex (F(x, Fred) ^ F(x, Jerry)) g) Ex Ey((x!=y) ^ F(Nancy, x) ^ F(nancy, y) ^ Vz(F(Nancy, z) -> ((z==x) v (z==y)))) h) Ex(VyF(y, x) ^ Vz(VyF(y, z) -> (z==x))) i) Vx ~F(x, x) j) Ex(F(x, x) ^ Ey(F(x, y) ^ Vz(F(x, z) -> (z==y)))) 16/35 ===== L(x) = "x likes mathematics" S(x) = "x has never seen a computer" T(x, y) = "x has taken the math class y at this school" B(x, r) = "x has been in r" I(r, b) = "r in b" a) x in the set {students in this class} Vx L(x) ~(Vx L(x)) = Ex ~L(x) "There is a student in this class who does not like mathematics" or "Some student in this class does not like mathematics" b) x in the set {students in this class} Ex S(x) ~(Ex S(x)) = Vx ~S(x) "every student in this class has seen a computer" c) x in the set {students in this class} y in the set {math classes} Ex VyT(x, y) ~(Ex VyT(x, y)) = Vx Ey ~T(x, y) "every student in this class has not taken some math course" d) x in the set {students in this class} r in the set {rooms} b in the set {buildings on campus} Ex Vb Er(I(r, b) ^ B(x, r)) ~(Ex Vb Er(I(r, b) ^ B(x, r))) = Vx Eb Vr ~(I(r, b) ^ B(x, r)) <=> Vx Eb Vr (~I(r, b) v ~B(x, r)) "For every student in this class there exists a building such that for every room, either that room is not in the building or the student has not been in that room" 20/36 ===== x in the set {animals} for all parts of this problem a) Vx(P(x) -> ~S(x)) b) ~Ex(R(x) ^ ~S(x)) c) Vx(Q(x) -> P(x)) d) Vx (Q(x) -> ~R(x)) 10/45 ===== a) 0 no elements in the empty set b) 1 one element in the set, this is {} c) 2 the elements are {} and {{}} d) 3 the elements are {}, {{}} and {{},{{}}} 20/45 ===== a) AxBxC = { (a,x,0), (a,x,1), (a,y,0), (a,y,1), (b,x,0), (b,x,1), (b,y,0), (b,y,1), (c,x,0), (c,x,1), (c,y,0), (c,y,1) } b) CxBxA = { (0,x,a), (0,x,b), (0,x,c), (0,y,a), (0,y,b), (0,y,c), (1,x,a), (1,x,b), (1,x,c), (1,y,a), (1,y,b), (1,y,c) } c) CxAxB = { (0,a,x), (0,a,y), (0,b,x), (0,b,y), (0,c,x), (0,c,y), (1,a,x), (1,a,y), (1,b,x), (1,b,y), (1,c,x), (1,c,y) } d) BxBxB = { (x,x,x), (x,x,y), (x,y,x), (x,y,y), (y,x,x), (y,x,y), (y,y,x), (y,y,y) } 6/70 ==== a) injective easy to check that for every x1!=x2 we have f(x1)!=f(x2) b) not injective because f(a)=f(b)=b c) not injective because f(a)=f(d)=d 8/70 ==== a) injective assume f(x1) = f(x2) which means x1-1 = x2-1 x1 = x2 which completes the proof. b) not injective f(2)=f(-2)=5 yet 2 does not equal -2 c) injective f(x1) = f(x2) x1^3 = x2^3 x1^3 - x2^3 = 0 (x1 - x2)(x1^2 + x1*x2 + x2^2) = 0 (x1 - x2) = 0 (the other paranthesis is always non-zero!) x1 = x2 which completes the proof d) non-injective ceiling(3/2) = ceiling(4/2) = 2 12/70 ===== a) f(S) = {1} b) f(S) = {-1, 1, 5, 9, 15} c) f(S) = {0, 1, 2} d) f(S) = {0, 1, 5, 16}