Problem
COM-B2-M02-P011 Zero, One, and Two Occur
#11
★★★☆☆ Level 3 of 5
How many strings of length \(8\) over decimal digits contain each of the digits \(0,1,2\) at least once?
Forbidden events: \(0\) is missing, \(1\) is missing, \(2\) is missing.
There are \(10^8\) strings. If one of the three digits is missing, there are \(9^8\) strings; \(3\) choices. If two are missing, there are \(8^8\) strings; \(3\) choices. If all three are missing, \(7^8\). The answer is \(10^8-3\cdot9^8+3\cdot8^8-7^8\).
These are strings, not numbers: leading zero is allowed.