0

$$f(x) = \begin{cases}x-1,&\text{ if }x\text{ is even}\\ x+3,&\text{ if }x\text{ is odd}\end{cases}$$

I know that I need $4$ cases in order to prove this function is one -to-one I have proven them all.

Two of the cases showed the function is one -to-one which are when $x,y$ are both even and $x,y$ are both odd. the two cases where the function fails to be one -to-one is when $x$ is even and $y$ is odd and when $x$ is odd and $y$ is even.

My question is if any of the cases failed is the function not one -to-one ?

Thank you in advance.

Hanul Jeon
  • 27,376
jeff c
  • 47
  • 5
  • 1
    You only have two cases to prove the function is $1$-$1$... If the output is odd, the input must be even (why?); on the other hand, if the output is even, the input must be odd (why?). So all you really need to do is show that for each even number, precisely one input maps to it. Then do a similar thing for the odd numbers. – Clayton Apr 04 '18 at 01:12
  • One-to-one on the integers? – saulspatz Apr 04 '18 at 01:16
  • If a piecewise-defined function is 1-1 on each of the pieces, and none of the function values are shared on any two of the pieces, the the function is always 1-1. This is true even if there are infinitely many pieces. – MPW Apr 04 '18 at 01:38

1 Answers1

0

Suppose $f(x)=f(y)$. First, $x$ and $y$ cannot have different parity (because you function maps odd values to even values and viceversa). For example, let's suppose that $x$ is odd and $y$ is even. Then, $$x+3=y-1$$ But this implies $y-x=4$, a contradiction since the lhs is odd and 4 is even. The other case ($x$ even, $y$ odd) is analogous. Therefore suppose $x,y$ have the same parity and $f(x)=f(y)$. If they are odd, then $x+3=y+3$ implies $x=y$. If they are even, same story. Therefore your function is 1-1.