TITLE: How many functions there is from 3 element set to 2 element set?
QUESTION [6 upvotes]: Let say we have a set A = {a,b,c} and B={1,2}. How many functions are there from A to B?
This seems like elementary question, but my class mate argued that there is no difference between: $f_1(t)=1$ and $f_2(t)=2$, that's just crazy.
I think there are 8 different functions, is that right?

REPLY [4 votes]: You're right. More generally, if $A$ is a set of size $m$ and $B$ is a set of size $n$ then there are $n^m$ functions $A \to B$.
Why? Because for each of the $m$ elements of $A$ there are $n$ choices of elements of $B$, so you have
$$\underbrace{n \times n \times \cdots \times n}_{m\ \text{times}} = n^m$$
choices in total.
In fact, this is often taken as a definition of exponentiation of natural numbers.