3. For sets $A, B$ with union $A \cup B=\left\{a_{1}, a_{2}, a_{3}\right\}$, when $A \neq B$, $(A, B)$ and $(B, A)$ are considered different pairs. The number of such $(A, B)$ pairs is
(A) 8
(B) 9
(C) 26
(D) 27
(D)
3.【Analysis and Solution】Given $A \cup B\left\{a_{1}, a_{2}, a_{3}\right\}$, then the subsets $A, B$ can have at most 3 elements.
(1) If $A=\left\{a_{1}, a_{2}, a_{3}\right\}$, then the possible $B$ can be an empty set, a single-element set, a two-element set, or a three-element set. There are 
$\mathrm{C}_{3}^{0}+\mathrm{C}_{3}^{1}+\mathrm{C}_{3}^{2}+\mathrm{C}_{3}^{3}=2^{3}$ such $B$, and at this time, $(A, B)$ has $\mathrm{C}_{3}^{3} \cdot 2^{3}$ pairs.
(2) If $A$ is a two-element set, then there are $\mathrm{C}_{3}^{2}$ ways, and the corresponding $B$ has $2^{3}$ ways $\left(\mathrm{C}_{0}^{2}+\mathrm{C}_{2}^{1}+\mathrm{C}_{2}^{2}=2^{2}\right)$, at this time, $(A, B)$ has $\mathrm{C}_{3}^{2} \cdot 2^{2}$ pairs.
(3) If $A$ is a single-element set, then there are $\mathrm{C}_{3}^{1}$ ways, and the corresponding $B$ has 2 ways, at this time, $(A, B)$ has $\mathrm{C}_{3}^{1} \cdot 2$ pairs.
(4) If $A$ is an empty set, then there are $\mathrm{C}_{3}^{0}$ ways, and the corresponding $B$ has one way, at this time, $(A, B)$ has $\mathrm{C}_{3}^{0} \cdot 1$ pairs.
$\therefore$ Such $(A, B)$ pairs have
$\mathrm{C}_{3}^{3} \cdot 2^{3}+\mathrm{C}_{3}^{2} \cdot 2^{2}+\mathrm{C}_{3}^{1} \cdot 2+\mathrm{C}_{3}^{0} \cdot 2^{0}=3^{3}=27$ pairs, so the answer is (D).