If A and B are two sets, such that A has 20 elements, \( A \cup B \) has 32 elements, and \( A \cap B \) has 10 elements, the number of elements in the set B is:
Show Hint
Use the principle of inclusion and exclusion to calculate the size of set B when you know the sizes of \( A \), \( A \cup B \), and \( A \cap B \).
The formula for the union of two sets is:
\[
|A \cup B| = |A| + |B| - |A \cap B|
\]
Substituting the given values:
\[
32 = 20 + |B| - 10
\]
\[
|B| = 22
\]