in reply to Re^2: How likely is rand() to repeat?
in thread How likely is rand() to repeat?
Which as each pick is 'independant' of the previous and next picks, it increases the effective entropy.But that's exactly the problem. As I indicated, if rand() would be perfect, it will pick each of the 645345427773512447880377451634304602899218432 different possible string with an equal chance.
But with most implementations of rand the picks are not independant; the sequence of return values of rand is completely determined by the value of the seed. If srand takes a 64 bit number as argument, then there are at most 264 sequences of return values of rand() possible. But that requires an excellent implementation of rand(), and you got to be lucky enough the mapping to 0..61 doesn't provide duplicates.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: How likely is rand() to repeat?
by BrowserUk (Patriarch) on Mar 09, 2012 at 02:39 UTC | |
by JavaFan (Canon) on Mar 09, 2012 at 03:21 UTC | |
by BrowserUk (Patriarch) on Mar 09, 2012 at 05:48 UTC | |
by JavaFan (Canon) on Mar 09, 2012 at 10:37 UTC | |
by BrowserUk (Patriarch) on Mar 09, 2012 at 11:50 UTC | |
|