
Functions and sets
Can somebody explain to me how to do the follow please:
1)Compute the number of functions from a set with n elements to a set with m elements.
and secondly,
2) compute the number of onetoone functions (injections) from a set with n elements to a set with m elements.
Can someone tell me how they get the answer, i really want to understand this.
Thanks guys.

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 m1, the 3rd to m3 .. etc
So n*...*(nm+1) = n! / m!

2.
$\displaystyle n(n1)(n2)(n3)......(nm+1)=\frac{n!}{(nm)!}$
Here's another one:
How many ONTO functions can be constructed

Whoops, my mistake. Pankaj is correct.

thanks guys, that is great!