With three given digits (1,2,3), how many unique four-digit combinations can be made if all three digits must be present but may be repeated?
Example of correct combinations: (1,2,3,3) (1,1,2,3) (1,2,2,3) ... Incorrect: (1,1,2,2) (no "3" present)
With three given digits (1,2,3), how many unique four-digit combinations can be made if all three digits must be present but may be repeated?
Example of correct combinations: (1,2,3,3) (1,1,2,3) (1,2,2,3) ... Incorrect: (1,1,2,2) (no "3" present)
There are two possible interpretations of the problem: (i) How many strings of length $4$ are there or (ii) how many $4$-element multisets are there? I find the string interpretation more natural.
Counting strings: The digit that is repeated can be chosen in $3$ ways.
For each of these choices, the locations for the repeated digit can be chosen in $\binom{4}{2}$ ways.
For each of these ways, the leftmost open slot can be filled in $2$ ways.
Now the word is determined.
Counting multisets: Once we have decided which digit is repeated, it's over.