So I had a problem saying how many $3$ digit numbers can be formed from the numbers $\{1,2,3\}$ where a digit can be repeated twice and the written answer was $18$.
When I tried to solve it myself by tree diagram and counting it was $24$ numbers. Then I tried by the techniques I know so I said the first digit would have $3$ possibilities the second one is also $3$ as we can repeat and the third one will be $2$ possibilities. So it will be $3\cdot 3\cdot 2=18$ but after some thinking I realised I am forgetting the numbers where there is no repetition which will be $3!$ added to the $18$ which make it $24$.
My question is am I right?And is there like a law for this?
Thanks in advance.
[Math] How many $n$ digit numbers formed from $n$ digits where a digit can be repeated twice
permutations
Related Question
- [Math] How many different 3-digit numbers can be formed if the number can consist of the digits from 0 to 7, cannot start with 0 and must be even
- [Math] Using digits $0,1,2,3,4$ and $5$ only once, how many $5$ digit numbers can be formed which are divisible by $4$
- [Math] How many different $3$-digit numbers can be formed if the digits $1$, $2$, $2$, $3$, $4$ are placed on separate cards
- [Math] How many $5$-digit positive even numbers can be formed by using all of the digits $1$, $2$, $3$ and $6$
- [Math] How many 3-digit numbers can be formed with the digits $1, 2, 3, 4$
- Sum of all $4$-digit numbers that can be formed with the digits $0,1,2,3$
- [Math] How many 2-digit numbers can be formed from even-numbered digits if the repetition of the digit is not allowed
Best Answer
For general $n$ you can have $k$ pairs of same digits $k$ in $\{0,1,...,[n/2]\}$
You have to pick $n-2k$ digits that would appear once, then among rest of $2k$ digits you have to pick $k$ which will appear twice. Now you have to permute all those digits, it will be $n!/2^k$ cos you have to divide by $2$ for each pair, so total will be $$\sum_{k=0}^{[n/2]}(\frac{n!}{(2k)!(n-2k)!}\frac{(2k)!}{k!k!})\frac{n!}{2^k}=\sum_{k=0}^{[n/2]}\frac{n!^2}{(k)!^2(n-2k)!2^k}$$ Maybe someone can handle this sum to get a simple formula??