Problem
COM-B2-M02-P004 All Three Letters
#4
★★☆☆☆ Level 2 of 5
How many words of length \(5\) over the alphabet \(\{A,B,C\}\) contain all three letters?
Subtract words missing at least one letter.
There are \(3^5\) words. If a chosen letter is missing, there are \(2^5\) words, and \(3\) choices of the missing letter. If two chosen letters are missing, there is \(1^5\) word, with \(3\) choices; add these back. The answer is \(3^5-3\cdot2^5+3=150\).
A small version of the surjection formula.