Prove it – Ep6: Prime Probabilities

Let’s follow an algorithm:

  1. Determine heuristic used in example.
  2. Summarize math solution.
  3. Define new heuristic, if possible.
  4. Discuss Claude’s math solution.
  5. Provide dashboard solution, if possible.

Claude prompt:
You and a friend both have buckets with N marbles. You both choose a marble at the same time. What are the chances that the #’s you have chosen share a prime divisor?

Heuristic:

Examine for N=30. About 40%.

Mathematical solution:

For each prime p there is a 1/p^2 probability that you are your friend both chose a multiple.
= 1/2^2 + 1/3^2 + 1/5^2 – 1/2^23^2 – 1/2^25^2 + 1/2^23^25^2
is of the form:
a+b+c-ab-bc-ac+abc add 1-1 and factor:
1-(1-a)(1-b)(1-c) re substitute original terms and series coverges at 6/π² which is about .61 meaning answer is:

~.39

New heuristic

If both are even, then yes.

If both prime then no. Many numbers can be divided by 2 or 3.

If N is small (<100), lots of primes, guess 40%

If N large, guess 30% and then decrease as N grows.

Claude math

This convergence behavior occurs because as N gets larger, the distribution of numbers sharing prime divisors approaches its asymptotic distribution. The limit is derived from number theory principles related to the probability that two random integers are coprime (which is 6/π²).

Dashboard


Click the button to run it yourself!

Code

Efehn’s puzzles completely changed how I think—so engaging and rewarding!

Sarah Lee

Puzzle Enthusiast – Not a real person