Function composition, tell me if it's right please

110 Views Asked by At

I have to do the function composition $f \circ f$

$$f(x)= \left\{ \begin{array}{c} 2 \quad\text{if} \;x=1\\ x-1 \quad \text{if}\; x>1\\ \end{array} \right. $$

$$f(f(x))= \left\{ \begin{array}{c} 2 \quad\text{if}\; x=1\\ x-2 \quad\text{if}\; x>1\\ \end{array} \right. $$

Is it right?

2

There are 2 best solutions below

0
On BEST ANSWER

You have the right idea.

When $x=1$, $f(x)=f(1)=2$ so at this $x$, $$f(f(x))=f(f(1))=f(2)=2-1=1$$ instead of $2$.

When $x>1$, $f(x)=x-1$ so at such $x$, $$f(f(x))=f(x-1)=\left\{ \begin{array}{c} 2 \quad\text{if} \;x-1=1\implies x=2\\ x-1-1 \quad \text{if}\; x-1>1 \implies x>2\\ \end{array} \right.$$ Hence, $$f(f(x))=\left\{ \begin{array}{c} 1 \quad\text{if} \;x=1\\ 2\quad\text{if}\; x=2\\ x-2 \quad \text{if}\; x>2\\ \end{array} \right.$$

0
On

$f(f(x))$ is $$f(f(x))= \left\{ \begin{array}{c} 2 \quad\text{if} \;f(x)=1\\ f(x)-1 \quad \text{if}\; f(x)>1\\ \end{array} \right. $$ but $f(x)=1 \iff x=2$, and $f(x)>1 \iff (x>2 \text{ or } x=1)$. Therefore, $$f(f(x))= \left\{ \begin{array}{c} 2 \quad\text{if} \;x=2\\ f(x)-1 \quad \text{if}\; x>2 \text{ or } x=1\\ \end{array} \right. = \left\{ \begin{array}{c} 2 \quad\text{if} \;x=2\\ x-2 \quad \text{if}\; x>2\\ 1 \quad \text{if}\; x=1\\ \end{array} \right. $$