Consider strings consisting of 40 characters, where each character is one of the letters $a$, $b$, and
$c$. How many such strings contain at least three $a$'s?
Let A be the set of strings that contain no $a$'s
The 40 positions can be filled with either $b$ or $c$: $ 2^{40} $
$ |A| = 2^{40} $
Let B be the set of strings that contain exactly one $a$
We choose 1 position out of the 40 positions for the $a$: $ \binom{40}{1} $
The remaining 39 positions can be filled with either $b$ or $c$: $ 2^{39} $
$ |B| = \binom{40}{1} \cdot 2^{39} $
Let C be the set of strings that contain exactly two $a$'s
We choose 2 positions out of the 40 positions for the $a$'s: $ \binom{40}{2} $
The remaining 38 positions can be filled with either $b$ or $c$: $ 2^{38} $
$ |C| = \binom{40}{2} \cdot 2^{38} $
Let D be the set of strings that contain at least three $a$‘s