I Probability of Sum of 2 Random Ints Being Prime

donglepuss
Messages
17
Reaction score
4
Unreasonable Request
TL;DR Summary
if I select two integers at random between 1 and 1,000, what is the probability that their sum will be prime?
if I select two integers at random between 1 and 1,000, what is the probability that their sum will be prime?
 
Physics news on Phys.org
If you roll two dice, what are the odds that the sum is prime?
 
  • Like
Likes sysprog
donglepuss said:
Summary:: if I select two integers at random between 1 and 1,000, what is the probability that their sum will be prime?

if I select two integers at random between 1 and 1,000, what is the probability that their sum will be prime?
What work have you done so far to come up with an answer? We expect some effort on your part.
 
  • Like
Likes sysprog
phinds said:
What work have you done so far to come up with an answer? We expect some effort on your part.
Given the amount of effort the OP put into this similar question (or this unrelated one , or this one) I think we will be disappointed.
 
  • Like
  • Wow
Likes DrClaude, sysprog and phinds
The question is not clear. Can you resolve its ambiguities/inclarities? Can the two integers selected at random be the same? Do you mean strictly between, i.e. from 2 too 999 inclusively, or do you instead mean from 1 to 1000 inclusively?

Are you trying to define a method for calculating this, or just trying to find the probability? If the latter, you could do a search and find that there are 168 prime numbers between 1 and 1000 [edit (thanks to @jbriggs444)], and you could do another search and find that there are another 135 primes between 1000 and 2000, and you then could then add 168 to 135, or you could just do one search on primes between 1 and 2000 and find that there are 303[/edit]. If the former, you can reduce part of the problem size by taking into account the fact that the only non-negative even integers that can sum to a prime are 0 and 2 ##-## no pair of even integers greater than zero can sum to a prime.

As other members said, if you show some effort on your part and still are having trouble solving the problem, we'll try to help ##-## I'll add that it's not a very difficult problem ##-## I think that with a modicum of effort, you could solve it.
 
Last edited:
  • Like
Likes Klystron
To be clear, it seems that OP is not asking about a uniform distribution between 1 and 1000 (a single 1000 sided die roll) but about the non-uniform distribution between 2 and 2000 (the sum of two dice).

So you make a spreadsheet, populate rows 2 through 2000 with a 1 for every prime number in column A. Fill in the rest of the column A entries with zeroes. Populate column B with the probability for each such dice roll and verify that column B totals to 1.

Populate column C with the product of A and B.

Add up the total for column C and *voila*, the hoped for answer.
 
  • Like
Likes sysprog
This looks too much like homework. Please report such posts when you seem them.

Thread closed.
 
Back
Top