I'm trying to do a proof of a floor function being onto, but I'm not sure where to go from here. I don't want to ask the question outright because I want to figure it out myself, but I know that if you want to prove a function is onto, say:
$$
y = 3x+1
$$
Would be to swap it to terms of x, and we'd get
$$
x = (y-1)/3
$$
But the equation I'm dealing with is:
$$
y=\left \lfloor{\frac{x+1}{2}}\right \rfloor
$$
How would I go about proving this is onto?
(Would have signed in, but stackexchange was not letting me today)
Best Answer
If the domain and codomain are both $\mathbb Z$, then $x = 2n-1$ gives you $y=n$. It is onto.