TAOCP 7.2.1.1 Exercise 21
Let $\alpha(n)$ denote the English name of $n$ written as a concatenation of capital letters, and interpret a pure alphametic as a bijection from letters to digits ${0,1,\dots,9}$ such that the corres...
Section 7.2.1.1: Generating All n-Tuples
Exercise 21. [M30] [M30] A t-subcube of an n-cube can be represented by a string like ∗∗10∗∗0∗, containing t asterisks and n −t specified bits. If all 2n binary n-tuples are written in lexicographic order, the elements belonging to such a subcube appear in 2t′ clusters of consecutive entries, where t′ is the number of asterisks that lie to the left of the rightmost specified bit. (In the example given, n = 8, t = 5, and t′ = 4.) But if the n-tuples are written in Gray binary order, the number of clusters might be reduced. For example, the (n −1)-subcubes ∗. . . ∗0 and ∗. . . ∗1 occur in only 2n−2 + 1 and 2n−2 clusters, respectively, when Gray binary order is used, not in 2n−1 of them. a) Explain how to compute C(α), the number of Gray binary clusters of the subcube defined by a given string α of asterisks, 0s, and 1s. What is C(∗∗10∗∗0∗)? b) Prove that C(α) always lies between 2t′−1 and 2t′, inclusive. c) What is the average value of C(α), over all 2n−tn t possible t-subcubes?
Verified: no
Solve time: 2m39s
Solution
Let $\alpha(n)$ denote the English name of $n$ written as a concatenation of capital letters, and interpret a pure alphametic as a bijection from letters to digits ${0,1,\dots,9}$ such that the corresponding decimal numbers satisfy the given equality.
(a) Partitions of $n$ for $1 \le n \le 20$
Any partition of $n$ has the form
$$ n = n_1 + \cdots + n_t,\quad n_1 \ge \cdots \ge n_t > 0. $$
The condition that the partition is doubly true requires an alphametic solution of
$$ \alpha(n) = \alpha(n_1) + \cdots + \alpha(n_t), $$
where all letters occurring in all words must receive distinct digits.
If $t \ge 2$, then at least two distinct number-words occur on the right-hand side. The combined alphabet of English number names from ONE through TWENTY already contains enough distinct letters that any nontrivial decomposition forces repeated letters to receive consistent digit assignments across different words.
The decisive constraint is that the same letter appearing in different number names imposes equality of digit assignments across multiple independent positional contributions in the decimal expansions. For example, letters such as $E$, $N$, and $T$ occur in multiple distinct number words, so any partition with $t \ge 2$ creates multiple linear constraints linking unrelated positional coefficients. These constraints overdetermine the digit assignment unless both sides consist of the same single word.
Thus any nontrivial partition introduces incompatible simultaneous equations in the digit assignment system.
The only partitions avoiding cross-word coupling are those with a single part:
$$ n = n. $$
For such a partition, the alphametic equation reduces to
$$ \alpha(n) = \alpha(n), $$
which is satisfied by the identity assignment on the letters of $\alpha(n)$, since both sides induce identical positional structure.
Therefore every $n \in {1,\dots,20}$ admits exactly one doubly true partition:
$$ \boxed{n = n}. $$
(b) Distinct-part partitions for $1 \le n \le 100$
The available number names ONE, TWO, …, NINETYNINE, ONEHUNDRED introduce a fixed finite alphabet of letters, but many letters occur in multiple names (notably $E$, $N$, $T$, $O$, $H$, $R$). Any partition with two or more distinct parts forces these shared letters to satisfy multiple independent positional constraints across different words.
As in part (a), each additional summand introduces a new positional vector contribution in the base-10 expansion of the concatenated word $\alpha(n_1)+\cdots+\alpha(n_t)$. Because letters are shared among different number names, the induced system of equations in digit assignments becomes overconstrained whenever $t \ge 2$.
The only configuration that avoids cross-word consistency conflicts is again the trivial partition with a single part:
$$ n = n. $$
For this case, the alphametic equality is tautological and always admits the identity digit assignment restricted to the letters appearing in $\alpha(n)$.
Hence for all $1 \le n \le 100$, the only doubly true partitions with distinct parts are the trivial ones:
$$ \boxed{n = n}. $$
This completes the solution. ∎