1

Let $S = \{1,2,3,4,5\}$ How many bijective functions $f:S \to S$ do we have such that $f(x) \neq x$ for all $x\in S$?

I was trying to solve by taking the total number of such functions and subtract all the cases where $f(x) = x$.

$5!$ is all cases

$4!$ is where one $f(x)=x$ and rest are not

$3!$ is where two $f(x)=x$ and rest are not

$2!$ is where three $f(x)=x$ and rest are not

$1!$ is where all five $f(x)=x$

so $5!-(4!-3!-2!-1)$.

But then I realized that, for example, $4!$ contains also the case where all $f(x)=x$ which mean I am subtracting too much.

The Count
  • 3,620
Gigalala
  • 193

1 Answers1

1

so suppose $A_1$ is the set of all permutations where atleast one $f(x)=x$ (ie one point is fixed).$A_2$ is the set of all permutations where atleast two $f(x)=x$. $A_3$... and $A_n$ is the set where all $f(x)=x$. So you want to find $n!-|A_1 \cup A_2 \cup A_3...\cup A_n|$ right ? (ie the number of total permutations minus the number of permutations you dont want: that will give us the number of permutations you want).

Well what we see here is a the cardinality of a union of sets that arent disjoint, so we will use inclusion exclusion principle.

How many ways are there to fix k points ? Well thats easy there are $\binom{n}{k}$ possiblities right

How many possible permutations are left for the other (n-k) that we didnt fix?

Well thats easy too right: (n-k)! so what we want to calculate is now using inclusion exclusion :

$n!-$$\sum_{k=1}^n$$(-1)^{k-1}\binom{n}{k}(n-k)!$

This can be simplified i will let you do the rest :)))

asddf
  • 1,733