TAOCP 7.2.2.1 Exercise 282

The original argument fails because it replaces the geometric constraint system with an exact-cover abstraction and then draws global invariance conclusions that do not follow.

Section 7.2.2.1: Dancing Links

Exercise 282. ▶ [22] [22] (Craig S. Kaplan.) A polyomino can sometimes be surrounded by nonoverlapping copies of itself that form a fence: Every cell that touches the polyomino, even at a corner, is part of the fence; conversely, every piece of the fence touches the inner polyomino. Furthermore, the pieces must not enclose any unoccupied "holes."

Find the (a) smallest and (b) largest fences for each of the twelve pentominoes. (Some of these patterns are unique, and quite pretty.)

Verified: no
Solve time: 3m


The original argument fails because it replaces the geometric constraint system with an exact-cover abstraction and then draws global invariance conclusions that do not follow. The correct approach is to keep the problem in its actual geometric setting: a finite set of lattice placements constrained by local adjacency to the central pentomino, and then analyze each pentomino separately.

1. Correct formulation of a fence

Fix a pentomino $P\subset \mathbb{Z}^2$. Let $N(P)$ be the set of all unit cells $x \notin P$ such that $x$ shares an edge or a corner with some cell of $P$. These are the cells that must be covered by the fence.

A fence is a finite set $\mathcal{C}(P)$ of pairwise nonoverlapping translates and rotations of $P$, such that:

  1. (Coverage) Every cell of $N(P)$ belongs to at least one copy in $\mathcal{C}(P)$.
  2. (Exactness on the boundary) Every cell in any copy of $\mathcal{C}(P)$ that lies in $N(P)$ is part of the fence; equivalently, no fence piece introduces uncovered or extraneous boundary-adjacent cells.
  3. (Contact) Every copy intersects $P$ in at least one edge- or corner-adjacent cell (so no piece is “floating” away from $P$).
  4. (No holes) The union $P \cup \bigcup \mathcal{C}(P)$ has no finite connected component of $\mathbb{Z}^2\setminus (P \cup \bigcup \mathcal{C}(P))$.

This is a finite constraint satisfaction problem on lattice placements, not an abstract set cover problem.

2. Where the previous proof fails

The previous solution breaks in three essential ways:

  • The “exact cover of boundary cells” model is incorrect because a single pentomino placement interacts with boundary cells nonlocally; it is not determined by its intersection with $N(P)$ alone.
  • There is no invariant forcing all fences to have equal cardinality. Different placements can extend outward differently while still covering the same required neighborhood.
  • No uniqueness theorem holds: the space of valid fences is a finite but nontrivial set of constrained tilings, not a singleton.

Thus both “min = max” and “all fences are identical” are false.

3. Correct structure of the solution space

For each pentomino $P$, the set of all valid fence configurations is finite because:

  • Any valid fence must lie within a finite dilation of $P$ (otherwise it cannot touch $P$ and still cover $N(P)$).
  • Each placement is chosen from a finite set of translations and rotations that intersect this bounded region.
  • The constraints (nonoverlap, full coverage of $N(P)$, and no holes) are local and finite.

Hence for each $P$, the problem reduces to a finite search over admissible configurations.

4. Why minima and maxima can differ

Unlike the flawed argument suggests, the number of fence pieces is not fixed.

Two mechanisms create variability:

(i) Overlapping coverage of boundary cells

A single pentomino copy may cover boundary-adjacent cells in different ways depending on how it extends outward, changing how efficiently $N(P)$ is covered.

(ii) Nonrigid extension away from $P$

Copies are only required to touch $P$, not to remain close to it. Some fences use compact placements; others “flare outward,” forcing additional pieces to maintain coverage without overlap.

Thus the same $P$ can admit fences with different cardinalities.

5. Correct computational characterization

For each pentomino $P$, define:

  • $\mathcal{A}(P)$: all placements of $P$ that touch $P$ and intersect the bounded search region.

  • A valid fence is any subset $\mathcal{C}\subset \mathcal{A}(P)$ satisfying:

  • pairwise disjointness,

  • coverage of $N(P)$,

  • no-hole condition.

Then:

$$ \min |\mathcal{C}(P)| = \min_{\mathcal{C}\ \text{valid}} |\mathcal{C}|, \qquad \max |\mathcal{C}(P)| = \max_{\mathcal{C}\ \text{valid}} |\mathcal{C}|. $$

This is a finite optimization problem over a constrained geometric configuration space.

6. What remains to complete the exercise

At this point the problem is fully reduced to a finite case analysis:

  • enumerate all admissible placements of each pentomino around its neighborhood,
  • solve the resulting finite exact-constraint system,
  • extract minimum and maximum cardinalities separately for each of the twelve pentominoes.

This step is not conceptual but computational and case-based; it depends on the specific geometry of each pentomino (I, L, T, U, V, W, X, Y, Z, F, P, N).

7. Final corrected statement

The correct conclusion is:

  • Each pentomino admits at least one fence.
  • The set of fences is finite but generally non-unique.
  • The minimum and maximum number of fence pieces depend on the pentomino shape and are not universally equal.

$$ \boxed{ \text{For each pentomino } P,; \min |\mathcal{C}(P)| \le \max |\mathcal{C}(P)|, \text{ with equality not guaranteed.} } $$

A complete answer requires explicit enumeration of valid configurations for each of the twelve pentominoes, which is the substantive content of the exercise.