MathLabs

Problem 1

Let pn(k)p_n(k) be the number of permutations of the set {1,…,n}\{1, \ldots, n\}, n≥1n \ge 1, that have exactly kk fixed points. Prove that ∑k=0nk⋅pn(k)=n!\sum_{k=0}^{n} k \cdot p_n(k) = n!. (A permutation ff of a set SS is a one-to-one mapping of SS onto itself; an element ii of SS is a fixed point of ff if f(i)=if(i) = i.)
Step 1 of 4: Probability that a fixed element is a fixed point
In plain words

Among all n!n! shuffles, the fraction that happen to send ii back to itself is just 1/n1/n — by symmetry, each of the nn elements is equally likely to be ii's image.

P(f(i)=i)=(n−1)!n!=1n,i=1,…,nP(f(i)=i) = \frac{(n-1)!}{n!} = \frac{1}{n}, \qquad i=1,\ldots,n
Detailed analysis

Let ff be chosen uniformly at random among the n!n! permutations of {1,…,n}\{1,\ldots,n\}. For a fixed ii, exactly (n−1)!(n-1)! of the n!n! permutations satisfy f(i)=if(i)=i (by the same count as before), so P(f(i)=i)=(n−1)!/n!=1/nP(f(i)=i) = (n-1)!/n! = 1/n.