TAOCP Vol 3: Sorting and Searching · Week 116

TAOCP 6.5 Retrieval on Secondary Keys

Updated

About 7 hours20 exercises, rated 19 to M47

Summary

TAOCP 6.5 Retrieval on Secondary Keys: Searching on attributes other than the primary key: inverted files, multi-attribute queries, range and partial-match queries, and superimposed coding (the idea behind Bloom filters). Budget about 7 hours; do exercises 3, 9 and 6.

Flashcards 13 cards for Anki and AnkiMobile · all decks

Anki deck.tsv

This week's steps

3 steps
  1. Read §6.5 Retrieval on Secondary Keys

    Build a tiny inverted index for a folder of text files and answer AND queries.

  2. Work the exercises (7 picked)

    Start with Ex 3, Ex 9, Ex 6; log what you solve below.

  3. Write down one thing you'd explain to someone

    A few sentences in your own words in Your notes: the idea, why it works, an example. 30 words ticks this.

Sign in to track this: tick each step off and it counts toward your week.

Exercises

This section has 20 exercises, rated 19 to M47, and Knuth marks 5 of them with the triangle for recommended. The set leans on combinatorial designs (Steiner triple systems, block designs). Do 3 to check you understand false drops in superimposed coding, then 14 if you have built k-d trees or quadtrees. 5 and 20 are open-ended.

Worth your time

  • Exercise 1M27▶ Recommended

    Construct permutations that put every small subset first somewhere.

    Discuss

  • Exercise 319

    Which queries produce particular false drops in the recipe example.

    Discuss

  • Exercise 6M20▶ Recommended

    Average locations per query for composed combinatorial hash functions.

    Discuss

  • Exercise 9M20

    Verify a construction of Steiner triple systems.

    Discuss

  • Exercise 1428

    Deletion in quadtrees and k-d trees. A real design problem.

    Discuss

  • Exercise 1625▶ Recommended

    Build superimposed codes from a triple system so no codeword is covered by two others.

    Discuss

  • Exercise 17M30▶ Recommended

    Analyze a bit-interleaving scheme for partial-match buckets. The stretch.

    Discuss

Your log

Sign in to log the exercises you work: number, rating, how far you got.

Your notes

Only you

Sign in to keep private notes on this guide, in Markdown. They stay yours: never on your profile, and you can export them all.

Discussion

0 posts

Questions about the reading go here; each exercise has its own thread below. Hints over answers.

No posts yet. Ask a question or share a tip.

Sign in to postAnyone can read. Posting needs an account with a confirmed email.

Exercise threads

One thread per exercise. Open one to ask for a nudge or check your thinking.

  • Exercise 1M27No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 319No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 6M20No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 9M20No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 1428No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 1625No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 17M30No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

Reference

Why it matters

Inverted indexes power every search engine, and Bloom filters are everywhere from databases to network caches.

Before you start
  • 6.4 Hashing
How to approach it

Build a tiny inverted index for a folder of text files and answer AND queries. Implement a Bloom filter and measure its false positive rate.

Common traps
  • Picking the number of Bloom filter hash functions without doing the math.

Spot a mistake? Report it

Back to week 116