Skip to main content
added 158 characters in body
Source Link
Ewan
  • 79.8k
  • 5
  • 83
  • 179

OK so in practice you will get a repeat at 1 million and a few. Not at 1 billion and 1.

You have 1000 random values 0-999. each number after the first million has a 1 in a thousand chance of hitting the same random number as its previous twin number.

So the chance of getting a duplicate on each number after 1m is 1/1000. Each time you take another number, the cumulative chance of getting a duplicate is higher. After 1,000,000 + n numbers the probability of a duplicate having occurred, p, is:

p = 1-(1/1000)^n

ie. 693 rolls of that dice later and you have a 50% chance of having had a duplicate. 5000 rolls and that's risen to 99.3%

(Obviously if you get to 2m then you have a 2/1000 chance for each number and so on, so you would need a step function to model the probability for all n)

OK so in practice you will get a repeat at 1 million and a few. Not at 1 billion and 1.

You have 1000 random values 0-999. each number after the first million has a 1 in a thousand chance of hitting the same random number as its previous twin number.

So the chance of getting a duplicate on each number after 1m is 1/1000. Each time you take another number, the cumulative chance of getting a duplicate is higher. After 1,000,000 + n numbers the probability of a duplicate having occurred, p, is:

p = 1-(1/1000)^n

ie. 693 rolls of that dice later and you have a 50% chance of having had a duplicate. 5000 rolls and that's risen to 99.3%

OK so in practice you will get a repeat at 1 million and a few. Not at 1 billion and 1.

You have 1000 random values 0-999. each number after the first million has a 1 in a thousand chance of hitting the same random number as its previous twin number.

So the chance of getting a duplicate on each number after 1m is 1/1000. Each time you take another number, the cumulative chance of getting a duplicate is higher. After 1,000,000 + n numbers the probability of a duplicate having occurred, p, is:

p = 1-(1/1000)^n

ie. 693 rolls of that dice later and you have a 50% chance of having had a duplicate. 5000 rolls and that's risen to 99.3%

(Obviously if you get to 2m then you have a 2/1000 chance for each number and so on, so you would need a step function to model the probability for all n)

added 11 characters in body
Source Link
Ewan
  • 79.8k
  • 5
  • 83
  • 179

OK so in practice you will get a repeat at 1 million and a few. Not at 1 billion and 1.

You have 1000 random values 0-999. each number after the first million has a 1 in a thousand chance of hitting the same random number as its previous twin number.

So the chance of getting a duplicate on each number after 1m is 1/1000. eachEach time you rolltake another number, the cumulative chance of getting a duplicate is higher. After 1,000,000 + n numbers the probability of a duplicate having occurred, p, is:

p = 1-(1/1000)^n

ie. 693 rolls of that dice later and you have a 50% chance of having had a duplicate. 5000 rolls and that's risen to 99.3%

OK so in practice you will get a repeat at 1 million and a few. Not at 1 billion and 1.

You have 1000 random values 0-999. each number after the first million has a 1 in a thousand chance of hitting the same random number as its previous twin number.

So the chance of getting a duplicate on each number after 1m is 1/1000. each time you roll the chance of getting a duplicate is higher

p = 1-(1/1000)^n

693 rolls of that dice later and you have a 50% chance of having had a duplicate. 5000 rolls and that's risen to 99.3%

OK so in practice you will get a repeat at 1 million and a few. Not at 1 billion and 1.

You have 1000 random values 0-999. each number after the first million has a 1 in a thousand chance of hitting the same random number as its previous twin number.

So the chance of getting a duplicate on each number after 1m is 1/1000. Each time you take another number, the cumulative chance of getting a duplicate is higher. After 1,000,000 + n numbers the probability of a duplicate having occurred, p, is:

p = 1-(1/1000)^n

ie. 693 rolls of that dice later and you have a 50% chance of having had a duplicate. 5000 rolls and that's risen to 99.3%

Source Link
Ewan
  • 79.8k
  • 5
  • 83
  • 179

OK so in practice you will get a repeat at 1 million and a few. Not at 1 billion and 1.

You have 1000 random values 0-999. each number after the first million has a 1 in a thousand chance of hitting the same random number as its previous twin number.

So the chance of getting a duplicate on each number after 1m is 1/1000. each time you roll the chance of getting a duplicate is higher

p = 1-(1/1000)^n

693 rolls of that dice later and you have a 50% chance of having had a duplicate. 5000 rolls and that's risen to 99.3%