Why is $|Y^{\emptyset}|=1$ but $|\emptyset^Y|=0$ where $Y\neq \emptyset$ I have a question about the set of functions from a set to another set. I am wondering about the degenerate cases. Suppose $X^Y$ denotes the set of functions from a set $Y$ to a set $X$, why is $|Y^{\emptyset}|=1$ but $|\emptyset^Y|=0$ where $Y\neq \emptyset$?

The definition of $A^B$ is "the set of all functions with domain $B$ and codomain $A$".
A function $f$ from $B$ to $A$ is a set of ordered pairs such that:


*

*If $(x,y)\in f$, then $x\in B$ and $y\in A$.

*For every $b\in B$ there exists $a\in A$ such that $(b,a)\in f$.

*If $(b,a)$ and $(b,a')$ are in $f$, then $a=a'$.


Now, what happens if $B=\emptyset$? Well, then there can be no pair in $f$, because you cannot have $x\in B$. But notice that in that case, 2 is satisfied "by vacuity" (if it were false, you would be able to exhibit a $b\in\emptyset$ for which there is no $a\in A$ with $(b,a)\in f$; but there are no $b\in\emptyset$, so you cannot make such an exhibition; the statement is true because the premise, "$b\in\emptyset$", can never hold). Likewise 3 holds by vacuity. So it turns out that if we take $f=\emptyset$, then $f$ satisfies 1, 2, and 3, and therefore it is by all rights a "function from $\emptyset$ to $A$".  But this is the only possible function from $\emptyset$ to $A$, because only the empty set works.
By contrast, if $A=\emptyset$, but $B\neq\emptyset$, then no set $f$ can satisfy both 1 and 2, so no set can be a function from $B$ to $A$.
That means that $Y^{\emptyset}$ always contains exactly one element, namely the "empty function", $\emptyset$. But if $Y\neq\emptyset$, then $\emptyset^Y$ contains no elements; that is, it is empty. 
Therefore, since $Y^{\emptyset}$ has exactly one element, $|Y^{\emptyset}|=1$ regardless of what $Y$ is. But if $Y\neq\emptyset$, then $\emptyset^{Y}$ is empty, so $|\emptyset^{Y}| = 0$. 
