Number of different ordered pairs

Here is the simplest way to answer the question. For each member of $X$ we have three choices for it: put that member in set $Y$, put it in set $Z$, or leave it out of both $Y$ and $Z$. That gives us three choices for each of five members: that gives us the final answer

$$3^5$$


If you want cases, just divide this problem into six cases, call them cases $0$ through $5$. Each case is determined by the size of set $Y$.

Case $0$: Set $Y$ has $0$ elements. There are ${5 \choose 0}$ choices for $Y$ here. Then choose set $Z$ as a subset of the elements that were not chosen for $Y$. So for each $Y$ there are $2^5$ possibilities for $Z$. (You probably know that given a set of size $k$ the number of subsets is $2^k$.) This gives us a total for this case of

$${5 \choose 0}\cdot 2^5$$

Case $1$: Set $Y$ has $1$ element. There are ${5 \choose 1}$ choices for $Y$ here. Then choose set $Z$ as a subset of the elements that were not chosen for $Y$. So for each $Y$ there are $2^4$ possibilities for $Z$. This gives us a total for this case of

$${5 \choose 1}\cdot 2^4$$

I'm sure you get the idea and can finish from here.


If you don't like calculation but you like those cases, here is a way to simplify the total sum of all the cases.

$$\begin{align} Total &= {5 \choose 0}2^5+{5 \choose 1}2^4+{5 \choose 2}2^3+{5 \choose 3}2^2+{5 \choose 2}2^1+{5 \choose 5}2^0 \\[2ex] &= {5 \choose 0}1^02^5+{5 \choose 1}1^12^4+{5 \choose 2}1^22^3+{5 \choose 3}1^32^2+{5 \choose 2}1^42^1+{5 \choose 5}1^52^0 \\[2ex] &= (1+2)^5 \end{align}$$

That collapse of the sum is from the binomial theorem. That, of course, leads us back to the answer I have at the beginning.


Here's another way to think about the problem.

Each element can be 'colored' with the color $Y$, $Z$ or $0$, based on whether it belongs to $Y$, $Z$ or $0$. Since $Y \cap Z = \emptyset$, each element can be assigned exactly one color for every possible ordered pair. For example, $Y = \{ 1,2,3\}$ and $Z= \{4 \}$ would give the coloring $YYYZ0$.

There are 3 different colors and 5 symbols, so $3^5$ possible colorings. Each coloring corresponds to a pair $(Y,Z)$, so there are $3^5$ such ordered pairs.