Given any finite set $X$ the set $\mathcal{T}(X)=X^X$ of all functions from $X$ to $X$ clearly forms a monoid under composition. Now if we call any family of functions $\mathcal{F}\subseteq \mathcal{T}(X)$ a generating set of $\mathcal{T}(X)$ iff every function in $\mathcal{T}(X)$ can be expressed as a composition of functions in $\mathcal{F}$. Then how small can such a set $\mathcal{F}$ be while still generating every function in $\mathcal{T}(X)$?



Size of a minimum generating set for full transformation monoids
The minimal number to generate the full transformation monoids is 3 maps. You must include a generating set for the symmetric group, which requires 2, and then you can add any idempotent function collapsing exactly two elements. 


Here are hints. 


1. Use double transitivity of the symmetric group to show you get all idempotents collapsing exactly two points.
2. Show using 1 you can get any map collapsing two elements. (This is overkill to show every non-permutation is a product of idempotents. Otherwise in step 1 get all maps collapsing just two points.)
3. Now do induction on the defect of $f$ (size of $|X|-|f(X)|$) to show you can get anything.


