Advanced Algorithms (COMPSCI 224), Lecture 4

Harvard University48 minutes read

By using symmetrization and carefully considering monomials, a constant expected time for insertion is achieved with five wise independence, whereas four wise independence may lead to potential log n probes. Various hashing techniques like bloom filters and cuckoo hashing are implemented for efficient processing and retrieval, improving data structure performance and query accuracy.

Insights

  • Symmetrization is a crucial technique used to simplify computations and manage expectations in hashing algorithms, ensuring non-negative results and avoiding concerns about cancellations or monomial counting accuracy.
  • Five wise independence is proven to be effective in achieving constant expected time for insertion in hashing, contrasting with the insufficiency of four wise independence that could lead to logarithmic probe times, showcasing the importance of carefully reasoning to avoid convergence issues and optimize hashing efficiency.

Get key ideas from YouTube videos. It’s free

Recent questions

  • What is linear probing in hashing?

    Linear probing involves placing elements in the next available slot.

Related videos

Summary

00:00

"Hashing Techniques and Probabilistic Analysis"

  • Last day focused on hashing, specifically on linear probing and five wise independence
  • Discussion on approximate membership, including bloom filters and cuckoo hashing
  • Mention of the power of two choices and other related topics
  • Recap of the lemma related to linear probing and array sizes
  • Lemma stating that inserting X takes K probes, leading to full intervals of length at least K
  • Explanation of how the lemma relates to the number of probes and full intervals containing X
  • Use of the moment method and raising both sides to the sixth power for analysis
  • Introduction of indicator random variables X1 to Xn for simplification
  • Utilization of symmetrization to simplify computations and manage expectations
  • Application of Benkoff's Keys inequality and Yin's inequality for bounding expectations and norms

23:40

"Symmetrization for Efficient Monomial Counting"

  • Monomials need to be carefully considered, with n to the sixth choices up to I six.
  • Symmetrization simplifies the counting problem by automatically ensuring non-negative results.
  • Symmetrization is a useful trick to avoid worrying about cancellations and counting monomials correctly.
  • Weis independence works by maintaining independence of six random variables after conditioning on one.
  • Five wise independence is proven to work by reasoning carefully to avoid convergence issues.
  • A constant expected time for insertion is achieved with five wise independence.
  • Four wise independence is insufficient, leading to potential log n probes instead of a constant number.
  • The Pay-Pei and Ruzek argument involves building a perfect binary tree over an array to eliminate the need for a Union bound.
  • Dangerous nodes in the binary tree are identified based on occupancy levels, aiding in efficient hashing.
  • The argument involves a modification of a lemma to show that a constant number of intervals of different lengths can be used to eliminate the need for a Union bound.

50:23

"Randomized Data Structures for False Positives"

  • The basic idea is to allow some slack, permitting false positives in a data structure.
  • The probability of a query being 1 for an element in the set is 1, while for an element not in the set, it should be at most 1/2.
  • The data structure providing this randomized guarantee is simple, utilizing an array.
  • An update involves setting a bit to 1 for an element in the set, and a query checks if the bit is 1.
  • To handle collisions, the probability of a false positive is bounded using the Union bound.
  • The update algorithm evaluates and sets bits, while the query outputs the bit value.
  • Bloom filters are implemented using a bit array and hash functions, with a false positive probability of 1/2.
  • To reduce false positives, multiple hash functions and arrays are used, with queries searching all arrays for a positive bit.
  • Cuckoo hashing is a solution for the dynamic dictionary problem, using two hash functions and an array.
  • The insertion algorithm involves placing elements based on hash functions, with a rebuild if a chain exceeds ten log n steps.

01:15:30

Efficient Orbit Retrieval Using Cuckoo Hashing

  • To solve the orbit retrieval problem, associate an orbit string with each element in a set, outputting the orbit string for a given element in the set, and creating a cuckoo hash-table for efficient processing.
  • In the static version of the problem, pre-process by creating the hash table, checking for cycles in the cuckoo graph, and adjusting hash functions until no cycles exist, with an expected number of iterations being two.
  • In a cycle-free cuckoo graph, represented as a forest, assign orbit strings to root nodes and fill in the trees from top down, ensuring correct values are stored in memory cells for accurate querying.
  • Consider alternative families of hash functions, such as multiply shift hashing, for efficient and fast processing, with ongoing research in the field presented at conferences like Fox and Stock.
Channel avatarChannel avatarChannel avatarChannel avatarChannel avatar

Try it yourself — It’s free.