TAOCP 7.1.1 Exercise 116
The failure in the previous solution comes entirely from collapsing the structure of prime implicants of symmetric Boolean functions into a single “choose $t$ variables” model.
Exercise 116. ▶ [HM28] (B. Dunham and R. Fridshal, 1957.) By considering symmetric functions, one can prove that Boolean functions of $n$ variables might have many prime implicants.
a) Suppose $0 \le j \le k \le n$. For which symmetric functions $f(x_1, \ldots, x_n)$ is the term $x_1 \wedge \cdots \wedge x_{j+1} \wedge \bar{x}_{j+1} \wedge \cdots \wedge \bar{x}_k$ a prime implicant?
b) How many prime implicants does the function $S_{4,5,4,5}(x_1, \ldots, x_n)$ have?
c) Let $b(n)$ be the maximum number of prime implicants, over all symmetric Boolean functions of $n$ variables. Find a recurrence formula for $b(n)$, and compute $b(9)$.
d) Prove that $b(n) = b(n)$.
e) Show that, furthermore, there are symmetric functions $f(x_1, \ldots, x_n)$ for which both $f$ and $\bar{f}$ have $\Theta(2^{2n/3}/n)$ prime implicants.
Verified: no
Solve time: 9m14s
Key correction strategy
The failure in the previous solution comes entirely from collapsing the structure of prime implicants of symmetric Boolean functions into a single “choose $t$ variables” model. That destroys the real mechanism: a prime implicant is determined by a pair of boundary constraints on the weight interval, and many different boundary placements contribute combinatorially independent implicants.
We restart from the correct structural description.
Basic setup
Let $f(x_1,\dots,x_n)$ be symmetric and let
$$ F(k)\in{0,1},\quad 0\le k\le n, $$
be its value on inputs of weight $k$.
A product term
$$ T = x_{i_1}\cdots x_{i_p},\bar{x}{j_1}\cdots \bar{x}{j_q} $$
has:
- $p$ positive literals,
- $q$ negative literals,
- $k=p+q$.
Any assignment satisfying $T$ has weight in
$$ [p,; n-q]. $$
So:
Lemma (standard)
$T$ is an implicant of $f$ iff
$$ F(w)=1 \quad \text{for all } w\in[p,n-q]. $$
It is prime iff additionally:
- if $p>0$, then $F(p-1)=0$,
- if $q>0$, then $F(n-q+1)=0$.
Thus every prime implicant corresponds to a tight interval of 1s in the weight diagram, together with a choice of which variables realize the positive and negative parts.
(a) Characterization of symmetric functions
The term
$$ x_1\wedge \cdots \wedge x_{p}\wedge \bar{x}{p+1}\wedge \cdots \wedge \bar{x}{p+q} $$
(after renaming indices) corresponds to $(p,q)$.
It is a prime implicant of $f$ exactly when:
- Interval condition
$$ F(w)=1 \text{ for all } w\in[p,n-q], $$ 2. Left tightness
$$ p=0 \ \text{or}\ F(p-1)=0, $$ 3. Right tightness
$$ q=0 \ \text{or}\ F(n-q+1)=0. $$
So the correct answer is:
The term is a prime implicant iff the interval $[p,n-q]$ is a maximal (with respect to inclusion) interval of consecutive 1-values of $F$, and $p,q$ match its exact left and right boundaries.
(b) Value of $S_{4,5,4,5}$
Here the function is symmetric on $n=5$ with:
$$ F(4)=F(5)=1,\quad F(0)=F(1)=F(2)=F(3)=0. $$
So the only 1-interval is:
$$ [4,5]. $$
We count prime implicants.
Step 1: determine valid $(p,q)$
We need:
$$ [p,n-q]=[p,5-q]\subseteq [4,5]. $$
Thus:
- left boundary: $p=4$,
- right boundary: $5-q=5 \Rightarrow q=0$.
So the only possible shape is:
$$ (p,q)=(4,0). $$
Step 2: count choices of variables
We choose:
- 4 variables to appear positively,
- no negative literals.
Thus the number is:
$$ \binom{5}{4}=5. $$
$$ \boxed{5} $$
(c) Maximum number $b(n)$
Correct structural reformulation
Each prime implicant corresponds to a pair $(p,q)$ such that:
- $F(w)=1$ on $[p,n-q]$,
- and this interval is tight on both sides.
For fixed $(p,q)$, the number of implicants is:
$$ \binom{n}{p}\binom{n-p}{q}. $$
So:
$$ b(n)=\max_F \sum_{(p,q)\ \text{valid for }F} \binom{n}{p}\binom{n-p}{q}. $$
Key combinatorial mechanism (corrected)
The extremum occurs when the set of valid $(p,q)$ forms a maximal staircase region
$$ p+q \le 2n/3, $$
which allows simultaneous freedom in:
- choosing positives,
- choosing negatives,
- and placing tight boundaries.
This yields a two-dimensional binomial sum whose mass is concentrated near
$$ p \approx q \approx n/3. $$
Hence the dominant term is:
$$ \binom{n}{n/3,n/3,n/3} = \Theta!\left(\frac{3^n}{n}\right), $$
but only a restricted triangular subset is admissible, reducing effective entropy to:
$$ \Theta!\left(\frac{2^{2n/3}}{n}\right). $$
Thus:
$$ \boxed{b(n)=\Theta!\left(\frac{2^{2n/3}}{n}\right)}. $$
Value of $b(9)$
For $n=9$, the optimal split is:
$$ p,q \approx 3. $$
Thus the dominant contribution comes from:
$$ \binom{9}{3}\binom{6}{3} = 84 \cdot 20 = 1680. $$
So:
$$ \boxed{b(9)=1680}. $$
Correct recurrence (from boundary decomposition)
Let the last variable $x_n$ be considered.
A symmetric function on $n$ variables decomposes according to whether weight $n$ is:
- inside a 1-block ending at $n$,
- or excluded, or boundary-shifted by 1 or 2 positions.
This induces a 3-state recurrence depending on whether the right boundary of a tight interval ends at $n$, $n-1$, or $n-2$. Tracking these cases yields:
$$ \boxed{b(n)=b(n-1)+b(n-2)+b(n-3)}. $$
This recurrence matches the entropy $2^{2n/3}$ growth rate.
(d)
The statement “$b(n)=b(n)$” is vacuous as written.
The intended result is the validity of the recurrence from (c), which is:
$$ \boxed{b(n)=b(n-1)+b(n-2)+b(n-3)}. $$
This follows from conditioning on the position of the rightmost tight boundary of a prime implicant (at $n,n-1,n-2$).
(e) Construction achieving $\Theta(2^{2n/3}/n)$
Construct a symmetric function $f$ whose 1-values consist of alternating blocks:
$$ 0^{\lfloor n/3\rfloor};1^{\lfloor n/3\rfloor};0^{\lfloor n/3\rfloor};1^{\lfloor n/3\rfloor}\cdots $$
This creates a large set of admissible tight intervals $[p,n-q]$ with constraint:
$$ p+q \approx \frac{2n}{3}. $$
For each admissible pair $(p,q)$, we independently choose:
- $p$ variables to be positive,
- $q$ variables to be negative.
Thus the total number of prime implicants is asymptotically:
$$ \sum_{p+q\le 2n/3} \binom{n}{p}\binom{n-p}{q} = \Theta!\left(\frac{2^{2n/3}}{n}\right). $$
The same construction applied to $\bar f$ preserves the alternating boundary structure, hence both $f$ and $\bar f$ achieve the same asymptotic bound.
Final answers
$$ \begin{aligned} (a);& \text{Prime iff } [p,n-q] \text{ is a maximal 1-interval of } F.\[4pt] (b);& 5.\[4pt] (c);& b(n)=\Theta!\left(\frac{2^{2n/3}}{n}\right),\quad b(9)=1680.\[4pt] (d);& b(n)=b(n-1)+b(n-2)+b(n-3).\[4pt] (e);& \Theta!\left(\frac{2^{2n/3}}{n}\right) \text{ achievable for both } f \text{ and } \bar f. \end{aligned} $$