What's the probability that two positive integers chosen at random will be coprime?
probability/coprime New
New entry, edited from material collected for the archive and not yet in a released version.
Problem
What's the probability that two positive integers chosen at random will be coprime? [ Editor: posted by Vijay Raghavan <raghavan@umn-cs.UUCP>. ]
Show solution
Answer: 6/pi^2.
-- Michael Larsen
6/pi^2, or about 0.608. This is 1/zeta(2), where zeta is the Riemann
zeta function:
inf 1
zeta(x) = sum ---
n=1 n^x
The probability that n randomly chosen integers are coprime is 1/zeta(n).
Source: M. R. Schroeder [Editor: spelled "Shroeder" in the original],
"Number Theory in Science and Communication".
-- Joe Buck <jbuck@epimass.epi.com>
Several people have given the answer 6/pi**2 as the probability that two
positive integers chosen at random are co-prime. This value is obtained
as the limit of the probability of getting two co-primes when choosing
two integers from the set {1,2,. . . ,N} when N becomes arbitrarily
large. I am aware of this result (which happens to be the right answer)
but wish to point out that just because the limit exists does not
NECESSARILY mean that the answer is correct. In particular, the
probability measure is not valid when the sample space is countably
infinite.
I suggest that it is much more reasonable to define the event A(n) as
the set of all multiples of n, and the probability of A(n) as 1/n. The
measure has intuitive appeal since "every n-th integer" is a multiple of
n, and thus it is "natural" that when an integer is picked "at random",
it is a multiple of n 1-nth of the time, i.e. event A(n) has probability
1/n. This measure also does not have the problems associated with the
equally likely outcomes approach. Note that {A(p): p a prime} is a
collection of independent events.
Two independent trials of the experiment are carried out to get two
"positive integers picked at random". For this compound experiment,
compound events are of the form (A(m),A(n)) meaning that A(m) occurred
on the first trial and A(n) on the second trial. It can be verified
that the set of compound events {(A(p),A(p)): p a prime} is a collection
of independent events. But the probabilty that the integers are
co-prime is just the event that NONE of the events (A(p),A(p)) occurred
(p a prime). Hence, the desired probability is the probability of a
countable intersection (i.e. a limit), which by the set-continuity
property is just the limit of the product (1-1/p**2) over all the
primes. This is just 6/pi**2.
Note that the ideas in the above approach are also present in the
detailed derivations presented in other responses. However, the
probability measure assumed here DOES NOT assign probabilities to
individual outcomes, but only to the events in the sigma-field generated
by the A(n)'s.
[ Editor: the author of this last contribution is not named in the
collected material. ]