Professional Documents
Culture Documents
Descrete Q
Descrete Q
Descrete Q
Exercise No. 8
Functions
1. Why is f not a function from R to R if 8. Specify a codomain for each of the functions in
a) f (x) = 1/x? Exercise 7. Under what conditions is each of the
b) f (x) =√𝑥? functions with the codomain you specified onto?
c) f (x) =± √𝑥 2 + 1?
9. Give an explicit formula for a function from the set of
2. Determine whether f is a function from the set of all integers to the set of positive integers that is
bit strings to the set of integers if a) one-to-one, but not onto.
a) f (S) is the position of a 0 bit in S. b) onto, but not one-to-one.
b) f (S) is the number of 1 bits in S. c) one-to-one and onto.
c) f (S) is the smallest integer i such that the ith bit of d) neither one-to-one nor onto.
S is 1 and f (S) = 0 when S is the empty string, the
string with no bits. 10. Determine whether each of these functions is a
bijection from R to R.
3. Find the domain and range of these functions. Note a) f (x) = 2x + 1
that in each case, to find the domain, determine the set b) f (x) = x2 + 1
of elements assigned values by the function. c) f (x) = x3
a) the function that assigns to each bit string the number d) f (x) = (x2 + 1)/(x2 + 2)
of ones in the string minus the number of zeros in the
string 11. Let f : R → R and let f (x) > 0 for all x ∈ R. Show that f
b) the function that assigns to each bit string twice the (x) is strictly decreasing if and only if the function
number of zeros in that string g(x) = 1/f (x) is strictly increasing.
c) the function that assigns the number of bits left over
when a bit string is split into bytes (which are blocks 12. Show that the function f (x) = |x| from the set of real
of 8 bits) numbers to the set of nonnegative real numbers is not
d) the function that assigns to each positive integer the invertible, but if the domain is restricted to the set of
largest perfect square not exceeding this integer nonnegative real numbers, the resulting function is
invertible.
4. Find the domain and range of these functions.
a) the function that assigns to each pair of positive 13. Let f (x) = _x2/3_. Find f (S) if
integers the maximum of these two integers a) S = {−2,−1, 0, 1, 2, 3}.
b) the function that assigns to each positive integer the b) S = {0, 1, 2, 3, 4, 5}.
number of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 that do not c) S = {1, 5, 7, 11}.
appear as decimal digits of the integer d) S = {2, 6, 10, 14}.
c) the function that assigns to a bit string the number of
times the block 11 appears 14. Suppose that g is a function from A to B and f is a
d) the function that assigns to a bit string the numerical function from B to C.
position of the first 1 in the string and that assigns the a) Show that if both f and g are one-to-one functions,
value 0 to a bit string consisting of all 0s then f ◦ g is also one-to-one.
b) Show that if both f and g are onto functions, then
5. Find these values. f ◦ g is also onto.
23. Let a and b be real numbers with a < b. Use the floor
and/or ceiling functions to express the number of
integers n that satisfy the inequality a < n < b.