# Thread: Showing a piecewise function is one-to-one

1. ## Showing a piecewise function is one-to-one

I'm trying to show that a piecewise function is one-to-one by showing that for all f(a) = f(b), a = b. The function is:
(x-2)/4 if x/2 is odd
-x/4 if x/2 is even.

I can show f(a) = f(b) implies a = b if a/2 and b/2 are both odd, and i can if they are both even.

Do i need to show f(a) = f(b) implies a = b for the case where a is even and b odd?
I would think i need to, because it should be for all a and b, but when i tried to i got

(a-2)/4 = -b/4 ==> a-2 = -b ==> a = -b+2.

so here it would not be true that f(a) = f(b) implies a = b and thus the function is not one-to-one.

I'm pretty sure that it is, though, and that i'm doing something wrong. The function is suppose to map positive even numbers to integers.
(f(2) = 0----------f(4) = -1--------f(6) = 1--------f(8) = -2....

2. Originally Posted by Relmiw
I'm trying to show that a piecewise function is one-to-one by showing that for all f(a) = f(b), a = b. The function is:
(x-2)/4 if x/2 is odd
-x/4 if x/2 is even.
What is the initial set for this mapping?
It appears that you are mapping the even integers to the integers.
Is that correct?

3. Originally Posted by Plato
What is the initial set for this mapping?
It appears that you are mapping the even integers to the integers.
Is that correct?
I am suppose to come up with a function that maps positive even integers to integers and then show it is one to one and onto

4. Originally Posted by Relmiw
I am suppose to come up with a function that maps positive even integers to integers and then show it is one to one and onto
Well then, in the future please post complete in details.
Suppose $\dfrac{a-2}{4}=\dfrac{-b}{4}$.
That means $a=2n$ where $n$ is a positive odd.
And $b=2m$ where $m$ is positive even.
But that leads to $n=1-m$. Is that possible?

5. Originally Posted by Plato
Well then, in the future please post complete in details.
Suppose $\dfrac{a-2}{4}=\dfrac{-b}{4}$.
That means $a=2n$ where $n$ is a positive odd.
And $b=2m$ where $m$ is positive even.
But that leads to $n=1-m$. Is that possible?
I'm not sure where you're getting that a = 2n where n is a positive odd and that b = 2m where m is a positive even.

Wouldn't a = 2 - b where b is a positive odd and b = a - 2 where a is a positive even from simplifying (a-2)/4 = -b/4?

6. Originally Posted by Relmiw
I'm not sure where you're getting that a = 2n where n is a positive odd and that b = 2m where m is a positive even.
I am getting it from the definition of your function.
You wrote the function.
I am showing the one case that you said you could not.
In order for $\dfrac{a}{2}$ to be odd, it is necessary that $a=2n$ where $n$ is a positive odd.

7. Originally Posted by Plato
I am getting it from the definition of your function.
You wrote the function.
I am showing the one case that you said you could not.
In order for $\dfrac{a}{2}$ to be odd, it is necessary that $a=2n$ where $n$ is a positive odd.
Ok, I think I'm understanding your post about n = 1 - m now.
This is not possible as n will be a negative integer for all m.

But, this does not actually mean that the function is not one-to-one because we just showed f(a) /= f(b) if one is even and one is odd (a /= b).

So basically, f(a) = f(b) implies a = b for both even and both odd. For one of each, neither are true so that also maintains it is one-to-one. I believe.

8. You function is one-to-one.
Can you prove that it is onto?

9. Thank you for your help so far.

I would try to show this is onto by showing that each individual piece is onto.
First, (x-2)/4 if x/2 is odd

so, f(e) = (e - 2) / 4
y = (e - 2) / 4
e = 4y - 2

Now i must show that for all y in Z, e is a positive even initeger. I'm thinking 4y - 2 ==> 2(2k - 2) ==> 2(g) g in Z.
The only problem is this only shows e is even, not positive.

similarly, for -x/4 if x/2 is even.
y = -e / 4
e = -4y.

Now i must show that for all y in Z, e is a positive even integer. I'm thinking -4y ==> 2(-2k) ==> 2(g), g in Z.
But again, this doesn't mean e is positive.