I've been practising some combinatorics questions but am finding this one a bit difficult.
I recognise that we can split the question into 2 i.e.
- Find how many strings have three 3's
- Find how many strings have exactly 2 digits
- Add the totals together
My initial approach for the first part was to essentially remove 3 characters from the string (these represent the three 3's) and then remove the digit 3 from the selectable digits.
I'm using the formula $\binom{n + k -1}{k - 1}$ for this so $\binom{5 + 9 - 1}{9 - 1} = 1287$ but I feel like this is the incorrect approach.
For the second part, I believe we can just do $$\binom {10}{2} = 45$$
If these totals were correct, I would expect the final total to be $1287 + 45 = 1332$ but again I feel like my calculation for the first part is incorrect.