How many one to one functions are there between two sets where the $k$th element of the domain is not mapped to the $k$th element of the codomain? Suppose $2$ sets with cardinality $X=5$ and $Y=7$.
How many one to one function from $X$ to $Y$ such that $k$th element of $X$ should not align with the $k$ th element of $Y$ ?

I think one to one possible are $6\times 5\times 4\times 3\times 2$, but not sure though.
 A: Total no. of one-to-one functions from $X$ to $Y$ = $^7P_5=2520$.
Now if any of the $k$th elements of $X$ and $Y$ align (call this property $A$) , we have the following cases:


*

*$X_1 \to Y_1$ and the rest unrestricted 

*$X_2 \to Y_2$ and the rest unrestricted

*$X_3 \to Y_3$ and the rest unrestricted

*$X_4 \to Y_4$ and the rest unrestricted

*$X_5 \to Y_5$ and the rest unrestricted


Each of them create $^6P_4=360$ functions implying $1800$ functions in total.
But then there are repetitions as $(1)$ and $(2)$ contain parts of each other and so on for the others as well. Hence there are overcalculations.
So we deduct $\binom{5}{2}\times \,^5P_3= ?_1  $ functions.
But again we have overdeducted those where $3$ cases have their intersection.
So we add $\binom{5}{3}\times \,^4P_2= ?_2 $ functions.
Again, there is a overcalculation of those functions where $4$ cases have their intersection.
So we deduct $\binom{5}{4}\times \,^3P_1= ?_3 $ functions.
But again we have overdeducted those where $5$ cases have their intersection. And that is why we add $1$ function.
So the total no.of functions that satisfy the property $A$ = $1800-\binom{5}{2}\times \,^5P_3+\binom{5}{3}\times \,^4P_2-\binom{5}{4}\times \,^3P_1+1=?_4$
Hence your answer is $2520-?_5$.
Hope this helps.
