# Is there a way to make a mapping from the set of negative odd integers to the set of positive even integers which is onto but not one to one?

I'm studying for the coming test - and this question was on one of the previous papers. That got me thinking as by definition not one to one means that at least 2 pre images should result in same image, while onto demands for all the integers from the second set to have pre images.

My initial thought was to try and first ignore the not one to one part and make a function like this $$f(x) = (0-x)+1$$, and then somehow bring it into not one to one form.

My first idea was to use floor or ceil after scaling it by a decimal factor but that got me nowhere as there is no guarantee to get an even number.

After that I wondered if I can somehow bring 2 sequential terms (lets say $$x = -3 \land f(x) = 4$$ and $$x = -1 \land f(x) = 2$$) to the same value. So I tried figuring if there is a way I can do it with quotient when dividing by 2 as all even numbers would have difference of 2. So eventually I figured out that if I calculate $$\lfloor f(x) / 2 \rfloor \mod 2$$, for images like so $$[2, 4, 6, 8, 10]$$ this expression will output following values $$[1, 0, 1, 0, 1]$$ which I assume I can use to null factor an addition or subtraction to only affect every second term like so $$f(x) = (0 - x) + 1 - (0 - (\lfloor ((0 - x ) + 1) / 2 \rfloor \mod 2))\times{2}$$

However is there anything I didn't account for?

• Can you find a one-to-one map from the set $\{n \in 2\mathbb{Z}+1 \ \vert \ n \leq -3\}$ to the set of positive even integers?
– Plop
Commented Oct 25, 2021 at 11:01
• I do not mind your ideas. But have you tried to define a "piecewise" function?
– ashK
Commented Oct 25, 2021 at 11:01
• @ashK what is a piecewise function? Commented Oct 25, 2021 at 11:02
• @HerbalTea Take a look here en.wikipedia.org/wiki/Piecewise
– ashK
Commented Oct 25, 2021 at 11:03
• Here's a hint: Construct a function which sends every number of the form $-2n$ to $n$ where $n$ is a positive integer and finally decide what to do with the rest of negative odd numbers.
– ashK
Commented Oct 25, 2021 at 11:06