Assignment4_solutions

# Assignment4_solutions - MACM 101 Discrete Mathematics I...

This preview shows pages 1–2. Sign up to view the full content.

Exercises on Functions and Induction. Due: Tuesday, November 10th (at the beginning of the class) Reminder: the work you submit must be your own. Any collabora- tion and consulting outside resourses must be explicitely mentioned on your submission. Please, use a pen. 30 points will be taken oﬀ for pencil written work. 1. Find the domain and range of the following function f . It assigns to each string of bits (that is, of 0s and 1s) the number equal to twice of the number of zeros in that string. For example f (011001010101010) = 16. Solution By deﬁnition f assigns a value to “each string of bits” thus the domain is the set of all bit strings. It’s easy to see that the range is the set of all positive even numbers. An odd number can not be a value of f since the value is twice the number of zeros. Any even number 2 k has a preimage: a string of k zeros. 2. Determine whether or not the function f : Z × Z Z is onto, if f (( m,n )) = m - n . Solution Yes it is onto. For any number k we have f (( k, 0)) = k - 0 = k . 3. Give an explicit formula for a function from the set of all integers to the set of positive integers that is onto but is not one-to-one. Solution The formula is f ( x ) = | x | + 1. That is f ( x ) is the absolute value of x plus 1. The deﬁnition is correct because for any integer except for zero | x | is a positive integer and | x | + 1 is a positive integer. For 0 we shall have f (0) = 1. 1

This preview has intentionally blurred sections. Sign up to view the full version.

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

### Page1 / 4

Assignment4_solutions - MACM 101 Discrete Mathematics I...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online