brain

tamnd's digital brain — notes, problems, research

41230 notes

CF 104380J - No 7

We are given a single positive integer x, and we need to move strictly downward to find the closest smaller integer that avoids a specific digit constraint: none of its decimal digits may be 7.

codeforcescompetitive-programming
CF 104380H - 01 (Hard Version)

We are given a binary string that evolves over time. Two kinds of operations happen: flipping a single character, and answering a query on a substring.

codeforcescompetitive-programming
CF 104380I - Bad Grades

We are given a sequence of exam grades for a student, each grade being an integer between 0 and 100. The task is to produce a cleaned version of this sequence where every grade below 60 is removed, while keeping the relative order of the remaining grades exactly the same as in…

codeforcescompetitive-programming
CF 104380G - Social Network

We are given a set of people labeled from 1 to $n$, but $n$ can be extremely large, so we cannot afford to explicitly build any structure over all individuals.

codeforcescompetitive-programming
CF 104380B - Mine Sweeper

We are given a rectangular grid where every cell contains a number describing how many mines are present in a specific neighborhood around that cell.

codeforcescompetitive-programming
TAOCP 7.1.4 Exercise 161

The earlier solution fails at the point where it replaces the actual definition of $L$ from Exercise 160 with an assumed linear involution structure.

taocpmathematicsalgorithmsvolume-4hard
CF 104380E - Weird Knight

We are given a generalized knight piece that moves on an infinite integer grid. From any cell $(x,y)$, it can jump to eight symmetric positions obtained by permuting and flipping the vectors $(p,q)$ and $(q,p)$ with independent sign changes.

codeforcescompetitive-programming
TAOCP 7.1.4 Exercise 160

Let $N(i,j)$ denote the Moore neighborhood of $(i,j)$, i.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 16

Let the given BDD represent a Boolean function $f(x_1,\dots,x_n)$ in ordered and reduced form as defined in Section 7.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 159

Let $p=n-m$ and write $k_1=\lfloor p/3\rfloor$, $k_2=\lceil 2p/3\rceil$.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 158

Let $p=n-m$ and write $k_1=\lfloor p/3\rfloor$, $k_2=\lceil 2p/3\rceil$.

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 157

The key failure in the previous argument is the unproven monotonicity claim: it is not true in general that swapping an adjacent data–selector inversion preserves or improves ROBDD size.

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 156

Algorithm J (sifting) for dynamic variable reordering in reduced ordered BDDs operates by selecting a variable and moving it through the current ordering by adjacent swaps, evaluating the cost functio...

taocpmathematicsalgorithmsvolume-4hard
TAOCP 7.1.4 Exercise 155

We restate the problem in the language of TAOCP BDD equivalence classes.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 154

The mistake in the previous solution is the assumption that the movement of each state is determined by the induced permutation between (104) and (106).

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 153

Let the vertices of the $n$-cube be identified with $n$-bit strings.

taocpmathematicsalgorithmsvolume-4hard
TAOCP 7.1.4 Exercise 152

Let $h_n$ denote the hidden weighted bit function on variables $x_1,\dots,x_n$, where the value of $h_n(x_1,\dots,x_n)$ is $x_k$ with $k = x_1 + \cdots + x_n$, interpreted in the standard way of Exerc...

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 151

Algorithm J performs _sifting_ by repeatedly moving a chosen variable through all possible positions in the variable ordering, exchanging it with adjacent variables to minimize the BDD size.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 150

Let $f_1,\dots,f_m$ be Boolean functions represented by a shared reduced ordered BDD, with node set size $B(f_1,\dots,f_m)$ in the sense of Section 7.

taocpmathematicsalgorithmsvolume-4hard
TAOCP 7.1.4 Exercise 15

Let $C_n$ have vertices $1,2,\dots,n$ with edges $i\sim i\pm1 \pmod n$.

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 149

The central issue is that the original argument tries to maintain a global “ancestry” of nodes through repeated reductions.

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 148

The reviewer is correct: the statement is **false**, so the original proof attempt cannot be repaired.

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 147

