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 3 of 4: Rewrite E[X] using the counts p_n(k)
In plain words

This is just the standard formula for the average of a random variable, written out using the counts pn(k)p_n(k) that the problem already provides.

E[X]=∑k=0nk⋅P(X=k)=∑k=0nk⋅pn(k)n!\mathbb{E}[X] = \sum_{k=0}^{n} k \cdot P(X=k) = \sum_{k=0}^{n} k \cdot \frac{p_n(k)}{n!}
Detailed analysis

On the other hand, by definition, X=kX=k for exactly pn(k)p_n(k) of the n!n! equally likely permutations, so P(X=k)=pn(k)/n!P(X=k) = p_n(k)/n!, and the expectation of XX is E[X]=∑k=0nk⋅pn(k)/n!\mathbb{E}[X] = \sum_{k=0}^{n} k \cdot p_n(k)/n!.