[Math] Number of $4$-digit numbers that can be formed with the digits $0,1,2,3,4,5$ with constraint on repetition

combinatoricspermutations

Problem Statement:-

Find the number of numbers of four digits that can be made from the digits $0,1,2,3,4,5$ if digits can be repeated in the same number. How many of these numbers have at least one digit repeated?

For those who wanna skip all the babble below this para on why I thought what I thought just jump to the Modified Problem Statement in the Edit.

Seems pretty easy, right? Until you are me who misread the given constraint on the repetition of the digits as this – "the numbers can be repeated as many times as their magnitude". So, this would imply $0$ being repeated $0$ times, so it will occur only $1$ time. Similarly, $1$ will repeat $1$ time so it will occur only $2$ times, and so $2$ occurs $3$ times, $3$ occurs $4$ times, and so on. If we were to write the multiset for the digits from which we can choose from then, the multiset would be
$$(\{(0,1),(1,2),(2,3),(3,4),(4,5),(5,6)\})$$

And after spending a lot of time I thought why not try to find a solution here, because I was not able to get one.


My Attempt at a solution to my proposed problem:-

The first digit can be anyone of the five non-zero digits. Assuming the non zero digits to be distinct, we get the total no of nonzero digits to be $20$, hence no of ways of selecting the first digit (i.e. the digit at the thousandths place) is $\displaystyle{{20}\choose{1}}$ and the remaining $20$ digits can be arranged in $3$ remaining spaces is ${}^{20}P_3$. Since we had assumed all the digits to be distinct (even those which were repeating), hence we need to set the overcount that we did due to repetition of arrangements hence we divide the ways of arranging by $(4!)^3.3!.2!.1!$ due to $3,4,5$ can have $4$ copies each in the arrangement, the digit $2$ has $3$ copies and the digit $1$ has $2$ copies. Hence, the total no of ways can be given as
$$\dfrac{\displaystyle{{20}\choose{1}}.{}^{20}P_3}{(4!)^3.3!.2!}$$.

On calculating this comes out to be a fraction. So, this is definitely not the correct approach.

Edit:- For all those who are solving the problem as given in the Problem Statement in the quotes, what I was wanting was that what if instead of the constraint the question had placed the constraint had been what I had interpreted it initially which I have already written just below the quote, i.e. "the numbers can be repeated as many times as their magnitude"

So, lets state the problem that I am trying to solve if you wanna skip all the babble in the first part

Modified Problem Statement:-

Find the number of numbers of four digits that can be made from the digits $0,1,2,3,4,5$ if digits can be repeated as many times as their magnitudes. How many of these numbers have at least one digit repeated?

Best Answer

The first part is simple. except zero, all digits can go at first and the remaining positions can be either of the six digits. So the total number of 4-digit numbers is:

$$A=5\times6\times6\times6$$

For the second part, the number of 4-digit numbers with no repeat is

$$B=5\times5\times4\times3$$

So the number of them with at least one repeat is $A-B$.