1
$\begingroup$

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.

  • 1
    Do you know about inclusion - exclusion ?2017-02-20
  • 0
    Not really, i can try read about it.2017-02-20
  • 2
    Btw, the things you're looking for are called *derangements*: permutations which do not fix any points.2017-02-20
  • 3
    these types of permutations are called derangements. You can try to read more about them if you directly want the answer or what i would suggest is you learn about inclusion - exclusion. Then try to find all permutations for which f(x)=x and subtract those from all permutations . Good luck2017-02-20
  • 0
    What sort of class or work is this for?2017-02-20
  • 0
    @asddf: ha! great minds, right?2017-02-20
  • 0
    :)))) yes great minds :D2017-02-20
  • 0
    I learned about inclusion exclusion, but i'm still stuck. I know i need to subtract the intersection between each group( 4! and 3!, 4! and 2!, 4! and 1!, 3! and 2!, 2! and 1!) and then add the intersection between all of them. @asddf2017-02-20
  • 0
    Ill write it out as an answer becuase there is no place here.2017-02-20

1 Answers 1

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 :)))