Originally Posted by
Deveno in general, the number of possible functions from a set X to a set Y is:
|Y|^{|X|}.
if Y is but a single element, then this number is 1 (all functions are the same: f(x) = y, the single element of Y for every x).
in this case, we have 3 single-element subsets of Y, {1},{2} and {3}.
there is only one function f:X-->{1}
one function f:X-->{2}
one function f:X-->{3}
(namely, the constant function in each case).
there are 2^{n} functions if the image is a 2-element subset of Y, and 3^{n} functions if the image is a 3-element subset. convince yourself that this is so for small values of n like 2 or 3.