0
$\begingroup$

Given a function $f: \mathbf{N}_0 \to \mathbf{N}_0$, defined $$ f(x) = \begin{cases} x+3 & \text{if } x \in \mathbf{N}_{\text{even}} \\ x-1 & \text{if } x \in \mathbf{N}_{\text{odd}} \end{cases} $$

Is the composed function $f o f = x + 2$ if $x ∈ {N}_0$ ?

$\endgroup$
  • $\begingroup$ @ArsenBerk he just forgot to make some spaces: It should be $x+2$ if $x \in N_0$. $\endgroup$ – noctusraid Jan 14 '18 at 12:10
  • $\begingroup$ Ah, okay now I see. $\endgroup$ – ArsenBerk Jan 14 '18 at 12:11
0
$\begingroup$

The answer is yes. If you want to justify it, simply note that for $x$ even and $y$ odd we always have $x+y$ is odd.

$\endgroup$
  • $\begingroup$ I already justified it by doing the composition. $\endgroup$ – Marco Carta Jan 14 '18 at 12:11
  • $\begingroup$ Well, then I guess you solved it correctly. Well done. $\endgroup$ – noctusraid Jan 14 '18 at 12:12
0
$\begingroup$

There are two cases to consider:

  • If $x$ is even, then $f(x) = x+3$ will give us an odd number and $f(f(x)) = (x+3)-1 = x+2$.

  • If $x$ is odd, then $f(x) = x-1$ will give us an even number and $f(f(x)) = (x-1)+3 = x+2$.

Therefore, in general, $f\circ f = x+2$. So you're correct.

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