Article View: news.software.nntp
Article #57558Re: Using Message-ID to store binary file information
From: Curt Welch
Date: Fri, 22 Mar 2002 23:45
Date: Fri, 22 Mar 2002 23:45
70 lines
5621 bytes
5621 bytes
andrew@supernews.com wrote: > 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. That doesn't apply to this application. Or it might, depending on how you are thinking about it. But lets not get confused (if that's possible :)). The birthday paradox only applies when you have a fixed sized set and you are trying to avoid a hash collision between ANY of them. That would apply here to the problem of trying to use a hash to uniquely identify ALL files posted to Usenet (or posted to a single group) within a timeframe. So, for example, if you were trying to download every file posted to a group, and give than all unique names, you could use a hash to do that. The size of the hash needed for that problem is related to the birthday paradox. If any file collides with any other file, you have a problem. But when trying to find missing segments of files which a given user has partially downloaded, we only worry about a hash collision between one of the files he is looking for, and everything else posted to the group over some extended period of time, like a year. The size hash you need for this problem will be smaller than the size you need for the birthday paradox. It will be a function of the "typical" number of partial files the user will be seraching for. If that number were as high as 100, and the number of articles posted to the group in a year is Y, then the number of potential collisions is on the order of 100*Y for this problem instead of y^2 like it is for the birthday paradox. In other words, a shorter hash may mean that about N files posted to the group in a year will be expected to collide with N other files posted to the same group, but the odds of a given user downloading one of those files and trying to locate missing segments for it will be much smaller simply because most users don't download most files. If a typical user downloads 1 out of 100 files from the group, then the odds of him having a problem is more like N/100 (that's probably wrong), but it will be much less than N. Plus, if a file is posted, and a week later, segments are re-posted and the user finds everything he needs, the fact that a different file posted 2 months later has the same short hash is not going to cause him a problem. So there are mulitple effects at work reducing the odds of a hash collision in the group causing a problem for the user. So even though the birthday paradox is related to the odds of a hash collision happening in the group, the probability of a user having a problem because of one of those hash collision is much smaller. So the number of bits we need to reduce the user's problem to an acceptable level is going to be smaller than the number of bits needed to solve all hash collisions in the group (the birthday paradox). I suspect that while the birthday problem may need 2x the number of bits expected, this problem may simply need something closer to 1x. 1x I'm thinking is what you need if the user only downloads one file and searchs an entire year for missing parts, and if he searches for 100 files at once on the average every day, then the you may need to add log2(100) more bits to keep the probability of a problem the same? -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Technical Details
Message-ID:
<20020322184519.366$du@newsreader.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!newsfeed.berkeley.edu!news-hog.berkeley.edu!ucberkeley!news.spiralweb.com!peer1-sjc1.usenetserver.com!usenetserver.com!newsfeed1.cidera.com!Cidera!feed1.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mailReferences:
<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> <slrna9mefd.2hsu.andrew+nonews@trinity.supernews.net>Show Full Headers
Complete Article Headers
Message-ID: <20020322184519.366$du@newsreader.com>
Subject: Re: Using Message-ID to store binary file information
Date: Fri, 22 Mar 2002 23:45:19 +0000
From: curt@kcwc.com (Curt Welch)
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> <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!newsfeed.berkeley.edu!news-hog.berkeley.edu!ucberkeley!news.spiralweb.com!peer1-sjc1.usenetserver.com!usenetserver.com!newsfeed1.cidera.com!Cidera!feed1.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: alt.usenet.offline-reader.forte-agent,news.software.nntp
X-Trace: NewsReader.Com Dph9UVic+X/gBbaCsB_9qgCR6P/Jvr@f+fcfRAl_JOsh/Wh
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
%IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 69