TAOCP Vol 4A: Combinatorial Algorithms, Part 1 · Week 121
TAOCP 7.1.1 Boolean Basics (part 2)
Updated
Summary
TAOCP 7.1.1 Boolean Basics (part 2) finishes 7.1.1 (book pages 62 to 78): the median (majority) operation and monotone self-dual functions, median algebras and median graphs with their labels, median sets, threshold functions, symmetric Boolean functions, and more. Budget about 8 hours; do exercises 60, 65 and 71.
Part 2 finishes 7.1.1 (book pages 62 to 78): the median (majority) operation and monotone self-dual functions, median algebras and median graphs with their labels, median sets, threshold functions, symmetric Boolean functions, canalizing functions, and a closing table comparing how many functions of n variables fall into each class.
This week's steps
3 stepsRead §7.1.1 Boolean Basics (part 2)
Read the threshold and symmetric function material with pencil in hand: build a few small examples and check them against the definitions before moving on.
Start with Ex 60, Ex 65, Ex 71; 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 week covers exercises 60 to 133 of the 7.1.1 set (133 in all, rated 05 to M48, 39 recommended); this half has 74 exercises rated 10 to M48, with 20 recommended. Rough map: medians and self-dual functions 60 to 70, median algebras and graphs 71 to 96, threshold functions 97 to 113, symmetric functions 114 to 123, canalizing and counting 124 to 133. Several exercises rated 46 or 48 are open problems.
Worth your time
Exercise 6012
Decide which formulas really compute the median of three. Quick check that you know majority from its look-alikes.
Exercise 65M21▶ Recommended
Translate families of sets into Boolean functions and see which properties of the family become monotone or self-dual. The set view is used again for ZDDs.
Exercise 67M30▶ Recommended
Express the Y function (from the board game Y) as nested medians on a triangular grid. The stretch.
Exercise 71M21▶ Recommended
Derive the long distributive law of median algebras from the short one. Short axiomatic practice.
Exercise 9920▶ Recommended
Prove a median identity that lets you fold repeated inputs. Good warm-up for threshold functions.
Exercise 106M25▶ Recommended
Compare two binary numbers with a single large median. A threshold function with a hardware flavor.
Exercise 12820▶ Recommended
Find a function true at exactly two points that is not canalizing. Checks you understand the definition.
Exercise 13320▶ Recommended
Choose coin biases so the probability that a function of the random bits is 1 equals its truth table read as a binary fraction. A cute link between truth tables and probabilities.
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 6012No 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 65M21No 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 67M30No 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 71M21No 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 9920No 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 106M25No 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 12820No 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 13320No 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
Horn clauses are the basis of Prolog and Datalog, and 2SAT is one of the few satisfiability problems solvable in linear time, a classic competitive programming trick.
Before you start
- 7.1.1 part 1
How to approach it
Read the threshold and symmetric function material with pencil in hand: build a few small examples and check them against the definitions before moving on.
Common traps
- Expecting Horn clauses and 2SAT here. They are in part 1; this half is about medians and special classes of functions.
- Skipping the median material because it looks abstract. Median graphs connect 2SAT solutions, hypercube labels and distance problems.