Let level $0$ contain the root nodes of the BDD base, level $1$ the next variable layer, and level $2$ the layer below.

taocpmathematicsalgorithmsvolume-4hard
TAOCP 7.1.4 Exercise 146

Let level $0$ contain the root nodes of the BDD base, level $1$ the next variable layer, and level $2$ the layer below.

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 145

Let the input variables be two binary words $x = x_1x_2x_3x_4,\qquad y = y_1y_2y_3y_4,$ and let $f_1,\dots,f_5$ denote the five output bits of the addition $x+y$ as defined in (36), where $f_1$ is the...

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 144

The addition functions $f_1, f_2, f_3, f_4, f_5$ in (36) are the Boolean functions that determine the carry propagation structure of binary addition for increasing word lengths, where $f_k(x_1,\dots,x...

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 143

Let $f(x)=\langle x_1^{w_1}\cdots x_{20}^{w_{20}}\rangle$ denote the self-dual threshold function in which the weights are those listed in the statement.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 142

Let $f(x)=\langle x_{w_1}\cdots x_{w_n}\rangle$ denote the threshold function defined in Section 7.

taocpmathematicsalgorithmsvolume-4hm-hard
TAOCP 7.1.4 Exercise 141

Let $d(n)$ denote the quantity arising in Exercises 45–47, interpreted as the number of Hamiltonian cycles produced by the Gray-cycle constructions in the $(kr+2)$-cube after the reductions and gluing...

taocpmathematicsalgorithmsvolume-4hard
TAOCP 7.1.4 Exercise 140

Number the vertices of the cycle $C_n$ as in the statement, so edges are ${x_i,x_{i+1}}$ for $1 \le i < n$ and ${x_n,x_1}$.

taocpmathematicsalgorithmsvolume-4hard
TAOCP 7.1.4 Exercise 14

Number the vertices of the cycle $C_n$ as in the statement, so edges are ${x_i,x_{i+1}}$ for $1 \le i < n$ and ${x_n,x_1}$.

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 139

Let $k \ge 2$ be even and consider the $(kr+2)$-cube $G = G_k G_{k-1} \cdots G_1 G_0 G_{-1}$, where $G_i$ is an $r$-cube for $i>0$ and $G_0 = G_{-1} = P_2$.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 138

We interpret a QDD as a shared representation of all cofactors of $f$ with respect to a variable ordering, where each internal node is labeled by a variable and edges correspond to 0/1 restriction.

taocpmathematicsalgorithmsvolume-4math-project
TAOCP 7.1.4 Exercise 137

Let $\Gamma_6 = g(0), g(1), \dots, g(2^6-1)$ be the 6-bit Gray binary code, where g(k) = k \oplus \lfloor k/2 \rfloor.

taocpmathematicsalgorithmsvolume-4math-project
TAOCP 7.1.4 Exercise 136

Let $\Gamma_6 = g(0), g(1), \dots, g(2^6-1)$ be the 6-bit Gray binary code, where g(k) = k \oplus \lfloor k/2 \rfloor.

taocpmathematicsalgorithmsvolume-4math-hard
TAOCP 7.1.4 Exercise 135

Let $\Gamma_6 = g(0), g(1), \dots, g(2^6-1)$ be the 6-bit Gray binary code, where g(k) = k \oplus \lfloor k/2 \rfloor.

taocpmathematicsalgorithmsvolume-4math-hard
TAOCP 7.1.4 Exercise 134

Let $\Gamma_n = g(0), g(1), \dots, g(2^n-1)$ be the $n$-bit Gray binary code defined in Section 7.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 133

Let $\mathcal{S}(f)$ denote the set of all distinct subfunctions of $f(x_1,\dots,x_n)$ obtained by repeated Shannon decomposition with respect to variables $x_1,\dots,x_n$, as represented in the maste...

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 132

Let $f(x_1,x_2,x_3,x_4,x_5)$ be a Boolean function and let $B_{\min}(f)$ denote the minimum, over all variable orderings, of the number of nodes in its reduced ordered binary decision diagram, includi...

taocpmathematicsalgorithmsvolume-4hard
TAOCP 7.1.4 Exercise 131

Let C(x_1,\dots,x_p;\,y_{11},\dots,y_{pq}) = \bigwedge_{j=1}^{q}\left(\bigvee_{i=1}^{p}(x_i\wedge y_{ij})\right) be the covering function from the statement.

taocpmathematicsalgorithmsvolume-4math-hard
TAOCP 7.1.4 Exercise 130

Let $G=(V,E)$ be an ordinary (undirected) graph, viewed as a digraph by replacing each edge ${u,v}\in E$ with the two arcs $u\to v$ and $v\to u$.

taocpmathematicsalgorithmsvolume-4hm-hard
TAOCP 7.1.4 Exercise 13

Let $G=(V,E)$ be an ordinary (undirected) graph, viewed as a digraph by replacing each edge ${u,v}\in E$ with the two arcs $u\to v$ and $v\to u$.

taocpmathematicsalgorithmsvolume-4math-simple
TAOCP 7.1.4 Exercise 129

Let $S={1,\dots,m}$ denote the selector variables and $T={m+1,\dots,m+2^m}$ the data variables of the multiplexer $M_m$.

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 128

Let $S={1,\dots,m}$ denote the selector variables and $T={m+1,\dots,m+2^m}$ the data variables of the multiplexer $M_m$.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 127

Let $h_n(x_1,\ldots,x_n)$ be the hidden weighted bit function and let $h_n^\pi$ denote its permutation under $\pi$, evaluated in the fixed variable order $x_1,\ldots,x_n$.

taocpmathematicsalgorithmsvolume-4research
TAOCP 7.1.4 Exercise 126

Let $h_n(x_1,\ldots,x_n)$ denote the hidden weighted bit function and let $h_n^\pi(x_1,\ldots,x_n)=h_n(x_{\pi(1)},\ldots,x_{\pi(n)})$ be its permutation by $\pi$.

taocpmathematicsalgorithmsvolume-4hm-project
TAOCP 7.1.4 Exercise 125

Let $h_n(x_1,\ldots,x_n)$ be the hidden weighted bit function, and let $B(h_n)$ denote the number of nodes in its reduced ordered binary decision diagram, including the two sink nodes $\bot$ and $\top...

taocpmathematicsalgorithmsvolume-4hm-hard
TAOCP 7.1.4 Exercise 124

Let a slate of offset $s$ be defined as in the construction preceding formula (97), where each slate is determined by a choice of $s$ distinguished positions among $n$ ordered positions, and offset me...

taocpmathematicsalgorithmsvolume-4hard
TAOCP 7.1.4 Exercise 123

Let a slate of offset $s$ be defined as in the construction preceding formula (97), where each slate is determined by a choice of $s$ distinguished positions among $n$ ordered positions, and offset me...

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 122

Let $h_n(x_1,\dots,x_n)$ denote the hidden weighted bit function, and let $x^\psi$ be the permutation on ${0,1}^n$ defined in part (c) of Exercise 121 by \epsilon^\psi=\epsilon,\quad (x_1\cdots x_n0)^...

taocpmathematicsalgorithmsvolume-4hard
TAOCP 7.1.4 Exercise 121

Let $f^{D}(x_1,\dots,x_n)=\overline{f(\overline{x_1},\dots,\overline{x_n})}$ and $f^{R}(x_1,\dots,x_n)=f(x_n,\dots,x_1)$.

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 120

The hidden-weighted-bit function $h_n$ assigns a value to a bit vector $(x_1,\dots,x_n)$ by interpreting the input as indexing into a truth table and then extracting a selected bit.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 12

Let $\Gamma_n = {g(0), g(1), \ldots, g(2^n-1)}$ be the $n$-bit Gray binary code defined in Section 7.

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 119

Let $N \ge 1$.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 118

Let $g(k)$ be the Gray binary code defined in (7), equivalently $g(k)=k\oplus \lfloor k/2\rfloor$ by (9).

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 117

Let $f = M_m(x_1,\ldots,x_m; x_{m+1},\ldots,x_{2m})$, where $M_m$ denotes the equality function on two $m$-bit blocks, so that $f=1$ if and only if $x_i = x_{m+i}$ for all $1 \le i \le m$.

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 116

Let the quasi-profile of a BDD for a Boolean function $f(x_1,\dots,x_n)$ be the sequence $Q_k(f)$, where $Q_k(f)$ counts the number of distinct nodes (equivalently distinct subfunctions) at level $k$,...

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 115

Let $p_k$ denote the number of beads (BDD nodes) at level $k$, and let $q_k$ denote the number of distinct subtables produced at level $k$ before reduction, in the sense of Section 7.

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 114

Let the function depend on six variables $x_1,\dots,x_6$.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 113

Let $F_4$ denote the set of Boolean functions of four variables.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 112

Let $\hat b_k$ denote the quantity defined in (80) of Theorem U, where $\hat b_k$ is obtained from the recurrence counting BDD nodes via subtables of order $n-k$ and their bead structure.

taocpmathematicsalgorithmsvolume-4hm-medium
TAOCP 7.1.4 Exercise 111

Let $\Gamma_3 = (g(0), g(1), \dots, g(7))$ be the 3-bit Gray binary code in cyclic order, so consecutive terms including $g(7) \to g(0)$ differ in exactly one bit, by the defining property of Gray cod...

taocpmathematicsalgorithmsvolume-4math-medium
TAOCP 7.1.4 Exercise 110

Connection interrupted.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 11

Algorithm C in Section 7.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 109

Let the current composition of $n$ be s_1 s_2 \cdots s_j, and let

taocpmathematicsalgorithmsvolume-4hm-medium
TAOCP 7.1.4 Exercise 108

The solution does not correctly establish the required inequality.

taocpmathematicsalgorithmsvolume-4hm-medium
TAOCP 7.1.4 Exercise 107

Let $f(x_1,\dots,x_n)$ be a Boolean function represented by a reduced ordered BDD, and let $B(f)$ denote its number of nodes including sinks, as defined in Section 7.

taocpmathematicsalgorithmsvolume-4hard
TAOCP 7.1.4 Exercise 106

Let variables of $f$ be $x_1,\dots,x_n$, variables of $g$ be $y_1,\dots,y_n$, and variables of $h$ be $z_1,\dots,z_n$.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 105

A Boolean function $f(x_1,\dots,x_n)$ is unate with polarities $(y_1,\dots,y_n)$ when the function $h(x_1,\dots,x_n)=f(x_1\oplus y_1,\dots,x_n\oplus y_n)$ is monotone increasing in each variable, mean...

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 104

Let $f$ and $g$ be Boolean functions represented by reduced ordered binary decision diagrams with sink nodes $\bot,\top$ and with variable ordering $x_1 < \cdots < x_n$.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 103

Let \Phi(x_1,\dots,x_n) = \exists y_1 \dots \exists y_m \Bigl(

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 102

Let $f(x_1,\dots,x_n)$ be a Boolean function represented by its BDD as in Section 7.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 101

Let $\Sigma_m={0,1,\dots,m-1}$ be the ordered alphabet used for $m$-ary strings in Section 7.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 100

Let $G=(V,E)$ be the planar adjacency graph of the contiguous United States after eliminating DC, as specified in the exercise.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 10

Let $f$ and $f'$ be Boolean functions represented by reduced ordered BDDs.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 9

Let the BDD of $f(x_1,\ldots,x_n)$ be given in the sequential form of (8), with nodes $k_j$ labeled by $V(k_j)=x_j$, LO successor $\operatorname{LO}(k_j)$, HI successor $\operatorname{HI}(k_j)$, and s...

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 8

Let $f(x_1,\ldots,x_n)$ be given and let g_k(x_1,\ldots,x_n)=f(x_1,\ldots,x_{k-2},\,x_{k-1}\oplus x_k,\,x_{k+1},\ldots,x_n).

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 7

Let $f(x_1,\ldots,x_n)$ be represented by its reduced ordered BDD under variable order $x_1<\cdots<x_n$, and define $g_k(x_0,x_1,\ldots,x_n)=f(x_1',\ldots,x_n')$ where For truth tables, each entry of...

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 6

The truth table of $g(x_1,x_2,x_3,x_4)=f(x_4,x_3,x_2,x_1)$ is obtained by reversing the bit indices of the truth table of $f$.

taocpmathematicsalgorithmsvolume-4simple
TAOCP 7.1.4 Exercise 5

Let $G$ be the BDD of $f(x_1,\dots,x_n)$, and construct a transformed directed acyclic graph $G'$ by interchanging the LO and HI pointers of every branch node and swapping the two sinks $\bot \leftrig...

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 4

Let the 64-bit word $x$ contain fields V \mid LO \mid HI with $V$ occupying the highest 8 bits and each of $LO, HI$ occupying 28 bits.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 3

Let $f(x_1,x_2,\dots,x_n)$ be a Boolean function and let its BDD size $B(f)$ be the number of nodes in its reduced ordered BDD, including the sinks $\bot,\top$.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 2

Let $F$ be the set of all Boolean functions $f(x_1,x_2)$, represented by their truth tables f = (f(0,0), f(0,1), f(1,0), f(1,1)) \in \{0,1\}^4, so $|F| = 16$.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.4 Exercise 1

A BDD is an ordered reduced directed acyclic graph with variable ordering $x_1 < x_2$, sinks $\bot,\top$, and branch nodes labeled by variables.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.3 Exercise 99

All operations act on octabytes bytewise, so the computation reduces to a single 8-bit word.

taocpmathematicsalgorithmsvolume-4hard
TAOCP 7.1.3 Exercise 98

Each byte $x_j$ and $y_j$ is interpreted as an unsigned 8-bit integer in ${0,\ldots,255}$.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.3 Exercise 97

The proposed solution does not address the problem stated in Exercise 7.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.3 Exercise 96

For (93), the addition identity in (8q) has the form $x + y = (x \oplus y) + 2(x \,\&\, y).$ The subtraction analogue is obtained by replacing addition with subtraction and replacing carry propagation...

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.3 Exercise 95

Let $\mu = (11111111)_{256}$, the word whose every byte equals $255$, so $\mu$ serves as a mask selecting all byte positions.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.3 Exercise 94

The operation defined in (qo) constructs each byte $t_j$ from the bytes of $x$ using only bytewise arithmetic and bitwise propagation between neighboring bytes.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.3 Exercise 93

Formula (8q) for addition states the bitwise decomposition $x + y = (x \oplus y) + 2(x \mathbin{\&} y).$ To obtain the subtraction analogue, write $x - y = x + (-y).$ Using $,-y = \bar{y} + 1,$ from (...

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.3 Exercise 92

Represent the 32 base-$4$ digits packed into a word as two-bit fields.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.3 Exercise 91

Represent the 32 base-$4$ digits packed into a word as two-bit fields.

taocpmathematicsalgorithmsvolume-4hard
TAOCP 7.1.3 Exercise 90

Represent the 32 base-$4$ digits packed into a word as two-bit fields.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.3 Exercise 89

The solution does not address the stated problem at all.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.3 Exercise 88

The solution does not correctly resolve the optimization problem.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.3 Exercise 87

The solution does not correctly resolve the optimization problem.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.3 Exercise 86

Let the array indices satisfy \[ 0 \le i < 2^p,\quad 0 \le j < 2^q,\quad 0 \le k < 2^r, \] with binary expansions \[

taocpmathematicsalgorithmsvolume-4math-hard
TAOCP 7.1.3 Exercise 85

Let $i=(i_4 i_3 i_2 i_1 i_0)_2$, $j=(j_4 j_3 j_2 j_1 j_0)_2$, $k=(k_4 k_3 k_2 k_1 k_0)_2$.

taocpmathematicsalgorithmsvolume-4medium
TAOCP 7.1.3 Exercise 84

Let $\chi$ contain exactly $2^d$ one-bits and let these bits occur at positions \chi = \sum_{j=0}^{2^d-1} 2^{p_j}, \qquad p_0 < p_1 < \cdots < p_{2^d-1}.

taocpmathematicsalgorithmsvolume-4medium