[Math] How to tell if a function is onto or one-to-one

discrete mathematicsfunctions

I'm practicing what we learned in lecture today and unfortunately I have little to no understanding about the material. I only know the difference of these functions only when a diagram is present (and I can't always have that, so I need to learn how to figure it out without one)

So I've provided an example from my textbook (not assigned work)

Question: Determine whether each of these functions from $\mathbb{Z}$ to $\mathbb{Z}$ is one-to-one

$a$) $f(n)=n-1$ (ANS: onto)

$b$) $f(n)=n^2+1$ (ANS: one-to-one)

I know the answers only since I looked in the back, but have no idea why. Can someone please explain? I will be using the answers as a base to complete the rest of the questions for study.

Best Answer

One of the answers is wrong. $f(n) = n^2 +1$ is not one-to-one, it is two-to one. (Do you understand what I mean?). The reason why $f(n) = n-1$ is onto, is because for any integer $m$, the successor integer, $m+1$ corresponds to it. Explicitly, $f(m+1) = (m+1) -1 = m$

Related Question