taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.5-15

Exercise 1.2.5-15

proved in Lean solution written

RatingHM15
MarkersHM (needs higher mathematics)
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.2.5 of Volume 1. Companion chapter: Permutations and factorials

The task

Find the permanent of the n×nn \times n matrix whose entry in row ii and column jj is ijij.

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

The permanent is the sum, over all permutations σ\sigma of the columns, of the product of the entries aiσ(i)a_{i\sigma(i)}.

Hint 2

Factor each term. The row numbers and the column numbers each give a product that does not depend on σ\sigma.

Solution

Show the solution

The permanent is ∑σ∏i=1naiσ(i)\sum_\sigma \prod_{i=1}^{n} a_{i\sigma(i)} over the n!n! permutations σ\sigma of {1,…,n}\{1, \ldots, n\}. Here aij=ija_{ij} = ij, so for each σ\sigma

∏i=1ni σ(i)=(∏i=1ni)(∏i=1nσ(i))=n!⋅n!.\prod_{i=1}^{n} i\,\sigma(i) = \left(\prod_{i=1}^{n} i\right)\left(\prod_{i=1}^{n} \sigma(i)\right) = n! \cdot n!.

The second product is n!n! because σ\sigma takes each of the values 1,…,n1, \ldots, n once. Every one of the n!n! terms equals (n!)2(n!)^2, so the permanent is n!⋅(n!)2=(n!)3n! \cdot (n!)^2 = (n!)^3.

Check

For n=2n = 2 the matrix is (1224)\begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix} and the permanent is 1⋅4+2⋅2=8=231 \cdot 4 + 2 \cdot 2 = 8 = 2^3. For n=3n = 3 the permanent is 216=63216 = 6^3. Python sums over all permutations for n≤5n \le 5 and gets (n!)3(n!)^3 each time. The determinant of the same matrix is 00 for n≥2n \ge 2.

Remarks

The permanent of the all-ones matrix is n!n!. A matrix with entries aij=xiyja_{ij} = x_i y_j has the permanent n!∏xi∏yjn! \prod x_i \prod y_j, by the same argument. In general the permanent is much harder to compute than the determinant.

This solution is checked, and a person has not reviewed it yet. The source.

In Lean

proved The statement and its proof are in Lean. The kernel accepts the proof, and it uses the standard axioms only.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.