# How many functions with A having 9 elements and B having 7 elements have only 1 element mapped to 7?

So, the question I have is: How many onto functions [9] --> [7] have only one element mapped to 7?

This is asking how many functions with A having 9 elements and B having 7 elements have only 1 element mapped to 7 I suppose.

Now...I can calculate the total number of onto functions using Sterlings number of the 2nd kind: S(9,7) = 462. Now, to account for the number of ways to assign the sets in the domain to n elements in the codomain we multiply 462 by 7! since there are 7 ways to derive functions from the partitions on the first set, 6 for the next, 5 for the next, and so on. So the total number of onto functions [9]-->[7] = 462*7! = 2,328,480.

Now how would I see how many functions in [9]-->[7] have only 1 element mapped to 7? I'm not sure I really understand what it's asking. Any ideas?

Would it be S(8,6)*7?

Edit: Or perhaps S(9,7)*7! - S(9,6)*6!?

-

Your second paragraph loses the requirement that the function be onto. You can choose the element of $A$ mapped to $7$ in $9$ ways. Leaving aside the elements accounted for, you need an onto function from eight elements into six, which is $S(8,6)6!$, so the final answer is $9S(8,6)6!=1723680$