Some probability

The other day, somebody texted me a brain teaser: A and B are random positive integers. What is the probability that the greatest common factor of A and B is not 1? At first, I thought that the answer was zero. There’s infinite natural numbers, so it may seem like the probability is one over infinite. Before Potter says something, I know that one over infinite is not the same as zero, but there’s literally an infinitely small amount between these two, so I don’t mind rounding down in this case. The probability, though, is not zero.

Let’s say I make A equal to 2. If B is even, then the greatest common factor is 2. If B is odd, then the GCF is 1. There is a 50% chance that the GCF will not be one in this case. If I make B equal to 3, then the line of logic is similar. If B is a multiple of 3, then the GCF is not 1, so the probability is 1/3. This works when A is a prime number because if B is not a multiple of A, then the GCF is 1.

Image result for even and odd numbers
There’s a 50% chance that a natural number is even. If you made it this far in my blog and don’t understand this chart, I don’t know what to tell you.

Things become more complicated, however, when I make A equal to 4. Things start getting funky because 4 is a composite number. There is not a one fourth chance that the GCF is greater than one; if B is even, then the GCF will be at least two. The probability when A is 4 is actually 1/2. The same is true for all powers of 2: the probability will always be 1/2 for these numbers.

So currently, the net probability of the GCF being anything but 1 is 1/4; 1/2 chance that A is even, and 1/2 chance that B is also even. The probability is going to be an infinite sum, so I need to find a pattern, or else I will have no idea what the total probability is.

There is a 1/3 chance that A is a multiple of 3, and a 1/3 chance that B is also a multiple of 3. The probability together is 1/9. For every prime number n, the probability that both A and B are multiples of n is 1/n^2. I do not need to include composite numbers because their probabilities are included in their prime factors’ probabilities.

The answer should be the sum of the reciprocal of all prime numbers squared. This is not the case, however. Wolfram Alpha says that the sum of the reciprocal of all prime numbers squared is about .452. When I write a program into my calculator that estimates the probability, the answer stubbornly hovers around .383. My best guess is that composite numbers that have multiple prime factors are included multiple times in the probability. I need to somehow account for those numbers, and then I will have a solution.

So yes, you dragged yourself through this blog post and didn’t even get an answer. I don’t actually know what I’m doing; I’m just a high schooler trying to solve math. Here’s a preview of next week’s post.

Image result for mandelbrot fractal gif

 

 

Leave a comment