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: Read the sum as counting fixed-point pairs
In plain words

Instead of grouping permutations by how many fixed points they have, just count, one at a time, every (permutation, fixed point) pair that exists — the total is the same, viewed from a different angle.

∑k=0nk⋅pn(k)=#{(f,i):f is a permutation of {1,…,n}, f(i)=i}\sum_{k=0}^{n} k \cdot p_n(k) = \#\{(f,i) : f \text{ is a permutation of } \{1,\ldots,n\},\ f(i)=i\}
Detailed analysis

A permutation with exactly kk fixed points contributes exactly kk to the term k⋅pn(k)k \cdot p_n(k), one for each of its fixed points. Summing over kk, ∑k=0nk⋅pn(k)\sum_{k=0}^{n} k \cdot p_n(k) counts every pair (f,i)(f,i) where ff is a permutation of {1,…,n}\{1,\ldots,n\} and ii is a fixed point of ff, i.e. f(i)=if(i)=i.