Pick a proper fraction b a at random ( a < b ). What is the probability that a and b are coprime?
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.
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).
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 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 1 , …
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;
}
?>
Problem Loading...
Note Loading...
Set Loading...
If p 2 , p 3 , p 5 , … , p n are the probabilities that a and b do not have the prime factors 2 , 3 , 5 , … , 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 )
Let us first find the probability q m = 1 − p m that a and b do have the common factor m . Any integer number divided by m yields as remainders the numbers 0 , 1 , 2 , 3 , 4 , … , ( m − 1 ) . When picking an integer at random, the probability of getting the remainder 0 is m 1 . Therefore the probability that a and b both admit m as a factor is:
q m = 1 − p m = m 1 ⋅ m 1 = m 2 1 ⟹ p m = 1 − m 2 1
Expression ( 1 ) then becomes:
P = ( 1 − 2 2 1 ) ( 1 − 3 2 1 ) ( 1 − 5 2 1 ) …
To find the infinite product, we work with the reciprocal of P :
P 1 = 1 − 2 2 1 1 ⋅ 1 − 3 2 1 1 ⋅ 1 − 5 2 1 1 ⋅ …
Each of the factors in the expression above is the sum of a geometric progression:
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 1 + … ) …
Evaluate the product above to obtain:
P 1 = 1 + 2 2 1 + 3 2 1 + 4 2 1 + 5 2 1 + … = 6 π 2 (The first one to evaluate this sum was Leonhard Euler in the 18th century.)
Finally, the sought for probability is P = π 2 6 = 0 . 6 0 7 9 2 7 . . .
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.