Number of applications between two sets

18 Views Asked by At

In a certain exercise I am asked to find the number of applications (not neccesarily bijective) such that for $f: X \rightarrow X, f(k) \not= k$, where $X = \{1\dots n\}$. This is my approach. It seems so simple that I think I must be wrong somewhere:
For each $i \in X$, one can send $i$ to as much as $n-1$ elements (everyone excepting $i$ itself). Therefore, there are $(n-1)^n$ of these applications. Am I right?