[Injection & Surjection] Is my work correct on whether these functions are injective/surjective?

28 viewed last edited 3 years ago
Peyton Tran
The book provides answers only to the surjective parts, not the injective parts. I want to see if I got the injective questions correct along if I got the surjective questions for the right reason. It isn't enough (to me personally) to know I got the surjective parts right/wrong, I want to know I got them right for valid reasons. This is not homework, just me studying ahead on my own. If I made a mistake, what do I need to fix? Functions from Z to Z. **Question 1:** f(n) = n - 1 Injective: yes 1-1 if f(x)=f(y) -> x=y x-1 = y-1 x=y Surjective: yes. f(x)=x-1 y = x-1 x=y+1 f^-1 (y) = y+1 this is onto. **Question 2:** f(n)= n^2 + 1 Injective: no x^2 + 1 = y^2 + 1 x^2 = y^2 x = +/- sqrt(y) f has to have a unique mapping from the domain to codomain. Surjective: no f(x) =x^2 + 1 y= x^2 +1 x^2 = y-1 x = +/- sqrt(y-1) f^-1 (y) = +/- sqrt(y-1) If y=0 then +sqrt(-1) is not an element of the codomain Z. **Question 3:** f(n)=n^3 Injective: yes x^3 = y^3 (x^3 )^1/3 = (y^3)^1/3 x = y Surjective: no y=x^3 x^3 = y (x^3)^(1/3) = y^(1/3) x = y^1/3 f^-1 (y) = y^1/3 If y=1 then 1^(1/3) is not an element of the codomain Z. [Edit: change y=1 to y=2 then this is now correct.]
Mahesh Godavarti
Your question is a little hard to understand. Let me answer by properly formatting it. Question 1: f(n) = n - 1 . Is it injective? What you did is correct. Although, personally, I would not use x \text{ and } y for integer variables. I would have used k, l \text{ or } m . \text{Let } f(x) = f(y) \implies x - 1 = y - 1 \implies x = y . Therefore, the function f(n) = n - 1 is injective. Is it surjective? You did the following: f(x) = x - 1 \implies y = x - 1 \implies x = y + 1 \implies f^{-1}(y) = y + 1 . This step is also correct. As you have shown that for every value of y there exists at least one value of x that is mapped to y . Question 2: f(n) = n^2 + 1 . Is it injective? You showed the following: \text{Let } f(x) = f(y) \implies x^2 + 1 = y^2 + 1 \implies x^2 = y^2 \implies x = \pm y . Therefore, it is not true that f(x) = f(y) \implies x = y . This function is not injective. Is it surjective? You did the following: \text{Let } y = x^2 + 1 \implies x = \pm \sqrt{y - 1} . If y = 0 then x = \pm \sqrt{-1} is not an element of \mathbb{Z} . This is correct, however, you could have simply stated that for f(n) = n^2 + 1 the co-domain only consists of positive integers greater than or equal to 1 . Therefore, f(n) = n^2 + 1 cannot be surjective. Question 3: f(n)=n^3 . Is it injective? You did the following. f(x) = f(y) \implies x^3 = y^3 \implies x = y . Therefore, f(n) = n^3 is injective. Is it surjective? You did the following: y=x^3 \implies x^3 = y \implies (x^3)^{1/3} = y^{1/3} \implies x = y^{1/3} \implies f^{-1} (y) = y^{1/3} Therefore, If y=2 then 2^{1/3} is not an element of the codomain \mathbb{Z} . This is fine, but you can simple claim that codomain consists only of cubes, therefore, not all elements of codomain have a value in domain that map to it.