I am supposed to solve the following problem:
How many permutations of the set $\{1, 2,. . . , 8\}$ do not leave any even number in its place?
What I tried:
$$8!-\left ( \binom{8}{1}7!-\binom{8}{ 2}6!+\binom{8}{3}5!-\binom{8}{4}4! \right )$$
But I know that this is incorrect.
Can anyone tell me why?
Let $A_k$ be the number of permutations that fix the $2k$-th element. By Inclusion-Exclusion, $$|A_1\cup A_2\cup A_3\cup A_4|=\sum_{1\leq w\leq4}|A_w|- \sum_{1\leq w<x\leq4}|A_w\cap A_x| +\sum_{1\leq w<x<y\leq4}|A_w\cap A_x\cap A_y|- \sum_{1\leq w<x<y<z\leq4}|A_w\cap A_x\cap A_y\cap A_z|$$ $$=\binom{4}{1}\cdot 7!-\binom{4}{2}\cdot 6!+\binom{4}{3}\cdot 5!-\binom{4}{4}\cdot4!=16296.$$This counts the number of permutations that fix at least one of the even elements, so our final answer is $8!-16296=24024$.