Example 2.4 Let $h_{n}$ denote the number of different ways to distribute $n$ distinct objects to 3 children such that each child receives at least one object. Find the counting formula for $h_{n}$.
Let $S$ denote the set of different ways to distribute $n$ distinct items to 3 children, then $|S|=3^{n}$. Let $A_{i}(i=1,2,3)$ denote the set of distribution methods in $S$ where the $i$-th child does not receive any item, then
$$
\begin{array}{l}
h_{n}=\left|S-A_{1} \cup A_{2} \cup A_{3}\right|, \\
\left|\boldsymbol{A}_{1}\right|=\left|\boldsymbol{A}_{2}\right|=\left|\boldsymbol{A}_{3}\right|=2^{n}, \\
\left|\boldsymbol{A}_{1} \cap A_{2}\right|=\left|A_{1} \cap A_{3}\right|=\left|A_{2} \cap A_{3}\right|=1, \\
\left|\boldsymbol{A}_{1} \cap A_{2} \cap A_{3}\right|=0 .
\end{array}
$$

By Theorem 2.2, we get
$$
\begin{aligned}
h_{n}= & |S|-\left|A_{1}\right|-\left|A_{2}\right|-\left|A_{3}\right|+\left|A_{1} \cap A_{2}\right|+ \\
& \left|A_{1} \cap A_{3}\right|+\left|A_{2} \cap A_{3}\right|-\left|A_{1} \cap A_{2} \cap A_{3}\right| \\
= & 3^{n}-3 \cdot 2^{n}+3 .
\end{aligned}
$$