🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #57538

Re: Using Message-ID to store binary file information

#57538
From: Joe Newsreader
Date: Fri, 22 Mar 2002 14:33
34 lines
3388 bytes
On Fri, 22 Mar 2002 14:04:29 -0000, andrew+nonews@supernews.com (Andrew - Supernews) wrote:

>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's value of 23 is the correct number of people needed to
get at least a 50% of a match.  The popular rendition of the
puzzle gives 20 by using reasoning that leads to simpler calculations,
but which incorrectly sums the chances of events that are not mutually 
exclusive.

Joe

Technical Details
Message-ID: <g7gm9u8a3300c7t2tbn4hbs9adsacqs0i8@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!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-xfer2.newshosting.com!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mail
References: <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> <slrna9mefd.2hsu.andrew+nonews@trinity.supernews.net>

Show Full Headers
Complete Article Headers
Message-ID: <g7gm9u8a3300c7t2tbn4hbs9adsacqs0i8@4ax.com>
Subject: Re: Using Message-ID to store binary file information
Date: Fri, 22 Mar 2002 14:33:36 GMT
From: Joe Newsreader <not@this.address>
References: <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> <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!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-xfer2.newshosting.com!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mail
Newsgroups: alt.usenet.offline-reader.forte-agent,news.software.nntp
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 33
NNTP-Posting-Date: Fri, 22 Mar 2002 08:33:36 CST
Organization: Giganews.Com - Premium News Outsourcing
X-Trace: sv3-MOPmWNeHTSSiSV7cU5GTAlffgcg4muvG9Nbqi6S9gQ7Y60laUJMEWDeOZmJvMqm8zceuaMdi/nL/zh3!mIrOD+2iunL4i2HfNl7wgLlx30JM+oIhetRNSVhcl3FgkwBr8tg5OFBbrBsANEieOog=
X-Complaints-To: abuse@GigaNews.Com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly