Problem #92 MEDIUM

The Probability That Two Numbers Are Coprime

Paradox Probability Number Theory Math

Problem Statement

Pick two positive integers completely at random from all natural numbers. What is the probability that they share no common factor other than 1 — that is, they are coprime? The answer involves one of the most unexpected appearances of π in all of mathematics. What is it?

Answer & Quick Explanation

Think you've got it? Click below to check your answer.

P(two random integers are coprime) = 6/π² ≈ 60.79%. Derived from Euler's product formula and the Basel problem (ζ(2) = π²/6). π appears in a pure number theory result with no geometry involved — one of the most unexpected connections in mathematics. WOW Moment: - Pick any two random integers from 1 to ∞. Probability they share no common factor: 6/π² ≈ 60.79%. - π is a geometric constant — ratio of circumference to diameter. Yet it appears here in a problem about integer divisibility. No circles. No geometry. Just counting factors. - This result requires Euler's proof that 1+1/4+1/9+1/16+... = π²/6. Euler proved this in 1734. Mathematicians had tried for 90 years. - π hides inside prime numbers. The deeper you go into mathematics, the more π appears in places that have nothing to do with circles.

Detailed Editorial Solution

Want to see the step-by-step breakdown? Click below to reveal the editorial.

The appearance of the circle constant π in a problem about pure integer divisibility is one of the most beautiful surprises in number theory. Here is the step-by-step mathematical proof: 1. Two numbers a and b are coprime if they share no prime factors. 2. For any given prime number p: - The probability that p divides a random integer a is 1/p (since every pth integer is a multiple of p). - The probability that p divides both a and b is (1/p) × (1/p) = 1/p² (assuming independence). - The probability that p does NOT divide both a and b is 1 - 1/p². 3. For a and b to be coprime, this must hold true for *all* prime numbers. Assuming independence across different primes, the total probability is the infinite product over all primes: P(coprime) = Π (1 - 1/p²) for all primes p. 4. Now we connect this to the Riemann zeta function. The Euler product formula states: ζ(s) = Π (1 / (1 - p^(-s))) Taking the reciprocal: 1/ζ(s) = Π (1 - 1/p^s) 5. For s = 2, we have: 1/ζ(2) = Π (1 - 1/p²) Notice that this is exactly our probability P(coprime)! So, P(coprime) = 1/ζ(2). 6. What is ζ(2)? It is the sum of the reciprocals of the squares of all positive integers: ζ(2) = 1 + 1/4 + 1/9 + 1/16 + ... This sum is the famous Basel Problem. In 1734, Leonhard Euler proved that: ζ(2) = π²/6. 7. Therefore, the probability that two random numbers are coprime is: P(coprime) = 1 / (π²/6) = 6/π² ≈ 0.607927. To explain the WOW part: π appears because the Basel problem sum converges to a value containing π². The connection between circles and the Basel problem comes from the Taylor series expansion of the sine function, which has roots at multiples of π. This links the geometry of circles directly to the distribution of prime numbers.