how many $3$ digit numbers can be formed by $1,2,3,4$, when the repetition of digits is allowed?
So basically, I attempted this question as-
There are 4 numbers and 3 places to put in the numbers: In the ones place, any 4 numbers can be put, so there are 4 choices in the ones place. Similarly for the tens and the hundreds place. So, the total choices are, by multiplication principle- $$4*4*4=64$$ And well and good, this was the answer.
But what if I reversed the method?
So I take some particular numbers, like $1,2,3$ and say that, well, $1$ can go in $3$ places, $2$ in $2$ places and $3$ in $1$ place, so by multiplication principle, there are $6$ ways of forming a $3$-digit number with $1,2,3$.
But there are $4$ different numbers. So the number of $3$-number combinations are- $(1,2,3)$,$(1,2,4)$,$(1,3,4)$,$(2,3,4)$. Each can be arranged in $6$ ways, so we get $24$ ways totally.
So why is my answer different here?
Your answer is different because in the question, repitition is allowed, but you have only chosen combinations $(1,2,3),(1,2,4),(1,3,4),(2,3,4)$ in which there are no repeat numbers. So the combinations that you were supposed to include were $(1,1,1),(2,2,2),(3,3,3),(4,4,4), (1,2,2), (1,3,3),(1,4,4)...$ and so on.
Now, if you count the permutations for each of these combinations separately, and add it to 24, you will get 64.
Hope this helps :)