TITLE: Probability that two random numbers are coprime is $\frac{6}{\pi^2}$
QUESTION [35 upvotes]: This is a really natural question for which I know a stunning solution. So I admit I have a solution, however I would like to see if anybody will come up with something different. The question is

What is the probability that two numbers randomly chosen are coprime?

More formally, calculate the limit as $n\to\infty$ of the probability that two randomly chosen numbers, both less than $n$ are coprime.

REPLY [33 votes]: Here is a fairly easy approach.
Let us start with a basic observation:
$\bullet$ Every integer has the probability "1" to be divisible by 1.
$\bullet$ A given integer is either even or odd hence has probability $"1/2"$ to be divisible by 2
$\bullet$ Similarly, an integer has a probability $"1/3"$ to be divisible by 3. Because any interger is either the form $3k, 3k+1$ or $3k+2$.

Conjecture More generally, one integer chosen amongst $"p"$ other integers has one chance to be divisible by $p$


From this we infer that the probability that  an integer is divisible by $p$ is $\frac{1}{p}$. This is having one chance over $p-$chances to be divisible by $p$.
Therefore the probability that two different integers are both simultaneously divisible by a prime $p$ is $\frac{1}{p^2}$
This means that the probability that two different integers are  not simultaneously divisible by a prime $p$ is $$1-\frac{1}{p^2}$$


Conclusion: The probability that two different integers are  never simultaneously divisible by a prime (meaning that they are co-prime)
is therefore given by
$$ \color{blue}{\prod_{p, prime}\left(1-\frac{1}{p^2} \right) =
\left(\prod _{p, prime}\frac {1}{1-p^{-2}}\right)^{-1}=\frac {1}{\zeta (2)}=\frac {6}{\pi ^{2}} \approx  0,607927102 ≈ 61 \%}$$




Where we should recall that, from the Basel problem we have the following Euler identity
$$\frac{\pi^2}{6}=\sum_{n=1}^{\infty} \frac{1}{n^2} = \zeta(2)=\prod _{p, prime}\frac {1}{1-p^{-2}}.$$
By a similar token, the probability that $m$ integers are co-prime is given by
$$ \color{red}{\prod_{p, prime}\left(1-\frac{1}{p^m} \right) =
\left(\prod _{p, prime}\frac {1}{1-p^{-m}}\right)^{-1}=\frac {1}{\zeta (m)}}.$$
Here $\zeta$ is the Riemann zeta function. $$\zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s} $$