in reply to Re: How likely is rand() to repeat?
in thread How likely is rand() to repeat?
But that's all irrelevant. Your random number generator is likely to only have 24, 32, 48 or 64 bits of entropy. Which means that most of the possible strings will never be generated. Even with 64 bits of entropy, there are only 18446744073709551616 strings possible. Which makes is far more likely for collisions to happen.
That would only be the case if he was only calling rand() once to pick from the 6.45e44 strings. But he is calling rand 25 times. Which as each pick is 'independant' of the previous and next picks, it increases the effective entropy.
By way of proof. If you throw a die once, you can only get 1 .. 6; but throw it twice and you can get 1 .. 36.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: How likely is rand() to repeat? (srand)
by tye (Sage) on Mar 09, 2012 at 00:08 UTC | |
by BrowserUk (Patriarch) on Mar 09, 2012 at 02:03 UTC | |
Re^3: How likely is rand() to repeat?
by JavaFan (Canon) on Mar 09, 2012 at 01:05 UTC | |
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 | |
|