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....
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.
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.