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.