I have a statement that says:
With the numbers $1, 2, 3$ How many of them contain all the digits $1$, $2$ and $3$ at least once?
I must have a number as _ _ _ _ _ _ , with $1, 2, 3$ at least once and with any position, so its possible positions are $6 * 5 * 4 = 120$, also the others 3 digits, can be {$1, 2, 3$} and can repeated so is $3^3 = 27$, and applying multiplicative principle, $120 * 27 = 3240$, but the result is totally wrong, what is wrong in my development ?
Total ways to write this: $3^6=729$
Don't include the number '1': $2^6=64$
Thus, the number of ways can be calculated by take away ways that don't include 1,2 or 3, which is $$729-3*64+3=540$$ since 111111, 222222 and 333333 are counted twice.