Re: Math.random() algorithm



John G Harris said the following on 9/6/2007 3:46 PM:
On Wed, 5 Sep 2007 at 21:33:25, in comp.lang.javascript, Randy Webb
wrote:
Johannes Baagoe said the following on 9/5/2007 8:50 PM:
Randy Webb :

Yet you still think a random number poses the best solution versus a
sequential number?
It does. Among other things, sequential numbers are nowhere
anonymous
enough. Forget them.
Gives me some fair insight into the thought process of the French.

Be fair.

OK. I just find it odd that a society would think that random numbers, that have a probability of repeating - no matter how small that chance - is better than a system where the chance of repeating a number is impossible.

Random patient IDs make it unlikely that a small typo will
produce a valid ID, and hence the wrong patient.

That is true. And a simple solution exists for that. If you want a 16 digit patient ID, you create a database with those ID'es. You shuffle that database and then pick random entries from it. As you use an ID, you remove it from the database.

Either way, it doesn't really matter as the OP has already discounted that approach.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
.