🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #57537

Re: Using Message-ID to store binary file information

#57537
From: Andrew - Supernews
Date: Fri, 22 Mar 2002 14:04
27 lines
2566 bytes
In article <b8pl9u0lphocim3v2kj5r4ehaqpe27hhrs@4ax.com>, Coises wrote:
[chance of hash collision] 
> OK... let's try for, say, a 32-bit hash key and 10,000 files (for a year's
> time, that would be a little over 27 files a day):
>      (1-(1/(2^32-10000+2)))^(10000*(10000-1)/2)
> in my handy-dandy calculator gives:
>      0.988
> which means the odds would be a little more than 1 in 1oo that some pair of
> hash keys would collide.  Not bad... perhaps not quite good enough.
> 
> Math geeks are welcome to jump in and improve on the above.  :-)

this problem is known in the trade as the "birthday paradox".

(If you assume that birthdays are evenly distributed through the year, you
only need to get 23 people before you have a better-than-even chance that
two of them have birthdays on the same day.)

In general terms if you have N hash slots, the number of items K that
you need to have an even chance of collision varies as sqrt(N). Putting
that in binary terms means that you need at least twice as many bits of
hash as you might otherwise expect.

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services
Technical Details
Message-ID: <slrna9mefd.2hsu.andrew+nonews@trinity.supernews.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
References: <180320022351466617%planb@newsreaders.com> <20020320140409.897$WW_-_@newsreader.com> <200320021558402413%planb@newsreaders.com> <20020320174111.780$V8@newsreader.com> <200320022314345462%planb@newsreaders.com> <20020321022856.582$dC@newsreader.com> <210320021224366481%planb@newsreaders.com> <20020321125143.414$Wp@newsreader.com> <a7ddkd$j6s1m$1@ID-26705.news.dfncis.de> <3c9c54a2.1953960@news> <a7e4h9$kvunt$1@ID-26705.news.dfncis.de> <20020322023326.175$pl@newsreader.com> <b8pl9u0lphocim3v2kj5r4ehaqpe27hhrs@4ax.com>

Show Full Headers
Complete Article Headers
Message-ID: <slrna9mefd.2hsu.andrew+nonews@trinity.supernews.net>
Subject: Re: Using Message-ID to store binary file information
Date: Fri, 22 Mar 2002 14:04:29 -0000
From: andrew+nonews@supernews.com (Andrew - Supernews)
References: <180320022351466617%planb@newsreaders.com> <20020320140409.897$WW_-_@newsreader.com> <200320021558402413%planb@newsreaders.com> <20020320174111.780$V8@newsreader.com> <200320022314345462%planb@newsreaders.com> <20020321022856.582$dC@newsreader.com> <210320021224366481%planb@newsreaders.com> <20020321125143.414$Wp@newsreader.com> <a7ddkd$j6s1m$1@ID-26705.news.dfncis.de> <3c9c54a2.1953960@news> <a7e4h9$kvunt$1@ID-26705.news.dfncis.de> <20020322023326.175$pl@newsreader.com> <b8pl9u0lphocim3v2kj5r4ehaqpe27hhrs@4ax.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
Newsgroups: alt.usenet.offline-reader.forte-agent,news.software.nntp
Organization: http://www.supernews.com - all your nntp are belong to us
Reply-To: andrew@supernews.com
User-Agent: slrn/0.9.7.1 (FreeBSD)
X-Complaints-To: newsabuse@supernews.com
Lines: 26