Jelani Nelson opens by announcing this is the last day devoted exclusively to hashing, and by fixing a lemma from the previous lecture. 0:00
Plan for the lecture
- Finish linear probing, showing the analysis works with only 5-wise independence (nearly the same proof as 7-wise, plus one trick).
0:20 - Approximate membership, i.e. Bloom filters.
0:20 - Cuckoo hashing, Bloomier filters (a generalization solving a different problem), and a word on the power of two choices.
0:50
The linear-probing setup being recapped
- Keys hash into an array of size
m, with the assumptionm ≥ 2n.1:34 - For an interval
Iof array locations,L(I)= number of keysj ∈ Swithh(j) ∈ I.2:22 Iis full ifL(I) ≥ |I|.2:45
The lemma as it should have been stated
If inserting
xtakeskprobes, thenh(x)is contained in at leastkfull intervals, each of length at leastk.3:34
- Proof sketch:
h(x)lands inside an occupied run bounded by a free spot; the interval containing that run plusxitself is full, and any prefix interval of a full interval is also full, givingkdistinct full intervals.4:585:26 - The intervals need not have length exactly
k— start at the beginning of the run, extend toh(x), and extend further if needed to reach lengthk.6:04 - The lemma exists only to justify one inequality: #probes to insert
x≤ #full intervals containingh(x), since thekintervals of the lemma are a subset of all full intervals containingh(x).6:467:19