Download 8 Solved Problems - Assignment - Discrete Structures | CMSC 250 and more Assignments Discrete Structures and Graph Theory in PDF only on Docsity! CMSC 250 - Homework 14 - Fall 2002 - Answers 1) Write a bijective function from the set of odd integers to the set of positive integers. Example function: F: Zodd Z+ F(x) = if x<0 then abs(x)*2, else 2x-1 (a) Prove that the function is onto. Example solution based on above function: Prove that ∀y∈ Z+, ∃x∈Zodd such that F(x)=y Let y be a generic particular element in Z+ Find x such that F(x)=y Case 1: y is even Rewrite y as 2i, i∈ Z by the definition of even numbers Let x = -1 * i x is an integer by closure of integers under * F(-i) = 2i by function F F(-i) = y by substitution So, we have constructed x such that F(x) = y. Case 2: y is odd Rewrite y as 2i+1, i∈Z+ by the definition of odd numbers and y being positive Let x = i+1 x is a positive integer by closure of positive integers under + F(i+1) = 2(i+1)-1 by function F F(i+1) = 2i-1 by algebra F(i+1) = y by substitution So, we have constructed x such that F(x) = y. Since we have proven F(x)=y for both cases, and these two cases form a partition of the possible values for y, we have shown that ∀y∈ Z+, ∃x∈Zodd such that F(x)=y by generalizing from the generic particular. (b) Prove that the function is one-to-one. Example solution based on above function: Prove that ∀a,b∈ Zodd, F(a)=F(b) a=b Let a and b be generic particular elements in Zodd Assume that F(a)=F(b) Case 1: F(a) and F(b) are even a and b are negative by definition of F abs(a)*2 = abs(b)*2 by substitution abs(a) = abs(b) by algebra a = b by definition of abs() and the fact that a and b are negative Case 2: F(a) and F(b) are odd 2a-1 = 2b-1 by substitution 2a = 2b by algebra a = b by algebra Since we have proven a=b for both cases, and these two cases form a partition of the possible values of F(a) and F(b), we can conclude a=b ∀a,b∈ Zodd, F(a)=F(b) a=b by closing the conditional world and generalizing from the generic particular 2) Let A = {x∈Z | -5 < x < 5} and B = {-25, -17, -16, -4, -2, 1, 2, 3, 7, 9, 13, 16}. Define relation R from A to B as aRb ↔ a2=b. (a) Is 3R9? Answer: Yes (b) Is –4R16? Answer: Yes (c) Is (5, -25) in R? Answer: No (5 is not in A) (d) Is (2, 4) in R? Answer: No (4 is not in B) 3) Define the binary relation S from Z to Z as aSb ↔ 5 | (b-a). (a) Is 7S2? Answer: Yes (b) Is 3S9? Answer: No (c) Is (4, -1) ∈ S? Answer: Yes (d) Is (5, 10) ∈ S? Answer: Yes (e) Give three values (if possible) for n that makes 3Sn true. Answers: (examples) 8, 13, 18 (f) Give three values (if possible) for n that makes 7Sn true. Answers: (examples) 2, 7, 12 (g) Give three values (if possible) for n that makes -2Sn true. Answers: (examples) 3, 8, 13 (h) Is S reflexive? Explain why or show why not. Answer: Yes. Show that ∀x∈Z xSx Choose generic particular integer x. Show that xSx is true. x-x = 0 by algebra 0 = 5 * 0 by algebra 5 | 0 by definition of divisibility 5 | x-x by substitution xSx by definition of S ∀x∈Z xSx by generalizing from the generic particular Therefore S is reflexive by the definition of reflexive. (i) Is S symmetric? Explain why or show why not. Answer: Yes. Show that ∀a,b∈Z aSb bSa Choose generic particular integers a, b Assume aSb 5 | b-a by the definition of S b-a=5k (for some integer k) by the definition of divisibility b=5k+a by algebra a-b = a-(5k+a) by substitution a-b = 5k by algebra 5|a-b by definition of divisibility bSa by definition of S ∀a,b∈Z aSb bSa by closing the conditional world and generalizing from the generic particular Therefore S is symmetric by the definition of symmetric.