TAOCP 7.2.1.2 Exercise 52

Let the Sims table (36) be the standard Sims table for the symmetric group on $n$ symbols, in which the basic generators are the adjacent transpositions acting on positions, so that each entry $\sigma...

Section 7.2.1.2: Generating All Permutations

Exercise 52. ▶ [M22] [M22] What permutations τ(k, j) and ω(k) arise when Algorithm H is used with the Sims table (36)? Compare the resulting generator with Algorithm P.

Verified: no
Solve time: 4m49s


Solution

Let the Sims table (36) be the standard Sims table for the symmetric group on $n$ symbols, in which the basic generators are the adjacent transpositions acting on positions, so that each entry $\sigma(k,j)$ is the interchange of the adjacent elements in positions $j$ and $j+1$ within the first $k$ positions, extended as the identity on positions $k+1,\dots,n$.

Algorithm H constructs permutations by choosing, at level $k$, a local generator $\tau(k,j)$ from the Sims table and a control permutation $\omega(k)$ that determines how the recursive generation for size $k-1$ is embedded into size $k$. By the definition of Algorithm H, $\tau(k,j)$ is exactly the generator supplied by the Sims table at that level, so $\tau(k,j)=\sigma(k,j)$ for all admissible $k,j$.

Each $\sigma(k,j)$ acts only on adjacent positions $j$ and $j+1$, so every $\tau(k,j)$ is an adjacent interchange. The Sims table ordering (36) is structured so that successive values of $j$ correspond to a traversal of all inversion states in the $k$-th coordinate, hence the induced action of $\tau(k,j)$ changes exactly one inversion parameter by $\pm 1$ while preserving all higher-level coordinates.

The permutation $\omega(k)$ in Algorithm H is the control permutation that reverses the order in which the $\sigma(k,j)$ are applied when the $k$-th coordinate reaches its boundary values. Since the Sims table (36) is symmetric under reversal of the $j$-indexing, the effect of $\omega(k)$ is to invert the local direction of motion of the active element at level $k$. In permutation terms this corresponds to switching the orientation variable attached to level $k$, so $\omega(k)$ acts as the identity on the underlying set of elements while reversing the admissible progression of $j$-values.

Thus Algorithm H with the Sims table (36) generates permutations by repeatedly applying adjacent transpositions, with a single active position at each stage whose direction alternates when a boundary of the inversion range is reached. This is exactly the mechanism of Algorithm P: the variables $c_k$ record inversion coordinates, and the variables $o_k$ implement the direction reversals that occur when $c_k$ reaches $0$ or $k-1$.

Under this identification, $\tau(k,j)$ corresponds to the interchange

$a_{j} \leftrightarrow a_{j+1},$

applied at the unique position determined by the current inversion structure, while $\omega(k)$ corresponds to flipping the sign of $o_k$ when $c_k$ reaches an endpoint of its range. The resulting sequence of permutations changes by exactly one adjacent interchange per step and traverses all $n!$ permutations in a Hamiltonian cycle on the permutation graph.

The generator produced by Algorithm H is therefore identical, step for step, to Algorithm P (Plain changes), with the same adjacent transpositions and the same reversal mechanism for each coordinate level. This completes the comparison. ∎