Where this lecture sits
- The lecture continues the word RAM thread from the previous classes; hashing is the last topic in that block
0:01. - Planned agenda for the day
0:01,0:52,1:22:- Load balancing (balls and bins)
- k-wise independence
- The dictionary problem
- Perfect hashing (brief review only — covered in CS 124)
- Linear probing
- The retrieval problem → cuckoo hashing, Bloomier filters
- Membership → Bloom filters
- Simple tabulation hashing was listed as a stretch goal, expected not to fit in the time available
2:04. - Administrative note: Problem Set 1 has been up since Friday and is due Monday 11:59 PM (deliberately late at night rather than in the morning, to avoid all-nighters)
50:40.
The formal setup for hashing
- A hash family
His a set of functions mapping the universe{0, …, u-1}into a table of slots{0, …, m-1}2:37. - There is a set
S ⊆ Uwith|S| = n— the items we actually care about. We want to pick someh ∈ Hthat "behaves nicely" onS; what nicely means depends on the application (e.g. no two elements ofScollide)3:16. - Mental picture:
nitemsi1, …, infrom the universe, hashed byhinto an array ofmcells indexed0 … m-1, with collisions possible3:58,4:24.
Key symbols used throughout the lecture
| Symbol | Meaning |
|---|---|
u | size of the universe of keys |
n | number of items / active keys |
m | number of table cells (or machines) |
h | a single hash function drawn from the family |
H | the hash family itself |