Number of functions from $A=\left\{1,2,3,4,5\right\}$ to $B=\left\{0,1,2,3,4,5\right\}$ such that $f(i) \ne i$

242 Views Asked by At

Find Number of functions from $A=\left\{1,2,3,4,5\right\}$ to $B=\left\{0,1,2,3,4,5\right\}$ such that $f(i) \ne i$

My try:

I introduced fictitious element $x=0$ in set $A$

and now counted number of derangements which is $d_6=265$

In all these $265$ functions i will remove the mapping of zero which is Fictitious.

Also number of functions in which $0$ maps to $0$ and $f(i) \ne i$ is $d_5=44$

Hence Total number of functions is $309$

1

There are 1 best solutions below

0
On BEST ANSWER

Suppose you count injective functions.

I would do like this: Let $A_i$ be a set of functions with $f(i)=i$. Then

$|A_i|= 5!$ and

$|A_i\cap A_j|=4!$ and

$|A_i\cap A_j\cap A_k|=3!$ ...

You are interested in $|A_1'\cup A_2'...\cup A_5'|$. Lets use PIE

$$|A_1'\cup A_2'...\cup A_5'| = 6!-5\cdot 5!+{5\choose 2}4!-{5\choose 3}3!+ {5\choose 4}2!- {5\choose 5}=...$$