My question is : Consider strings of five decimal digits, such as 00147, or 99999. In each case below, what is the number of such strings satisfying the given property? (a) The string has no repeated digits (b) The string contains exactly four 7s (c) No digit appears more than three times.
I'm not sure how to solve such problems like this. Help me out!! :(
Hint:
(a) Assuming this means no digit appears more than once: there are 10 choices for the first digit. After choosing the first digit, how many choices are there for the second, if we want to ensure that there are no repeated digits? Then, how many choices for the third? And so on...
(b) Each of these strings is determined by choosing the position of the digit that is not 7, then the actual digit. Multiply the number of choices at each step.
(c) It's easier to get the number of strings where some digit appears more than three times, then to subtract this number from $10^5$. At most one digit appears more than three times, which simplifies things (otherwise we'd need inclusion-exclusion).
Part (b) already gave the answer for 7 appearing 4 times: let's call this number $x$ for now (you should have this as a number). There's exactly one string where 7 appears 5 times: 77777. So, there are $x+1$ strings where 7 appears more than three times. Then there are $10(x+1)$ strings where some digit appears more than three times. Subtract this from $10^5$.