How many distinct functions can be defined from set A to B? In my discrete mathematics class our notes say that between set $A$ (having $6$ elements) and set $B$ (having $8$ elements), there are $8^6$ distinct functions that can be formed, in other words: $|B|^{|A|}$ distinct functions. But no explanation is offered and I can't seem to figure out why this is true. Can anyone elaborate?

It follows from the definition that there is a bijection from $\mathrm{Func}(A,B)$ to $\prod_{i \in A}B_i$ where each $B_i$ is a copy of $B$. Thus the cardinal of $\mathrm{Func}(A,B)$ is equal to the cardinal of $\prod_{i \in A}B_i$. In particular, when $A,B$ are finite sets, we have $$ \# \ \mathrm{Func}(A,B) = \# B^{\# A}. $$
