# In a random sequence of a million decimal digits what is the probability that there are exactly 100000 of each digit?

I want to check if the solution of this problem, which was extracted from Donald Knuth Book volume 2, is correct.

Lets put only one's. We have one million positions where to put 100000 '1's digits. This give us:

$$\binom{1000000}{100000}$$ Combinations.

Now to put the two's, we have 900000 positions and 100000 '2's, so:

$$\binom{900000}{100000}$$ Combinations.

And so on.

We have finally:

$$\binom{1000000}{100000} * \binom{900000}{100000} * ... * \binom{100000}{100000} = \dfrac{1000000!}{100000!*900000!} * \dfrac{900000!}{100000!*800000!} ... \dfrac{100000!}{100000!*0!}$$

Simplifying:

Total combinations of exactly 100000 of each digits= $$\dfrac{1000000!}{100000!^{10}}$$

The total combinations overall is $$10^{10^6}$$.

Thus:

Probability = $$\dfrac{\dfrac{1000000!}{100000!^{10}}}{10^{10^6}}$$

Thanks.

• Looks right to me. – saulspatz Oct 28 '18 at 12:52
• That's right; I agree. – kimchi lover Oct 28 '18 at 14:19
• Thanks for your help. – Carlitos_30 Nov 7 '18 at 14:25