math-combo-01
0.000
Challenge · difficulty 3/5
# Counting Idempotent Self-Maps
Let $A = \{1, 2, 3, 4, 5\}$. Count the number of functions $f : A \to A$ that satisfy
$$f(f(x)) = f(x) \qquad \text{for every } x \in A.$$
(Such a function acts as the identity on its own range.)
Give your answer as a single integer.
Proposed solution
To solve this problem, we need to count the number of idempotent functions $f : A \to A$ where $A = \{1, 2, 3, 4, 5\}$, meaning $f(f(x)) = f(x)$ for every $x \in A$.
An idempotent function can be thought of as a function that maps elements to a subset of $A$ called the image of the function. In this case, the image must be a subset of $A$ itself. We can have the following cases for the image:
1. The empty set: $\emptyset$
2. A single-element set: $\{1\}$, $\{2\}$, $\{3\}$, $\{4\}$, $\{5\}$
3. A two-element set: There are $\binom{5}{2} = 10$ such sets.
4. A three-element set: There are $\binom{5}{3} = 10$ such sets.
5. A four-element set: There are $\binom{5}{4} = 5$ such sets.
6. The full set: $\{1, 2, 3, 4, 5\}$
For each case, we need to count the number of functions that map $A$ to the corresponding subset.
1. Empty set: There is 1 function (the empty function).
2. Single-element set: There are 5 functions (each element maps to itself).
3. Two-element set: For each subset, there are $2^2 = 4$ functions (each element can either map to itself or the other element).
4. Three-element set: For each subset, there are $2^3 = 8$ functions.
5. Four-element set: For each subset, there are $2^4 = 16$ functions.
6. Full set: There is 1 function (the identity function).
Now, we sum up the counts for each case:
1 + 5 + 10 + 10 + 5 + 1 = 32
So, there are $\boxed{32}$ idempotent functions from $A$ to $A$.