3. Determine the number of ordered triples ( $A, B, C$ ) for which:
a) $A \cup B \cup C=\{1,2,3, \ldots, n\}$,

b) $A \cap B \cap C=\varnothing$,

c) $A \cap B \neq \varnothing$.
Solution. If the ordered triple ( $A, B, C$ ) satisfies the given conditions, then each of the numbers $1,2, \ldots, n$ is in one of the following six disjoint sets

$$
A \cap \bar{B} \cap \bar{C}, \bar{A} \cap B \cap \bar{C}, \bar{A} \cap \bar{B} \cap C, A \cap B \cap \bar{C}, A \cap \bar{B} \cap C, \bar{A} \cap B \cap C
$$

where at least one of these elements is in the set $A \cap B \cap \bar{C}$. The number of arrangements of $n$ elements in the mentioned six disjoint sets is equal to $6^{n}$. The number of arrangements where $A \cap B \cap \bar{C}=\varnothing$ is equal to $5^{n}$. Therefore, the desired number of arrangements is equal to $6^{n}-5^{n}$.