Finding a function with some requirements

29 Views Asked by At

Find a function $H$ such that $H(H(x)) = H(x)$ for all numbers $x$, and such that $H(1)=36$, $H(2)=\pi/3$, $H(13)=47$, $H(36)=36$, $H(\pi/3)=\pi/3$, $H(47)=47$.

Any hints would be appreciated

1

There are 1 best solutions below

1
On

Well, since you don't even require continuity, here's the minimal example: $$ H(x) = \begin{cases} 36, &x=1 \text{ or } 36 ,\\ \pi/3 , &x= 2 \text{ or } \pi/3, \\ 47 , &x=13 \text{ or } 47 \\ 0 &\text{else.} \end{cases} $$ You can easily check that $H(H(x)) = H(x)$ for any $x$ and it satisfies the other conditions trivially.