mapping $\{a,b\} \times \{a,b\} \to \{a,b\}$ My lecturer asked the class how many maps are possible given the following expression: $$\{a,b\} \times \{a,b\} \to \{a,b\}$$
His answer is 16, but I'm not sure how he arrived at that answer. My logic goes as follows:
The objects being mapped are the product of 2 sets, so they must contain 2 elements each. From the first set we have two choices, either a or b, and from the second we have two choices, either a or b. Thus, we have 4 possible objects: $(a,a) \vee (a,b) \vee (b,a) \vee (b,b)$. Each of those objects maps onto 1 of 2 images. $4 \times 2 = 8$.
 A: For $(a,a)$ there are $2$ options; for $(a,b)$ there are $2$ options; for $(b,a)$ there are $2$ options; and for $(b,b)$ there are $2$ options. 
This means there are $2\cdot2\cdot2\cdot2=2^4=16$ options for choosing a function.
A: To construct a map $f$ from a set $S$ to a set $T$, you have to choose a member $t = f(s) \in T$ for each $s \in S$.  Without other assumptions about the maps that you're enumerating, these choices of images are independent, so the number of maps is
$$
\underbrace{\lvert T \rvert \times \cdots \times \lvert T \rvert}_{\lvert S \rvert} = \lvert T \rvert^{\lvert S \rvert}.
$$
Applied to your example, you get $2^4 = 16$ maps.

By the way, the notation for constructing Cartesian products and sets of functions are meant to suggest these formulas:
$$
\begin{align}
\lvert S \times T \rvert &= \lvert S \rvert \times \lvert T \rvert, \\
\lvert \{ f: S \to T \} \rvert = \lvert T^S \rvert &= \lvert T \rvert^{\lvert S \rvert}.
\end{align}
$$
A: 
Thus, we have 4 possible objects: $(a,a) \vee (a,b) \vee (b,a) \vee (b,b)$. Each of those objects maps onto 1 of 2 images.

Yes, but this choice only represents one such map. How many maps can be constructed like this?
