From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753678AbXDKX1q (ORCPT ); Wed, 11 Apr 2007 19:27:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753676AbXDKX1q (ORCPT ); Wed, 11 Apr 2007 19:27:46 -0400 Received: from terminus.zytor.com ([192.83.249.54]:59937 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753493AbXDKX1p (ORCPT ); Wed, 11 Apr 2007 19:27:45 -0400 Message-ID: <461D6DE9.9070601@zytor.com> Date: Wed, 11 Apr 2007 16:23:21 -0700 From: "H. Peter Anvin" User-Agent: Thunderbird 1.5.0.10 (X11/20070302) MIME-Version: 1.0 To: David Lang CC: Neil Brown , Theodore Tso , =?ISO-8859-1?Q?J=F6rn_Engel?= , Christoph Hellwig , Ulrich Drepper , Linux Kernel Mailing List Subject: Re: If not readdir() then what? References: <200 70407203633.GA21555@thunk.org><20070407233037.GA16508@infradead.org><461930 48.6000606@zytor.com><20070408184129.GA20871@lazybastard.org><17947.65165.5 69482.976343@notabene.brown><20070411144252.GB17778@thunk.org> <17949.25061.739035.688232@notabene.brown> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org David Lang wrote: > On Thu, 12 Apr 2007, Neil Brown wrote: > >> For the second. >> You say that you " would need at least 96 bits in order to make that >> guarantee; 64 bits of hash, plus a 32-bit count value in the hash >> collision chain". I think 96 is a bit greedy. Surely 48 bits of >> hash and 16 bits of collision-chain-position would plenty. You would >> need 65537 entries before a collision was even possible, and >> billions before it was at all likely. (How big does a set of 48bit >> numbers have to get before the probability that "No subset of 65536 >> numbers are all the same" drops below 0.95?) > > Neil, > you can get a hash collision with two entries. > Yes, but the probability is 2^-n for an n-bit hash, assuming it's uniformly distributed. The probability approaches 1/2 as the number of entries hashes approaches 2^(n/2) (birthday number.) -hpa