Let $n \geq 1$ be an integer and consider a set $S$ consisting of $n$ numbers. $A$
function $f : S \rightarrow S$ is called cool, if for all elements $x$ of $S$
$f ( f ( f ( x ) ) ) = x$
Let $A _ { n }$ be the number of cool functions $f : S \rightarrow S$.
$\bullet$ Let $f : S \rightarrow S$ be a cool function, and let $x$ be an element of $S$ . Prove that the set
$\{ x , f ( x ) , f ( f ( x ) ) \}$
has size 1 or $3 .$
$\bullet$ Let $f : S \rightarrow S$ be a cool function, and let $x$ and $y$ be two distinct elements of $S$ . Assume that $f ( y ) = y .$ Prove that $f ( x ) \neq y$
$\begin{aligned} \bullet \text { Prove that for any integer } n & \geq 4 \\ A _ { n } & = A _ { n - 1 } + ( n - 1 ) ( n - 2 ) \cdot A _ { n - 3 } \end{aligned}$
Hint: Let $y$ be the largest element in $S$ . Some cool functions $f$ have the property that $f ( y ) = y ,$ whereas some other cool functions $f$ have the property that $f ( y ) \neq y .$
$\textbf{My Solutions}$
(a)
$Let \quad T = \left\{ x ,f ( x ) , f ( f ( x ) ) \right\}$ have size 1
Then all three of them are the same
$\therefore$ let $x = f ( x ) = f ( f ( x ) )$
$\Rightarrow f ( f ( f ( x ) ) ) = f ( f ( x ) ) \quad \because f ( x ) = x$
$= x \quad \quad \because f ( f ( x ) ) = x$
since it meets the condition $f ( f ( f ( x ) ) ) = x$ Then T can have size 1
Let $T = \left\{ x , f ( x ) , f ( f ( x ) ) \right\}$ have size 2 Then any two of them are the same
Case 1
$x = f ( x ) \neq f ( f ( x ) )$
$f ( f ( x ) ) = f ( x ) \quad \because f ( x ) = x$
$= x \quad$ contradiction
case 2
$x \neq f ( x ) = f ( f ( x ) )$
$f ( f ( x ) ) = f ( f ( f ( x ) ) ) \quad \because f ( x ) = f ( f ( x ) )$
$= x$
$\because$ elements $x$ of $S$ in cool are such that $f ( f ( f ( x ) ) ) = x$ hence contradiction
case 3
$f ( x ) \neq f ( f ( x ) ) = x$
$f ( f ( x ) ) = x = f ( f ( f ( x ) ) )$
$\because$ function cool is such that all elements $x$ of $S$ are such that $f ( f ( f ( x ) ) ) = x$
$f ( f ( x ) ) = f ( f ( f ( x ) ) )$
$f ( x ) = f ( f ( x ) ) \quad \cdot f ( a ) = f ( b ) \Rightarrow a = b$
contradiction
Then T cannot have a size of 2
Let $T = \{ x , f ( x ) , f ( f ( x ) ) \}$ have size 3
Then all three are different,Let
$x \neq f ( x ) \neq f ( f ( x ) )$
Hence $T$ can have a size of $3$
(b)
Assume that $f ( y ) = y , x$ and $y$ are distinct elements
Let $f ( x ) = y$
Since all elements $x$ of $S$ for the cool function adhere to to $f ( f ( f ( x ) ) ) = x$
$f ( f ( f ( x ) ) ) = f ( f ( y ) ) \quad \because \quad f ( x ) = y$
$= f ( y ) \quad \quad \because f ( y ) = y$
$= y \quad \because \quad f ( y ) = y$
Since $f ( f ( f ( x ) ) ) = x$ this implies $x=y$ but we stated that $x$ and $y$ are distinct elements hence contradiction $\Rightarrow f ( x ) \neq y$
(c)
Not sure how to do this one
TL;DR
I'm not sure if (a) is 100% correct
confident with (b)
Very lost on (c)