Omnium Gatherum

Consider k threads accessing concurrently a data structure with n entries. The probability that at least one thread access a particular entry is one minus the probability that every thread accesses an entry other than that:

1 ( n 1 n ) k

Utile theorema . When k n , this is approximately k / n .

1 ( 1 1 / n ) k k / n

Ratio demonstrandi . When k = 1, this is exact:

1 ( 1 1 / n ) = 1 1 + 1 / n = 1 / n

Considering k = 2 and k = 3 gives the general idea of an argument. We first reärrange

1 k / n ( 1 1 / n ) k

and then expand:

( 1 1 / n ) 2 = 1 2 / n + 1 / n 2 ( 1 1 / n ) 3 = ( 1 2 / n + 1 / n 2 ) ( 1 1 / n ) = 1 3 / n + 3 / n 2 1 / n 3 .

Here we can see the origin of the k / n term, and it appears that simply applying the binomial theorem will suffice.

( 1 1 / n ) k = ( k 0 ) 1 k ( 1 / n ) 0 + ( k 1 ) 1 k 1 ( 1 / n ) 1 + ( k 2 ) 1 k 2 ( 1 / n ) 2 + ( k 3 ) 1 k 3 ( 1 / n ) 3 + · · · = 1 k n + k ( k 1 ) 2 1 n 2 k ( k 1 ) ( k 2 ) 6 1 n 3 + · · ·

to-do finish proof and remark this can be used to calculate chance of collision