The number of functions from an $m$ element set to an $n$ element set is
Let set A contains m element and set B contains n elements and we have to map from A to B. Then for every elements of A we have n choices to map to, and think recursively that 1st element we have n choice, again for the 2nd element of A we have n choice and if we continue like this then every element of A has n choices. So n*n*n*n*n*n*..........upto m times will generate n^m. Like we write 2*2*2*2 = 2^4. i hope this clear your doubt.