# TAOCP 7.1.1 Boolean Basics (part 2)

> Study guide to TAOCP 7.1.1 Boolean Basics (part 2). Part 2 finishes 7.1.1 (book pages 62 to 78): the median (majority) operation and monotone self-dual…

Updated October 20, 2026.

## Summary {#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.

## Key facts {#key-facts}

- Week 121 of 145 on the cracked.guide path, in [TAOCP Vol 4A: Combinatorial Algorithms, Part 1](https://cracked.guide/taocp/volume-4a).
- Time budget: about 8 hours.
- 133 exercises in the section, rated 05 to M48; the guide picks 8.
- Picked exercises with Knuth's triangle for recommended: 65, 71, 99, 106, 128, 133 and 67.
- Before you start: 7.1.1 part 1.

## Week 121 goals {#objectives}

By the end of week 121 you can:

- Explain how the median operation yields monotone self-dual functions.
- Recognize threshold, symmetric and canalizing functions from their definitions.
- Compute a threshold function's value from its weights and threshold.

## This week's steps {#steps}

- Read §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.
- Work the exercises (8 picked): 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.

## Exercises {#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:

- 60 (rated 12): Decide which formulas really compute the median of three. Quick check that you know majority from its look-alikes.
- 65 (rated M21, 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.
- 71 (rated M21, recommended): Derive the long distributive law of median algebras from the short one. Short axiomatic practice.
- 99 (rated 20, recommended): Prove a median identity that lets you fold repeated inputs. Good warm-up for threshold functions.
- 106 (rated M25, recommended): Compare two binary numbers with a single large median. A threshold function with a hardware flavor.
- 128 (rated 20, recommended): Find a function true at exactly two points that is not canalizing. Checks you understand the definition.
- 133 (rated 20, 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.
- 67 (rated M30, recommended): Express the Y function (from the board game Y) as nested medians on a triangular grid. The stretch.

## Why it matters {#why}

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 {#before}

- 7.1.1 part 1

## How to approach it {#approach}

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 {#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.

## Links {#links}

- [Knuth's TAOCP page (editions, errata, MIX/MMIX)](https://www-cs-faculty.stanford.edu/~knuth/taocp.html)
- [Vol 4A errata (plain text, from Knuth)](https://www-cs-faculty.stanford.edu/~knuth/err4a.textxt)
- [Wikipedia: 2-satisfiability](https://en.wikipedia.org/wiki/2-satisfiability)
- [Wikipedia: Horn clause](https://en.wikipedia.org/wiki/Horn_clause)
- [Wikipedia: Majority function](https://en.wikipedia.org/wiki/Majority_function)

---

Source: https://cracked.guide/guide/knuth-w103-0
cracked.guide: A free, dated 145-week path to getting genuinely cracked at programming.
