0
$\begingroup$

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

$\endgroup$
  • 1
    $\begingroup$ 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. $\endgroup$ – Clayton Apr 4 '18 at 1:12
  • $\begingroup$ One-to-one on the integers? $\endgroup$ – saulspatz Apr 4 '18 at 1:16
  • $\begingroup$ 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. $\endgroup$ – MPW Apr 4 '18 at 1:38
0
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.