>>13694411>If I select two integers at random between 1 and 100, what is the probability that their sum will be prime?Introduce two vectors A and B.
A is the vector whose entries is 1 if index = prime, else 0.
B is the vector whose entry with index = c contains the number of combinations (x,y) such that the additive function f(x,y) = x+y equals c.
Multiplying A and B results in the total number of possible combinations (x,y) leading to a prime number. If you want to compare this to the total number of possible correlations, introduce a new vector C =
. A, here the number of primes between 1 and n, can be approximated by .
Thus which is the desired result.
Because we're interested in calculating the probability of finding a prime for any number up to 200, we put in 1/log(200) = 0.1887 = 18.87 %.