This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 6.042/18.062J Mathematics for Computer Science March 29, 2005 Srini Devadas and Eric Lehman Problem Set 7 Solutions Due: Monday, April 4 at 9 PM Problem 1. Every function has some subset of these properties: injective surjective bijective Determine the properties of the functions below, and brieﬂy explain your reasoning. x (a) The function f : R R defined by f ( x ) = e . → Solution. This function is injective, since e x takes on each nonnegative real value for exactly one x . However, the function is not surjective, because e x never takes on negative values. Therefore, the function is not bijective either. x (b) The function f : R R + defined by f ( x ) = e . → Solution. The function e x takes on every nonnegative value for exactly one x , so it is injective, surjective, and bijective. (c) The function f : R → R defined by f ( x ) = ( x + 1) x ( x − 1) . Solution. This function is surjective, since it is continuous, it tends to + ∞ for large positive x , and tends to −∞ for large negative x . Thus, the function takes on each real value for at least one x . However, this function is not injective, since it takes on the value at x = − 1 , x = 0 , and x = 1 . Therefore, the function is not bijective either. (d) Let S be the set of all 20bit sequences. Let T be the set of all 10bit sequences. Let f : S T map each 20bit sequence to its first 10 bits. For example: → f (11110110101101010010) = 1111011010 Solution. This function is surjective since the sequence b 1 b 2 . . . b 10 is mapped to by b 1 b 2 . . . b 10 00 . . . , for example. However, the function is not injective, because this sequence is also mapped to by b 1 b 2 . . . b 10 11 . . . 1 . Consequently, the function is not bijective either. Problem 2. There are 20 books arranged in a row on a shelf. 2 Problem Set 7 (a) Describe a bijection between ways of choosing 6 of these books so that no two adjacent books are selected and 15bit sequences with exactly 6 ones. Solution. There is a bijection from 15bit sequences with exactly six 1’s to valid book selections: given such a sequence, map each zero to a nonchosen book, each of the first five 1’s to a chosen book followed by a nonchosen book, and the last 1 to a chosen book. For example, here is a configuration of books and the corresponding binary sequence: 1 1 1 1 1 1 Selected books are darkened. Notice that the first fives ones are mapped to a chosen book and an nonchosen book in order to ensure that the binary sequence maps to a valid selection of books. (b) How many ways are there to select 6 books so that no two adjacent books are selected? Solution. By the Bijection Rule, this is equal to the number of 15bit sequences with exactly 6 ones, which is equal to 15! 15 = 6! 9! 6 by the Bookkeeper Rule....
View
Full Document
 Spring '11
 Dr.EricLehman
 Computer Science, Finite set, injective surjective bijective

Click to edit the document details