On randomly permuting digits in a large random number

93 Views Asked by At

Suppose you're given a natural number with $N$ digits, randomly chosen except that none of the digits are $0$. Now shuffle its digits to obtain a new $N$-digit number. What is the probability (as $N\rightarrow\infty$, say) that the new number and the old one are relatively prime?

1

There are 1 best solutions below

9
On BEST ANSWER

We know that the chance two numbers are coprime is $\frac 6{\pi^2}$ as shown in this question.

The exclusion of $0$ changes the chances that the numbers are divisible by $2$ and $5$. With all digits included the chance one number is divisible by $2$ is $\frac 12$ and the chance both are is $\frac 14$. Now the chance a number is even is $\frac 49$ and the chance both are is $\frac {16}{81}$. Similarly the chance both are multiples of $5$ is now $\frac 1{81}$ instead of $\frac 1{25}$.

The scrambling of the digits introduces an important correlation because if one of them has a factor $3$ so does the other. The chance two numbers both have a factor $3$ is $\frac 19$ so in our case the factor $\frac 89$ that they do not both have a factor $3$ is replaced by a factor $\frac 23$.

The probability that they are not both multiples of any of $2,3,5$ now is $(1-\frac {16}{81})(1-\frac 13)(1-\frac 1{81})=\frac {10400}{19683}$ instead of $(1-\frac 14)(1-\frac 19)(1-\frac 1{25})=\frac {16}{25}.$ We would expect the probability they are coprime to be $\frac 6{\pi^2}\cdot \frac {25}{16} \cdot \frac {10400}{19683}\approx 0.502$ per Alpha.

I can't prove that there are no changes for the probability for other primes, but one way to motivate it for primes with rather less than $N$ digits is to think about each digit contributing the the remainder on division by the prime. It adds in one of nine remainders that are reasonably scattered through the residues.