This question is from here:
Let $S_i$ be the set of permutations of $n$ items which fix item $i$. Then the number of permutations in $k$ of the $S_i$ would be the permutations that fix $k$ items. There are $\binom{n}{k}$ ways to choose the $k$ items to fix, and $(n−k)!$ ways to arrange the other $n−k$ items. Thus, the number of permutations that fix at least $1$ item would be $$\sum_{k=1}^n(-1)^{k-1}\binom{n}{k}(n-k)!=\sum_{k=1}^n(-1)^{k-1}\frac{n!}{k!}\tag{4}$$ Since there are $n!$ permutations in total, the number of permutations that don't fix any items is $$\begin{align} \mathcal{D}(n) &=n!-\sum_{k=1}^n(-1)^{k-1}\frac{n!}{k!}\\ &=\sum_{k=0}^n(-1)^k\frac{n!}{k!}\tag{5} \end{align}$$ where $$\mathcal{D}(n)=!n$$
Now,I can't understand how the equation (4) is derived.
Please help me to understand this question. Thank you.