There's more than one way to do things  
PerlMonks 
Re: Re: Re: Autoreaping of duplicatesby blakem (Monsignor) 
on Oct 24, 2001 at 05:07 UTC ( #120973=note: print w/replies, xml )  Need Help?? 
only? Only!? Do you have any idea how big 2^128 is?
Which is bigger than the number of cups of water in all the oceans (6*10^21) (from bignum) Perhaps a secondary check is in order, but I'd hardly use 'only' when talking about 2^128 hash buckets.
Update: Let's assume perlmonks has 300,000 nodes (3*10^{5} ) and has 3*10^{38} buckets in its hashing algorithm. The ratio of nodes/buckets is 3*10^{5} : 3*10^{38} or 1 : 10^{33}. Now, consider this lottery where you pick six different numbers from 149. Get all six right and you win the jackpot. As the page above notes, the chances of winning with one ticket are:
1 : 13,983,816 ( (49*48*47*46*45*44)/(6*5*4*3*2*1) ) or about:
Lets buy one ticket a week for four weeks... odds of winning *all* four lotteries with our four tickets are: 1 : (10^{7})^{4} or 1 : 10^{28} . That *still* doesn't get you there... after winning your four lotteries, we'll take you to one of the new huge NFL stadiums being built, and you have to gamble all your winnings on picking a specific, randomlychosen seat (1 : 10^{5}) So the chances of my next post colliding with a node already in the database (1:10^{33} ) are about the same as you winning four lotteries on four tickets, then picking the single correct seat out of a gigantic stadium (1 : 10^{28}*10^{5}) Blake
In Section
Perl Monks Discussion

