Discrete Math Solution To Functions 2 PDF

Title Discrete Math Solution To Functions 2
Course Discrete Math
Institution Wilfrid Laurier University
Pages 4
File Size 90.5 KB
File Type PDF
Total Downloads 96
Total Views 130

Summary

Solution to Weekly course Quiz content ...


Description

MA 238: Discrete Mathematics Solutions to Functions Shenwei Huang Winter 2018 1. Determine whether f is a function from Z to R if √ (a) f (n) = ±n. (b) f (n) = n2 + 1. (c) f (n) = n2 1−4 . Solution. (a) No. This is because the images are not unique. (b) Yes. (c) No. This is because when n = ±2 the value assigned by f is ∞ that is not a real number. 2. Let f : {1, 2, 3, 4} → {a, b, c, d, e} such that f (1) = a, f (2) = b, f (3) = c and f (4) = d. Determine the domain, codomain and range of f . Solution. The domain is {1, 2, 3, 4}, the codomain is {a, b, c, d, e}, and the range is {a, b, c, d}. 3. Find the domain and range of these functions. Note that in each case, to find the domain, determine the set of elements assigned values by the function. (a) the function that assigns to each bit string the number of ones in the string minus the number of zeros in the string. (b) the function that assigns to each bit string twice the number of zeros in that string. (c) the function that assigns the number of bits left over when a bit string is split into bytes (which are blocks of 8 bits). (d) the function that assigns to each positive integer the largest perfect square not exceeding this integer. Solution. (a) The domain is the set of bit strings and the range is the set of nonnegative integers. (b) The domain is the set of bit strings and the range is the set of nonnegative even integers. (c) The domain is the set of bit strings and the range is the set {0, 1, 2, 3, 4, 5, 6, 7}. 1

(d) The domain is Z+ and the range is the set {1, 4, 9, 16, . . .}. 4. The floor function ⌊x⌋ is the function that assigns to every real number x the largest integer that does not exceed x, and the ceiling function ⌈x⌉ is the function that assigns to every real number x the smallest integer that is at least as large as x. For example, ⌊3.14⌋ = 3 and ⌈3.14⌉ = 4, and ⌊−1.2⌋ = −2 and ⌈−1.2⌉ = −1. Determine the domain, codomain and range of the floor function and the ceiling function. Solution. For both floor and ceiling functions, the domain is R and the codomain and the range are Z. 5. For each of the following functions from Z to Z determine whether it is one-toone or onto. (a) f (n) = n − 1

(b) f (n) = n2 + 1

(c) f (n) = n3

(d) f (n) = ⌈n/2⌉

Solution. (a) The function is one-to-one and onto. If two element n1 and n2 in Z are different, then f (n1 ) 6= f (n2 ). For any n ∈ Z we find that f (n + 1) = n.

(b) The function is neither one-to-to nor onto. Since 1 and −1 have the same image 2, f is not one-to-one. Since −1 has no preimage, f is not onto. (c) The function is one-to-one but not onto. Since there is no integer n such that n3 = 2, f is not onto. If x, y ∈ Z with x 6= y, then x3 6= y3 . Hence, f is one-to-one. (d) The function is onto but not one-to-one. Since f (1) = f (2) = 1, f is not one-to-one. For any integer x we find that f (2x) = x. Hence, f is onto. 6. Give an example of a function from Z to Z that is (a) one-to-one but not onto. (b) onto but not one-to-one. (c) both onto and one-to-one (but different from the identity function). (d) neither one-to-one nor onto.

Solution. There are many valid answers. For instance, one could take the four functions in (5). 7. Suppose that g is a function from A to B and f is a function from B to C . (a) Show that if both f and g are one-to-one functions, then f ◦ g is also oneto-one. (b) Show that if both f and g are onto functions, then f ◦ g is also onto. Solution. (a) We prove the statement as follows. Let x, y ∈ A be that x and y have the same image under f ◦ g. That is, (f ◦ g)(x) = (f ◦ g )(y). By the definition of composition, f (g(x)) = (f ◦ g)(x) = (f ◦ g )(y) = f (g(y)). Since f is one-to-one, it follows that g(x) = g(y). Then we have x = y since g is one-to-one. 2

