On Tue, Feb 23, 2016 at 11:26 AM, Jon Ribbens <jon+use...@unequivocal.co.uk> wrote: > On 2016-02-23, Chris Angelico <ros...@gmail.com> wrote: >> On Tue, Feb 23, 2016 at 11:08 AM, Jon Ribbens >><jon+use...@unequivocal.co.uk> wrote: >>>> If you generate 2**128 + 1 such numbers, you are *guaranteed* to >>> >>> ... have expired due to the heat death of the universe. >> >> Maybe... but by the time you get to 2**64 of them, you have a 50% >> chance of a collision. (That's either utterly intuitive or completely >> counter-intuitive, depending on who you are.) > > Um, did you mean to say 2**127? Are you thinking of the > birthday paradox or something, which doesn't apply here?
By the time you generate 2**64 of them, you have a 50% chance that some pair of them collides. Yes, the birthday paradox does apply here. ChrisA -- https://mail.python.org/mailman/listinfo/python-list