in reply to Re^4: How likely is rand() to repeat? (Mersenne)
in thread How likely is rand() to repeat?

"Just use a Mersenne Twister" doesn't solve the problem by itself.

There is no "problem" to solve.

The OP has stated that he needs less than a million IDs and is running on a 64-bit OS.

If he picks one starting point per run from the 2^64 that are possible -- using his built-in rand() or the MT19937-64 -- then he will be using 0.0000000000054210108624275221700372640043497% of the possibilities.

Another way: If he picks 1 new string, from a new starting position each time, every microsecond, he can expect a duplicate sometime in the next 50,000 years.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

  • Comment on Re^5: How likely is rand() to repeat? (Mersenne)