1

So my logic to this up until now has been that for any $x$ the function $\left\lfloor\frac{\lceil x\rceil}{2}\right\rfloor$ will return an integer that is an element of $\mathbb Z$. Thus since you can map any $x$ in the domain to any y in the co-domain it is surjective.

Now I'm not sure if this counts as a full proof, and whether the function is injective.

Cheese Cake
  • 1,143
Brownie
  • 667
  • 1
  • 5
  • 17

2 Answers2

2

It is surjective but your proof is not complete. For any $y$ in the co-domain, you must produce an $x$ such that $\lfloor \lceil x \rceil / 2 \rfloor = y$.

To check injectivity, ask yourself if it is possible for $x \ne x'$ and $\lfloor \lceil x \rceil / 2 \rfloor = \lfloor \lceil x' \rceil / 2 \rfloor$ to occur. If it is, then it is not injective; if it is impossible, it is injective.

angryavian
  • 89,882
2

Note that $\lceil x\rceil=x$ for all integers $x$, so really the function is just $\lfloor x/2\rfloor$. Choose $x=2,3$, and the value of the function is $1$ at both of these points, hence the function is not injective. But to get an integer $y$ it always suffices to choose the integer $x=2y$ as the input, since $\lfloor 2y/2\rfloor =\lfloor y\rfloor = y$, hence it is surjective.

YiFan Tey
  • 17,431
  • 4
  • 28
  • 66
  • Hi! Thanks for the great response. Your last sentence confuses me a little though, how do you get x = 2y? is that just from ⌊x/2⌋ = y and then you just solved for y? if so how does that work when working with a floor. – Brownie Feb 17 '19 at 04:04
  • 1
    @Brownie he noticed that $x=2y$ when plugged into the function gives us $y$ for every $y\in\mathbb{Z}$, and in that way you can get any integer desired – Bruno Andrades Feb 17 '19 at 04:11
  • That makes a lot more sense, so it was just the fact that 2y/2 simplifies to y – Brownie Feb 17 '19 at 04:13