Cardinality of set of functions with given domain and co-domain I am reading a book (Klein, Philip. Coding the Matrix: Linear Algebra through Computer Science Applications)and came across the following statement:

I'm having trouble understanding what this means, I realize it's talking about the cardinalities, but I don't understand the "pun" and can't come up with a concrete example to illustrate this "fact".
 A: The pun is really just that - $|D^F| = |D|^{|F|}$. The reason it's "funny" is that there's really no reason to use that notation except to make things line up like that. A "pun" is usually using a word that is related to the situation but not appropriate to the use, but used anyway because it sounds like what would be appropriate (e.g., cat-astrophe when speaking of a feline disaster). In this case, we're using notation related to the situation which (prior to this definition) isn't actually appropriate, but looks like what is appropriate (i.e., playing on the visual similarity of $|D^F|$ and $|D|^{|F|}$.
As for a concrete example: let $A = \{0, 1\}$ and $B = \{a, b, c\}$. $B^A$ has nine members ($f(0)$ can be $a$, $b$, or $c$, and $f(1)$ can as well). $|B|^{|A|} = 3^2 = 9$.
A: For an example to illustrate the fact let $F$ have three elements and $D = \{0,1\}$ two. Then each function from $F$ to $D$ assigns a $0$ or a $1$ to each element of $F$ and so essentially corresponds to a subset of $F$. There are $8 = 2^3$ of those.
I think the "pun" is the idea that you can "distribute" the absolute value operation on the left to get the expression on the right.
A: For any set $A$, $|A|$ is the cardinal of the set $A$. Almost by definition, for any two sets $A,A'$ the equation $|A|=|A'|$ means that there exists a bijection $A \leftrightarrow A'$.
For any sets $F,D$, the set $D^F$ is defined to be the set of all functions with domain $F$ and range $D$. And then, like any other set, $|D^F|$ is the cardinal of the set $D^F$.
Now there's a little lemma: Given two cardinals $\alpha,\beta$, for any sets $A,A',B,B'$, if $|A|=|A'|=\alpha$ and $|B|=|B'|=\beta$ then $|A^B|=|(A')^{B'}|$. This lemma is proved by constructing a bijection $A^B \leftrightarrow (A')^{B'}$ (it's not hard to prove, try it).
Next, there's a definition: given two cardinals $\alpha,\beta$, the cardinal $\alpha^\beta$ is defined to be the cardinal of any set of the form $A^B$ where $A$ and $B$ are chosen so that $|A|=\alpha$ and $|B|=\beta$. The lemma says this is well-defined, independent of the choice of $A$ and $B$.
Finally, there's a pun: $|D^F|=|D|^{|F|}$, which is an immediate consequence of the definition, using $\alpha=|D|$ and $\beta=|F|$.