(b) We prove the statement as follows. Let c ∈ C. Since f is onto, there exists an element b ∈ B such that f (b) = c. Since g is onto, there exists an element a ∈ A such that g(a) = b. Thus, c = f (b) = f (g(a)) = (f ◦ g)(a) by the definition of composition. We haven shown that every element in C has a preimage and so f ◦ g is onto. 8. Suppose that g is a function from A to B and f is a function from B to C . (a) If f and f ◦ g are one-to-one, does it follow that g is one-to-one? Justify your answer. (b) If f and f ◦ g are onto, does it follow that g is onto? Justify your answer. Solution. (a) Yes. Let x, y ∈ A such that g(x) = g(y). Then (f ◦ g)(x) = (f ◦ g )(y). Since f ◦ g is one-to-one, it follows that x = y. So, g is one-to-one. (b) No. Let A = {1, 2}, B = {a, b} and C = {c}. Define f : B → C such that f (a) = f (b) = c and g : A → B such that g(1) = g (2) = a. Then f ◦ g is the function such that (f ◦ g )(1) = (f ◦ g )(2) = c. Clearly, both f and f ◦ g are onto but g is not onto. 9. Let f (x) = ax2 and g(x) = bx + c be functions from R to R, where a, b and c are constants. Compute f ◦ g and g ◦ f . Determine for which constants a, b and c it is true that f ◦ g = g ◦ f . Solution. By the definition of composition, (f ◦ g)(x) = f (g (x)) = a(bx + c)2 = ab2 x2 + 2abcx + ac2 . (g ◦ f )(x) = g(f (x)) = bax2 + c.

Note that f ◦ g = g ◦ f if and only if the corresponding coefficients are equal, i.e., ab2 = ab, 2abc = 0, ac2 = c. This is equivalent to ab(b − 1) = 0,

abc = 0,

c(ac − 1) = 0.

If c 6= 0, then the third equation implies that ac = 1 and so b = 0 by the second equation. Otherwise c = 0 and then the second and third equations are satisfied. It follows from the first equation that a = 0, b = 0 or b = 1. Therefore, the constants a, b, c that make f ◦ g = g ◦ f true are those (a, b, c) such that b = 0 and ac = 1, or a 6= 0, b ∈ {0, 1} and c = 0, or a = c = 0 and b can be any number. 10. Let f be the function that converts a temperature in degrees Celsius to a temperature in degrees Fahrenheit: F = f (C) =

9 C + 32. 5

Find f −1 and explain in words what f −1 does. Solution. To find f −1 , we solve for C in the equation F =59C + 32, and obtain that C = 95 (F −32). The inverse function f −1 converts a temperature in degrees Fahrenheit to a temperature in degrees Celsius. 3

11. Show that the function f (x) = ex from the set of real numbers to the set of real numbers is not invertible, but if the codomain is restricted to the set of positive real numbers, the resulting function is invertible. Solution. If the codomain is R, then any real number that is at most 0 has no preimage since ex > 0 for any x ∈ R. Therefore, the function is not invertible. On the other hand, if the codomain is R+ , then f is a one-to-one-correspondence and the inverse function is ln x. 12. Show that the function f (x) = ax + b from R to R is invertible, where a and b are constants, with a 6= 0, and find the inverse of f . Solution. We first show that f is one-to-one. Suppose that f (x1 ) = f (x2 ) for two real numbers x1 and x2 , namely ax1 + b = ax2 + b. Then we have that x1 = x2 since a 6= 0. This shows that f is one-to-one.

Now let y ∈ R. Then the equation y = f (x) = ax + b has a unique solution x = y−b since a 6= 0. This shows that every real number y has a preimage a . Hence, f is onto. x = y−b a

Therefore, f is a one-to-one correspondence or equivalently invertible. The in. verse function is f −1 (x) = x−b a

4...


Similar Free PDFs