Reply to Re: How to Gnerate a Random ID Number

Your name:

Reply:


Posted by Gert-Jan Strik on 06/15/07 16:14

> >> Well, that definitely rules out newid() as a "good" pseudo random number
> >> generator, then. A sequence of random numbers should have a chance to
> >> hold duplicates.
> >
> >Good observation. And so you correctly concluded that RAND() also does
> >not do this.
>
> Am I reading you incorrectly, or are you saying that the sequence of
> numbers generated by RAND() never produces the same value twice?

No, I am not saying that. It might, I haven't analyzed the algorithm
thoroughly. But that doesn't matter. A good pseudo random number
generator should incorporate the idea that in a range of 2 billion
values, there is a one in 2 billion chance that the same value is
selected next. And after that, then again there is a one in 2 billion
chance it will appear again. And that is something the algorithm doesn't
do. The algorithm is totally deterministic.

Gert-Jan

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация