TAOCP Vol 3: Sorting and Searching · Week 116
TAOCP 6.5 Retrieval on Secondary Keys
Updated
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.
This week's steps
3 stepsRead §6.5 Retrieval on Secondary Keys
Build a tiny inverted index for a folder of text files and answer AND queries.
Start with Ex 3, Ex 9, Ex 6; log what you solve below.
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.
Exercise 6M20▶ Recommended
Average locations per query for composed combinatorial hash functions.
Exercise 1625▶ Recommended
Build superimposed codes from a triple system so no codeword is covered by two others.
Exercise 17M30▶ Recommended
Analyze a bit-interleaving scheme for partial-match buckets. The stretch.
Your log
Sign in to log the exercises you work: number, rating, how far you got.
Your notes
Only youSign 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 postsQuestions 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```spoilerblock.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```spoilerblock.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```spoilerblock.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```spoilerblock.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```spoilerblock.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```spoilerblock.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```spoilerblock.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.