Let be onto. Then some element of A has to go to the first element of B, and there are 10 possibilities for that. Some other element has to go to the second element of B, so 9 possibilities there, and so on. So there are 10*9*8*7 ways to choose four elements of A and send them onto the four elements of B. Once that's done, f is surjective, and we may choose its value on the other 6 elements of A arbitrarily, so the total number is 10*9*8*7*4^6.