3

Is the function $\lfloor x/2\rfloor$ injective or surjective? If so why? The domain is $\mathbb R$ and the co-domain is $\mathbb Z$. I think it is not injective as if we take x to be $20$ and $y$ to be $21$, we end up with $f(x)=10=f(y)$, but $x$ is not equal to $y$. I know that to check for surjection, we have to solve in terms of $x$, but since this is a floor function, I'm not sure what to do with the floor symbol while solving for $x$.

Thanks in advance.

mrtaurho
  • 16,103
tom786
  • 59
  • Welcome to MSE. Adding your own try in the question body will increase the chance of getting more help. – VIVID Dec 17 '20 at 17:35
  • 7
    Do you know the definition of injective and surjective? Do you know what intuitive notions those definitions try to capture? – Arthur Dec 17 '20 at 17:35
  • @VIVID Arthur Sorry, I have added some more information for more clarity. – tom786 Dec 17 '20 at 17:43
  • "I'm not sure what to do with the floor symbol while solving for x." Ah! Subtle point. As $f$ is not injective you CAN'T solve for a unique $x$. You must solve for a set of possible values. And it's easy to do once you "wrap your head around it". $f(x) =[\frac x2] = k\implies k \le \frac x2 < k+1\implies 2k \le x < 2k+2$ so the solution SET is $x \in [2k,2k+2)$. So for any $k\in \mathbb Z$ there are an INFINITE number of solutions of any $x\in[2k,2k+2)$. But as you only need one we can pick: for any $k\in \mathbb Z$, $f(2k+1) = k$, so $f$ is surjective. – fleablood Dec 17 '20 at 18:23

4 Answers4

3

"I'm not sure what to do with the floor symbol while solving for x."

Ah! Subtle point. As $f$ is not injective you CAN'T solve for a unique $x$. You must solve for a set of possible values. And it's easy to do once you "wrap your head around it".

=======

To show serject you let $k$ be an arbitrary elemet of $\mathbb Z$ and see if $[\frac x2] = k$ is always possible.

It's possible if $k \le \frac x2 < k+1$ is possible.

And that is possible if $2k \le x < 2k + 2$ is possible.

So for any $k$ is it always the case that there exist real numbers that between $2k$ (inclusive) and $2k+2$ (exclusive)? The answer is, of course. $2k$ is a possible value so is $2k + 1$ so is $2k + .75$ and $2k + 1.415273860$ etc.

tl;dr

For every $k\in \mathbb Z$ then for $x =2k$ then $f(x) = [\frac {2k}2] = [k] = k$ so yes it is surjective.


To prove (non)injective you try to see if $f(x) = y$ always has a unique solution.

If $f(x) = [\frac x2] = y$ then

$y\le \frac x2 < y+1$ and $2y \le x < 2y+2$. But that's as far as we can go. Any $x' \in [2y, 2y+2)$ could give us that. So for example:

$f(x) = 10\implies 20 \le x < 22$ and $x_1 = 20$ and $x_2 = 21$ we have $f(x_1) = f(x_2)$ but $x_1\ne x_2$ so not injective.

fleablood
  • 124,253
2

You do not need, in this case, to invert the floor function explicitly to determine if it is or is not surjective. Just ask yourself: "can I find something in its codomain that the floor function cannot produce as an output?"

And the answer is right there in the definition:

the floor function is that function, from reals to reals, which produces from its single input argument the integer which is no greater than that input.

So, given that, what sorts of numbers can it not produce? Are any of these in the given codomain (the reals)? You might also note that the answer here depends on what we choose the codomain to be. What if we choose it to be the integers, instead? How does the answer change, if it does? Why?

1

Noting $f(x)=\lfloor(x/2)\rfloor$ we have, for example $f(3)=f(3.7)$ then $f$ is not injective. Besides $f(\mathbb R)=\mathbb Z$ then none real non integer can have un inverse image by $f$ so $f$ is not surjective.

Piquito
  • 29,594
0

Your argument about injection is correct.

Hint: For surjection you should figure out whether you can get every integer as a value somehow. No need to think formally about "solving for $x$".

Ethan Bolker
  • 95,224
  • 7
  • 108
  • 199
  • Okay, so I've read around a bit, and here is my answer, it might be wrong, but here goes. Let y∈R, f(x) = y => ⌊/2⌋ = y => x = 2y, so f(x) = f(2y) = ⌊2y/2⌋ = ⌊y⌋ => y. So basically every y has an x in the domain, therefore it is onto. Did I get any of this right? – tom786 Dec 17 '20 at 18:14
  • $[\frac x2]=y$ does not imply $x = 2y$. But it implies $x \in [2y, 2y+2)$. But if you do the implication backwards. $x = 2y;y\in \mathbb Z \implies [\frac x2] =y$ is correct. Also you need $y\in \mathbb Z$ (which is the codomain, not $\mathbb R$) – fleablood Dec 17 '20 at 18:28