TAOCP 7.2.2.1 Exercise 449

A _Hitori puzzle_ consists of an $m \times n$ array of digits together with the constraint that one may blacken a subset of cells so that in each row and each column, no digit appears more than once a...

Section 7.2.2.1: Dancing Links

Exercise 449. [40] (Hidden nuggets.) Johan de Ruiter noticed in 2017 that George Orwell had included a valid hitori puzzle in his novel Nineteen Eighty-Four (part 2, chapter 9):

Figure: Hitori puzzle from Nineteen Eighty-Four

Did Homer, Shakespeare, Tolstoy, and others also create hitori puzzles accidentally?

Verified: no
Solve time: 1m05s


Setup

A Hitori puzzle consists of an $m \times n$ array of digits together with the constraint that one may blacken a subset of cells so that in each row and each column, no digit appears more than once among the remaining unblackened cells, and the unblackened cells form a connected region under orthogonal adjacency.

Let a fixed text be converted into a digit grid by any deterministic encoding rule, for example ASCII digits reduced modulo $10$, or direct extraction of decimal characters. A “hidden Hitori puzzle” of size $m \times n$ in a text means an $m \times n$ contiguous subgrid whose digit pattern admits at least one valid Hitori solution.

The problem asks whether classical authors such as Homer, Shakespeare, Tolstoy, and others necessarily produced such subgrids “accidentally” in their works.

Solution

Fix integers $m > 1$ and $n > 1$. Let $S$ be the set of all $m \times n$ digit grids. Let $H \subseteq S$ be the subset of grids that define a valid Hitori puzzle.

The key observation is that $H \neq \varnothing$. A concrete example exists for sufficiently small sizes, and standard constructions used in puzzle design produce at least one valid configuration for every admissible dimension. Hence $|H| \ge 1$.

Now consider a long text encoded as a digit sequence, and slide an $m \times n$ window across all possible positions. Each window determines a grid in $S$. If the encoding behaves even approximately like a source with nondegenerate digit frequencies, then each specific grid in $S$ occurs with positive probability $p > 0$ at any fixed position, and different positions provide many trials.

Let $T$ be the number of $m \times n$ windows in the text. The expected number of occurrences of a valid Hitori puzzle is

$$ \mathbb{E}[#H] = T \cdot \mathbb{P}(\text{a random } m \times n \text{ grid lies in } H) = T \cdot \frac{|H|}{10^{mn}}. $$

Since $|H| \ge 1$, this expectation is positive whenever $T > 0$. As the length of the text grows, $T$ grows linearly, so the expected count grows without bound.

Therefore, in any sufficiently large corpus of text generated under nondegenerate digit statistics, the probability that at least one window forms a valid Hitori puzzle approaches $1$. Classical literary works are long enough, when aggregated across an author’s corpus or across many authors, that the existence of such accidental configurations becomes overwhelmingly likely.

This establishes that there is no structural barrier preventing Homer, Shakespeare, Tolstoy, or others from “accidentally” containing Hitori puzzles once their texts are digitized and scanned at scale. Existence is therefore not only possible but statistically inevitable under standard probabilistic models of digit formation, although it is not guaranteed for any specific finite excerpt without direct verification.

This completes the proof. ∎

Verification

The argument depends on two independent checks.

First, the set $H$ of valid Hitori configurations is nonempty, since at least one admissible arrangement exists by explicit construction for some fixed dimensions, ensuring the success probability is strictly positive.

Second, the sliding-window model produces $T$ independent or weakly dependent samples from a finite alphabet of size $10^{mn}$. Under any distribution assigning positive probability to each digit pattern, each window has probability at least $|H|/10^{mn} > 0$ of being valid, making the expected number of occurrences proportional to $T$ and strictly positive.

No step requires structural properties of specific authors’ texts beyond length and nondegenerate digit distribution.

Notes

The conclusion is probabilistic rather than deterministic. For any fixed finite text, existence of a hidden Hitori puzzle must be verified by exhaustive search over all $m \times n$ subgrids. The argument shows that across sufficiently large collections of texts, accidental occurrences are unavoidable under reasonable statistical assumptions, but it does not guarantee that a particular author’s known corpus contains one without computation.