2345_2019-Spring-HW4-Functions-Solutions.pdf - Math 2345 \u2013 Discrete Mathematics Homework 4 Function Theory Solutions Due Date Monday(beginning of

# 2345_2019-Spring-HW4-Functions-Solutions.pdf - Math 2345...

• Homework Help
• 6

This preview shows page 1 - 3 out of 6 pages.

Homework 4: Functions Solutions Math 2345 – Discrete Mathematics Homework 4: Function Theory Solutions Due Date: Monday, March 04, 2019 (beginning of class) Problem 4.1 (Function Basics).(a) LetA={1,2,3}andB={a, b}. This question asks you to list functions. For each function, express it intwo ways: (1) as a set of ordered pairs, and (2) using an arrow diagram.i. Write out all functions fromAtoB.ii. Write out all functions fromBtoA.(b) For each statement below, use anarrow diagramto provide an example satisfying the statement, or clearlystate why no example exists. i. A function from{a, b, c, d}to{1,2,3}that has a range of cardinality two.ii. A functionffrom{1,2,3,4}to{a, b, c}such thatf(2) =f(1).iii. An onto function from{a, b, c, d}to{1,2}.iv. A functionffrom{a, b, c, d}to{1,2,3}such that1has two preimages underf.v. A one-to-one function from{1,2,3,4}to{a, b, c}.vi. A bijective function from{1,2,3,4}to{1,2,3,4}that is not an identity map. Solution 4.1. (a) i. There are exactly 2 3 = 8 functions. 1 2 3 a b 1 2 3 a b 1 2 3 a b 1 2 3 a b { (1 , a ) , (2 , a ) , (3 , a ) } { (1 , b ) , (2 , b ) , (3 , b ) } { (1 , a ) , (2 , a ) , (3 , b ) } { (1 , a ) , (2 , b ) , (3 , a ) } 1 2 3 a b 1 2 3 a b 1 2 3 a b 1 2 3 a b { (1 , b ) , (2 , a ) , (3 , a ) } { (1 , a ) , (2 , b ) , (3 , b ) } { (1 , b ) , (2 , a ) , (3 , b ) } { (1 , b ) , (2 , b ) , (3 , a ) } ii. There are exactly 3 2 = 9 functions. a b 1 2 3 a b 1 2 3 a b 1 2 3 { ( a, 1) , ( b, 1) } { ( a, 1) , ( b, 2) } { ( a, 1) , ( b, 3) } a b 1 2 3 a b 1 2 3 a b 1 2 3 { ( a, 2) , ( b, 2) } { ( a, 2) , ( b, 1) } { ( a, 2) , ( b, 3) } a b 1 2 3 a b 1 2 3 a b 1 2 3 { ( a, 3) , ( b, 3) } { ( a, 3) , ( b, 1) } { ( a, 3) , ( b, 2) }
Homework 4: Functions Solutions (b) a b c d 1 2 3 1 2 3 4 a b c a b c d 1 2 i. ii. iii. a b c d 1 2 3 Impossible 1 2 3 4 1 2 3 4 iv.v.vi.Problem 4.2 (Images & Preimages).(a) Suppose thatBnis the set of bitstrings of lengthnandY={0,1, . . . , n}. TheHamming distancefunctionf:Bn× BnYis a function that measures how “different” two bitstings are by checking how many bitpositions they differ in. More precisely, ifsandtare two bitstrings of lengthn, thenf((s,t)) =the number of positions wheresandthave different values.For example, ifn= 5, thenf((01100,11101)) = 2whilef((00000,11111)) = 5.i. Ifn= 7, find the image of(0011101,1100011)underf.ii. Ifn= 3