1) Each element in the domain can be mapped to one of m elements. m choices for the first, m choices for the 2nd, ... , m choices for the nth. So n^m.

2) The first element can be mapped to m different elements, the 2nd to m-1, the 3rd to m-3 .. etc

So n*...*(n-m+1) = n! / m!