Given the sets $A=\{1,\dots,4\}$ and $B=\{1,\dots,7\}$ how many one to one functions are there from $A$ to $B$ such that $f(i)\neq i$ ?
I used inclusion exclusion to first find the number of one to one functions:
$S_1 = f(a)=f(b) , S_2 = f(a)=f(b)=f(c) , S_3 = f(a)=f(b)=f(c)=f(d)$
$7^4 - \binom{4}{2}\cdot 7^3 + \binom{4}{3}\cdot 7^2 - \binom{4}{4}\cdot 7^1=532$
I then repeated using a similar approach for eliminating cases of $f(a)=a$, etc...
$532 - \binom{4}{1}\cdot6^3 + \binom{4}{2}\cdot5^2 - \binom{4}{3}\cdot4^1 + \binom{4}{4}\cdot 3^0$
Are my solutions correct?
EDIT
I see that the number of one to one functions is $7\cdot6\cdot5\cdot4=840$ and that makes sense. But I still can't seem to get it to work using inclusion exclusion.
$U$ would be the group of all possible functions, $7^4=2401$.
$S_1 = $ where $f(a)=f(b)$
$S_2 = $ where $f(a)=f(b)$ and $f(c)=f(d)$
$S_3 = $ where $f(a)=f(b)=f(c)$
$S_4 = $ where $f(a)=f(b)=f(c)=f(d)$