Docsity

8 Solved Problems - Assignment - Discrete Structures | CMSC 250, Assignments of Discrete Structures and Graph Theory

Toggle sidebar
bg1
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∈Zby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
pf3
pf4

Partial preview of the text

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-

(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+ 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

  1. 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 a R b ↔↔↔↔ a^2 =b. (a) Is 3 R 9? Answer : Yes (b) Is –4 R 16? 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)

  1. Define the binary relation S from Z to Z as a S b ↔↔↔↔ 5 | ( b - a ). (a) Is 7 S 2? Answer : Yes (b) Is 3 S 9? 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 3 S n 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 x S x Choose generic particular integer x. Show that x S x is true. x-x = 0 by algebra 0 = 5 * 0 by algebra 5 | 0 by definition of divisibility 5 | x-x by substitution x S x by definition of S ∀x∈ Z x S x 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 a S b

b S a Choose generic particular integers a, b Assume a S b 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 b S a by definition of S ∀a,b∈ Z a S b

b S a by closing the conditional world and generalizing from the generic particular Therefore S is symmetric by the definition of symmetric.

(c) Is V transitive? Prove your answer. Answer Yes Proof: Show that ∀i,j,k∈ Z i V j and j V k

i V k Choose generic particular integers i, j, k Assume i V j and j V k i-2 | j-2 from assumption j-2 | k-2 from assumption j-2 = x(i-2) for some integer x by definition of divisibility j = x(i-2)+2 by algebra j = ix-2x+2 by algebra k-2 = y(j-2) for some integer y by definition of divisibility k-2 = y(ix-2x+2-2) by substitution k-2 = y(ix-2x) by algebra k-2 = xy(i-2) by algebra let z = xy, z is an integer by closure of integers under multiplication Since k-2 = z(i-2) for some integer z, i-2 | k-2 by the definition of divisibility i V k by the definition of V ∀i,j,k∈ Z i V j and j V k

i V k by closing conditional world and generalizing from generic particular

  1. Given set A = {a, b, c, d} and binary relation W = {(a,a), (b,b), (b,d), (c,c), (d,b), (d,d) } Find all of the distinct equivalence classes of W. Answer : {a} {b,d} {c}

  2. Given the binary relation P defined as ∀a,b∈ Z (a,b)∈ P ↔ 4 | (a-b), use set notation to describe each of the equivalence classes of relation P. Answer : [0] = {x∈Z | x=4y for some integer y} [1] = {x∈Z | x=4y+1 for some integer y} [2] = {x∈Z | x=4y+2 for some integer y} [3] = {x∈Z | x=4y+3 for some integer y}

  3. Given the binary relation J defined as ∀a,b,c,d∈ Z ((a,b),(c,d))∈ J ↔ad=bc, prove that it is an equivalence relation. Answer : Prove that it is reflexive, symmetric, transitive. Reflexive Prove ∀a,b∈ Z ((a,b),(a,b))∈ J Rewrite as ∀a,b∈ Z ab=ab Choose generic particular integers a,b ab=ab by math ∀a,b∈ Z ((a,b),(a,b))∈ J by generalizing from the generic particular Symmetric Prove ∀a,b∈ Z ((a,b),(b,a))∈ J Rewrite as ∀a,b∈ Z ab=bb Choose generic particular integers a,b ab=ab by commutativity of multiplication ∀a,b∈ Z ((a,b),(b,a))∈ J by generalizing from the generic particular Transitive – It Is Not Transitive – 0 is a problem, but we accepted the following if you didn’t notice that you were dividing by 0. Proof for Z ≠≠≠≠^0 ∀a,b,c,d,e,f∈ Z ((a,b),(c,d))∈ J and ((c,d),(e,f))∈ J

((a,b),(e,f))∈ J Rewrite as ∀a,b,c,d,e,f∈ Z ad=bc and cf=de

af=be Choose generic particular integers a,b,c,d,e,f, Assume ad=bc and cf=de f = de/c by algebra a = bc/d by algebra af = bc/d * de/c by substitution af = be by algebra ∀a,b,c,d,e,f∈ Z ad=bc and cf=de

af=be by closing conditional world and generalizing from generic particular