A probability problem by Gabriel Chacón

Pick a proper fraction a b \dfrac{a}{b} at random ( a < b a<b ). What is the probability that a a and b b are coprime?


The answer is 0.607927.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Gabriel Chacón
Feb 23, 2019

If p 2 , p 3 , p 5 , , p n p_2, p_3, p_5, \ldots, p_n are the probabilities that a a and b b do not have the prime factors 2 , 3 , 5 , , n 2,3,5,\ldots,n in common respectively, the probability that they do not have any of these prime factors in common is:

P = p 2 p 3 p 5 p m p s ( 1 ) P=p_2 \cdot p_3 \cdot p_5 \cdot \ldots \cdot p_m \cdot \ldots \cdot p_s \cdot \ldots \quad (1)

Let us first find the probability q m = 1 p m q_m=1-p_m that a a and b b do have the common factor m m . Any integer number divided by m m yields as remainders the numbers 0 , 1 , 2 , 3 , 4 , , ( m 1 ) 0,1,2,3,4,\ldots,(m-1) . When picking an integer at random, the probability of getting the remainder 0 0 is 1 m \frac{1}{m} . Therefore the probability that a a and b b both admit m m as a factor is:

q m = 1 p m = 1 m 1 m = 1 m 2 p m = 1 1 m 2 q_m=1-p_m = \dfrac{1}{m} \cdot \dfrac{1}{m}=\dfrac{1}{m^2} \quad \implies \quad p_m=1-\dfrac{1}{m^2}

Expression ( 1 ) (1) then becomes:

P = ( 1 1 2 2 ) ( 1 1 3 2 ) ( 1 1 5 2 ) P=\left( 1-\dfrac{1}{2^2} \right) \left( 1-\dfrac{1}{3^2} \right) \left( 1-\dfrac{1}{5^2} \right) \ldots

To find the infinite product, we work with the reciprocal of P P :

1 P = 1 1 1 2 2 1 1 1 3 2 1 1 1 5 2 \dfrac{1}{P}=\dfrac{1}{ 1-\frac{1}{2^2} }\cdot \dfrac{1}{ 1-\frac{1}{3^2} }\cdot \dfrac{1}{ 1-\frac{1}{5^2} }\cdot \dots

Each of the factors in the expression above is the sum of a geometric progression:

1 P = ( 1 + 1 2 2 + 1 ( 2 2 ) 2 + ) ( 1 + 1 3 2 + 1 ( 3 2 ) 2 + ) ( 1 + 1 5 2 + 1 ( 5 2 ) 2 + ) \dfrac{1}{P}=\left( 1+\dfrac{1}{2^2} +\dfrac{1}{(2^2)^2} + \ldots \right) \left( 1+\dfrac{1}{3^2} +\dfrac{1}{(3^2)^2} + \ldots \right) \left( 1+\dfrac{1}{5^2} +\dfrac{1}{(5^2)^2} + \ldots \right) \ldots

Evaluate the product above to obtain:

1 P = 1 + 1 2 2 + 1 3 2 + 1 4 2 + 1 5 2 + = π 2 6 \dfrac{1}{P}= 1 + \dfrac{1}{2^2} + \dfrac{1}{3^2} + \dfrac{1}{4^2} + \dfrac{1}{5^2} + \ldots = \dfrac{\pi ^2}{6} (The first one to evaluate this sum was Leonhard Euler in the 18th century.)

Finally, the sought for probability is P = 6 π 2 = 0.607927... \boxed{ P=\dfrac{6}{\pi ^2}=0.607927... }

It is fair to say that neither the problem nor the solution are mine, of course. I found them in a 1948 book published in Madrid, Problemas de cálculo de probabilidades by J. Gallego Díaz, Ediciones Hispano-Argentinas. The problem is attributed to Chebyshev.

Jaw dropping... Something that is further my understanding is how you convert the (infinity?) product of infinity sums in that neat series (that Euler calculated).

Félix Pérez Haoñie - 2 years, 3 months ago

Log in to reply

Note that in the denominators we have all the squares and even powers of all prime numbers that allow us to generate all integer squares. Furthermore, these appear only once since the prime factoring of each number is unique. As examples, you have 1 4 2 = 1 ( 2 2 ) 2 , 1 6 2 = 1 2 2 1 3 2 , , 1 1 5 2 = 1 3 2 1 5 2 , , 1 3 0 2 = 1 2 2 1 3 2 1 5 2 , , 1 3 6 2 = 1 ( 2 2 ) 2 1 ( 3 2 ) 2 , \dfrac{1}{4^2}=\dfrac{1}{(2^2)^2}, \dfrac{1}{6^2}=\dfrac{1}{2^2}\cdot\dfrac{1}{3^2},\ldots, \dfrac{1}{15^2}= \dfrac{1}{3^2}\cdot\dfrac{1}{5^2}, \ldots, \dfrac{1}{30^2}= \dfrac{1}{2^2}\cdot\dfrac{1}{3^2}\cdot\dfrac{1}{5^2},\ldots,\dfrac{1}{36^2}=\dfrac{1}{(2^2)^2}\cdot\dfrac{1}{(3^2)^2}, \ldots

Gabriel Chacón - 2 years, 3 months ago

Log in to reply

Thank you very much.

Félix Pérez Haoñie - 2 years, 3 months ago
Kyle T
Feb 26, 2019

tested with b going up to 999 and every possible value for a given that value b, got a close enough answer to be considered correct

<?php
$t=0;
$c=0;
for($b=2;$b<=999;$b++){
for($a=1;$a<$b;$a++){
$c++;
if(gcd($a,$b)==1){
$t++;
}
}
}
echo $t/$c; //0.609



function gcd($a,$b) {
return ($a % $b) ? gcd($b,$a % $b) : $b;
}
?>

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...