[Math] Determining if Function is 1:1 or Onto

elementary-set-theory

I'm trying to solve the following question:

Given function $ \displaystyle f\colon \mathbb Z \rightarrow \mathbb Z,$ where $f(n) = \lfloor {\frac {n}{3}} \rfloor$, determine if it's $1:1$, and onto; and prove why.

I could say that it is onto, because it will always have an element in the codomain that maps to the domain. It is also not one to one, because the floor would result in multiple numbers with the same floor (like $ \frac {1}{3}$ and $ \frac {2}{3}$ both having the floor $0$). But how can I actually prove these?

Best Answer

Look at the definition of $1$-$1$ function. See what happens, when you plugin $3$ and $4$ to $f$. You have $$f(3) = \biggl\lfloor{\frac{3}{3}\biggr\rfloor} = 1 = \biggl\lfloor{\frac{4}{3}\biggr\rfloor}=f(4)$$

but $3 \neq 4$ hence it is not $1$-$1$. Note that if you want to prove a function is one-one, then you have to show whenever $f(a)=f(b) \Longrightarrow a=b$.

To prove that it is onto, for each integer $n$ we want integer $m$ such that $\bigl\lfloor{\frac{m}{3}\bigr\rfloor} = n$. Doesn't $m=3n$ finish the job?

Related Question