Thus, for all buckets,

Given:

- n elements, uniformly distributed over all possible values
- n buckets

What is the probability that an element will be inserted into some bucket i?

**Answer:** p = 1/n.

Given n trials consisting of putting elements into buckets, how many elements
will be inserted into bucket i?

with mean *E*(*n*_{i}) = np = 1

and variance *Var*(*n*_{i}) = np(1-p) = 1 - 1/n

= 2 - 1/n

=

Therefore, *T*_{IS} =

and *T*_{BS} = 4n + n + 3 = O(n) for the average case.
In the worst case, the run time is *n*^{2}.