0

In data structure and algorithm analysis in C++ 's hash related chapters, λ is the load factor of a hast table,,When the author talks about linear probing which to resolve collisions,There's a sentence I can't understand:

We will assume a very large table and that each probe is independent of the previous probes. These assumptions are satisfied by a random collision resolution strategy and are reasonable unless λ is very close to 1. First, we derive the expected number of probes in an unsuccessful search. This is just the expected number of probes until we find an empty cell. Since the fraction of empty cells is 1 − λ, the number of cells we expect to probe is 1/(1 − λ).

my questions are:

  1. what is the meaning of the first bolded paragraph
  2. how can I deduce 1/(1-λ)

1 Answers1

0

How many randomly-chosen cells do you need to test before you find an empty one?

If the fraction of filled slots is λ, then the probability that a randomly-chosen slot will be full is also λ. You can find the expected number of slots you need to test by solving λn-1 = 0.5, so n = 1 + (log 0.5) / (log λ).

As long as λ is less than 0.6 or so 1/(1-λ) is a good approximation. Here is a plot from wolfram alpha:

enter image description here

Matt Timmermans
  • 53,709
  • 3
  • 46
  • 87