brain

tamnd's digital brain — notes, problems, research

41282 notes

TAOCP 5.4.8 Exercise 8

We restart from the definition of the condition and first extract its actual global consequence, instead of interpreting it geometrically.

taocpmathematicsalgorithmsvolume-3math-hard
TAOCP 5.2.1 Exercise 5

**Exercise 5.

taocpmathematicsalgorithmsvolume-3
TAOCP 6.4 Exercise 69

The review identifies three genuine failures: an unjustified symmetry factor, an unsupported intermediate bound, and a mismatch between the run decomposition and the claimed inequality.

taocpmathematicsalgorithmsvolume-3math-medium
TAOCP 5.3.2 Exercise 14

We restart from a correct decision-tree formulation and remove the unverified state model.

taocpmathematicsalgorithmsvolume-3project
TAOCP 5.1.4 Exercise 11

**Exercise 5.

taocpmathematicsalgorithmsvolume-3math-simple
TAOCP 6.4 Exercise 25

Equation (39) expresses the probability that $N$ distinct keys $K_1,\dots,K_N$ hash into $N$ distinct table positions when each key is assumed to be mapped independently and uniformly into a hash tabl...

taocpmathematicsalgorithmsvolume-3math-medium
TAOCP 6.2.2 Exercise 8

Let $I_n$ denote the internal path length of the random BST built from $n$ keys.

taocpmathematicsalgorithmsvolume-3math-project
TAOCP 6.4 Exercise 54

Start from Eq.

taocpmathematicsalgorithmsvolume-3hm-hard
TAOCP 5.2.3 Exercise 10

Let the standard heapsort “sift-down” step be denoted by the variables of Algorithm H, where a key at position $k$ is moved downward by repeatedly comparing it with its children at $2k$ and $2k+1$, an...

taocpmathematicsalgorithmsvolume-3medium
TAOCP 6.2.2 Exercise 2

Let each node $P$ contain fields $\operatorname{KEY}(P)$, $\operatorname{LLINK}(P)$, $\operatorname{RLINK}(P)$, and a tag $\operatorname{RTAG}(P)\in{0,1}$.

taocpmathematicsalgorithmsvolume-3medium
TAOCP 6.4 Exercise 52

From equation (42), $Q_o(M,N)$ is given by the finite sum Q_o(M,N)=\sum_{k=0}^{N} \binom{N}{k}\frac{k!

taocpmathematicsalgorithmsvolume-3hm-medium
TAOCP 6.2.3 Exercise 6

Let $B_h(z)$ denote the ordinary generating function in which the coefficient of $z^n$ equals the number of balanced binary trees with $n$ internal nodes and height exactly $h$.

taocpmathematicsalgorithmsvolume-3math-medium
TAOCP 6.1 Exercise 10

Let $p_1, p_2, \dots, p_N$ be the probabilities that the argument equals $K_1, K_2, \dots, K_N$, with $\sum_{i=1}^N p_i = 1$.

taocpmathematicsalgorithmsvolume-3math-medium
TAOCP 6.2.4 Exercise 8

Working

taocpmathematicsalgorithmsvolume-3
TAOCP 5.4.2 Exercise 20

Let $T=6$ and $P=5$.

taocpmathematicsalgorithmsvolume-3math-medium
TAOCP 5.3.1 Exercise 2

The root node compares $K_1$ and $K_2$.

taocpmathematicsalgorithmsvolume-3
TAOCP 5.2.3 Exercise 11

Let elements arrive in a sequence at times $t = 1,2,\ldots$.

taocpmathematicsalgorithmsvolume-3simple
TAOCP 6.4 Exercise 47

Let the table have size $M$, with $n$ stored keys and load factor $\alpha=n/M$.

taocpmathematicsalgorithmsvolume-3math-medium
TAOCP 6.3 Exercise 3

Let each key $x$ in the set of 31 words have frequency $f(x)$ as given by Fig.

taocpmathematicsalgorithmsvolume-3medium
TAOCP 5.5 Exercise 3

Let a file consist of $N$ records with totally ordered keys.

taocpmathematicsalgorithmsvolume-3research
TAOCP 6.2.2 Exercise 37

Let $(P_1,\dots,P_n)$ be uniformly distributed over the simplex $P_k>0,\quad \sum_{k=1}^n P_k = 1.$ The entropy is $H(P_1,\dots,P_n) = -\sum_{k=1}^n P_k \log P_k.$ By symmetry, $\mathbb{E}[H(P_1,\dots...

taocpmathematicsalgorithmsvolume-3hm-hard
TAOCP 6.1 Exercise 9

Let $p_k$ be probabilities on ${1,2,\dots,N}$ with $\sum_{k=1}^N p_k=1$.

taocpmathematicsalgorithmsvolume-3hm-hard
TAOCP 6.2.2 Exercise 49

Let $T_n$ be a binary search tree formed by inserting $n$ distinct keys in random order, each of the $n!$ permutations equally likely, using Algorithm T of Section 6.

taocpmathematicsalgorithmsvolume-3hm-project
TAOCP 6.3 Exercise 22

Let $X_l$ denote the number of trie nodes on level $l$ in a random $M$-ary trie containing $N$ keys.

taocpmathematicsalgorithmsvolume-3math-medium
TAOCP 6.2.2 Exercise 11

We restart the counting from the actual behavior of step D3, since the previous argument misidentified what is being counted.

taocpmathematicsalgorithmsvolume-3medium
TAOCP 5.1.3 Exercise 7

Let $X_n$ denote the number of descents in a random permutation of ${1,2,\dots,n}$.

taocpmathematicsalgorithmsvolume-3hm-project
TAOCP 5.2.5 Exercise 4

The reviewer’s objection is correct: simply replacing FIFO queues by LIFO stacks breaks stability.

taocpmathematicsalgorithmsvolume-3medium
TAOCP 6.1 Exercise 18

Let the positions be $1,2,\dots,N$.

taocpmathematicsalgorithmsvolume-3math-hard
TAOCP 5.4.2 Exercise 26

Let $T=4$, so $P=T-1=3$ and the tape-splitting polyphase merge uses the 3-way Fibonacci system defined by the third-order recurrence F_n = F_{n-1}+F_{n-2}+F_{n-3}\quad (n\ge 3), with initial values de...

taocpmathematicsalgorithmsvolume-3math-medium
TAOCP 6.2.2 Exercise 39

Let $w_1,\dots,w_n$ be nonnegative with $w_1+\cdots+w_n=1$.

taocpmathematicsalgorithmsvolume-3math-medium
TAOCP 5.3.2 Exercise 1

We restart from the correct structural interpretation of $S'(k)$ as an optimal **merging-based sorting cost**, and we avoid assuming any fixed decomposition into prescribed sizes.

taocpmathematicsalgorithmsvolume-3
TAOCP 6.4 Exercise 8

We restart from the correct structure and avoid any use of invalid fractional-part algebra.

taocpmathematicsalgorithmsvolume-3math-hard
TAOCP 5.3.2 Exercise 2

Let $m=1$.

taocpmathematicsalgorithmsvolume-3medium
TAOCP 5.1.3 Exercise 4

**Corrected Solution to Exercise 5.

taocpmathematicsalgorithmsvolume-3
TAOCP 5.4.9 Exercise 18

Let $S$ be the number of elevator stops required by a fixed scheduling method applied to a uniformly random permutation of the $bn$ people among the $bn$ desks.

taocpmathematicsalgorithmsvolume-3hm-hard
TAOCP 6.2.3 Exercise 26

A $t$-ary tree is a rooted ordered tree in which each internal node has at most $t$ children.

taocpmathematicsalgorithmsvolume-3project
TAOCP 6.3 Exercise 28

Let $T_N$ be the Coffman–Eve $M$-ary digital search tree built from $N$ independent random infinite strings over an alphabet of size $M>2$.

taocpmathematicsalgorithmsvolume-3hm-hard
TAOCP 6.2.3 Exercise 28

A 2-3 tree is a rooted ordered tree in which every internal node has either two or three children and contains respectively one or two keys, and in which all external nodes occur at the same level.

taocpmathematicsalgorithmsvolume-3project
TAOCP 5.4.8 Exercise 7

Let $T=(V,E)$ be a finite tree with positive edge lengths $\ell(e)>0$ for $e\in E$.

taocpmathematicsalgorithmsvolume-3math-project
TAOCP 5.1.2 Exercise 9

**9.

taocpmathematicsalgorithmsvolume-3hard
TAOCP 5.1.2 Exercise 8

Stopped thinking

taocpmathematicsalgorithmsvolume-3medium
TAOCP 5.1.2 Exercise 6

**Solution to Exercise 5.

taocpmathematicsalgorithmsvolume-3
TAOCP 5.1.2 Exercise 7

Let the six admissible column types in (19) be \binom{b}{a},\quad \binom{c}{a},\quad \binom{a}{b},\quad \binom{c}{b},\quad \binom{a}{c},\quad \binom{b}{c},

taocpmathematicsalgorithmsvolume-3
TAOCP 5.1.2 Exercise 5

Condition (b) must exclude the case $x=y$.

taocpmathematicsalgorithmsvolume-3
TAOCP 5.1.2 Exercise 3

No.

taocpmathematicsalgorithmsvolume-3
TAOCP 5.1.2 Exercise 2

Using the definition of intercalation, we write \beta=\text{bddad} \qquad\Longrightarrow\qquad \begin{pmatrix} a&b&d&d&d\\

taocpmathematicsalgorithmsvolume-3
TAOCP 5.1.2 Exercise 4

If $d < c < b < a$, the canonical factorization of (12) is obtained by reversing the order of the letters in each cycle of the factorization given in (17).

taocpmathematicsalgorithmsvolume-3
TAOCP 5.1.2 Exercise 1

False.

taocpmathematicsalgorithmsvolume-3
TAOCP 5.1.1 Exercise 4

**Exercise 5.

taocpmathematicsalgorithmsvolume-3
TAOCP 5.1.1 Exercise 1

Let the permutation be written in one-line form $a_1 a_2 \cdots a_9$.

taocpmathematicsalgorithmsvolume-3
TAOCP 5.1.1 Exercise 2

**Corrected Solution for Exercise 5.

taocpmathematicsalgorithmsvolume-3
TAOCP 5.1.1 Exercise 3

Let $p_i$ denote the position of the element $i$ in the permutation, so that $a_{p_i}=i$.

taocpmathematicsalgorithmsvolume-3
TAOCP 5.1 Exercise 3

Store the permutation in an array $P$ such that $P(j)$ is the position of $j$ in the permutation.

taocpmathematicsalgorithmsvolume-3
TAOCP 5.1 Exercise 2

Let the Josephus elimination process produce the sequence $x_1,x_2,\dots,x_n$, where $x_k$ is the label removed at step $k$.

taocpmathematicsalgorithmsvolume-3
TAOCP 5 Exercise 5

Let each catalog card be considered as a record $R_j$ with a key $K_j$ that reflects the text of the card, including author, title, and date information.

taocpmathematicsalgorithmsvolume-3research
TAOCP 5.1 Exercise 1

Let the inversion table of a permutation $a_1a_2\cdots a_n$ be the sequence $b_1b_2\cdots b_n$, where $b_i$ is the number of entries greater than $i$ that occur to the left of $i$ in the permutation.

taocpmathematicsalgorithmsvolume-3
TAOCP 5 Exercise 1

**Corrected Solution.

taocpmathematicsalgorithmsvolume-3
TAOCP 5 Exercise 4

Our systems have detected unusual activity coming from your system.

taocpmathematicsalgorithmsvolume-3medium
TAOCP 5 Exercise 2

The reviewer is correct.

taocpmathematicsalgorithmsvolume-3
TAOCP 4.7 Exercise 28

**Exercise 4.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.7 Exercise 26

The statement as printed cannot be correct, since the hypothesis \[ V(z)=U(V(z)) \] makes the additional condition about the coefficients of \(U(V(z))\) vacuous.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.7 Exercise 27

**Exercise 4.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.7 Exercise 24

**Exercise 4.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.7 Exercise 25

Let U(z) = z + U_k z^k + U_{k+1} z^{k+1} + \cdots, \qquad k \ge 2, \quad U_k \ne 0, and

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.7 Exercise 23

We are given a power series $U(z) = z + U_2 z^2 + U_3 z^3 + \cdots$ with power matrix $U = (u_{nk})$, where $u_n = u_{n1} = n U_n$.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.7 Exercise 21

Let V(z) = V_1 z + V_2 z^2 + V_3 z^3 + \cdots, \quad V_1 \neq 0, and let

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.7 Exercise 22

Let $U(z) = U_0 + U_1 z + U_2 z^2 + \cdots, \qquad U_0 \ne 0,$ and define the _odd induced function_ $U^{(o)}(z)$ to be the power series $V(z)$ satisfying V(z) = U(z V(z)^o).

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.7 Exercise 20

Let the power (coefficient) matrices of $U$, $V$, and $W$ be $U=(u_{jk})$, $V=(v_{nj})$, and $W=(w_{nk})$, where these matrices encode the action of the corresponding formal power series operators as...

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.7 Exercise 19

We continue from the definitions in exercise 17.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.7 Exercise 18

We are asked to prove that the poweroids $V_n(x)$ satisfy xV_n(x+y) = (x+y)\sum_{k=1}^{n} \binom{n-1}{k-1} V_k(x)V_{n-k}(y), continuing from Exercise 17.

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.7 Exercise 16

Let $U^{[n]}(z)$ denote the $n$-fold composition of $U(z)$ with itself, as in Section 4.

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.7 Exercise 15

We are asked: > For what functions $U(z)$ does $U^{[n]}(z)$ have the simple form $z^k$ in (27)?

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.7 Exercise 13

Let F(z)=W_0+W_1z+\cdots+W_{N-1}z^{N-1}, the truncation of $W(z)$ modulo $z^N$.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.7 Exercise 14

**Problem.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.7 Exercise 11

We are asked to compute the first $N$ coefficients of the composed power series $W(z) = U(V(z)) = U_0 + U_1 V(z) + U_2 V(z)^2 + U_3 V(z)^3 + \cdots.$ Since $V(z)$ has no constant term, $V_0 = 0$, it f...

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.7 Exercise 12

We are asked to connect **polynomial division** with **power series division**.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.7 Exercise 8

We are asked to extend Algorithm L to handle the more general situation in which $W(z) = G(t) = G_1 t + G_2 t^2 + G_3 t^3 + \cdots, \qquad z = V_1 t + V_2 t^2 + V_3 t^3 + \cdots, \quad V_1 \ne 0,$ and...

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.7 Exercise 10

We are asked to find the coefficients in the expansion x = y^{1/a} + b_2 y^{1/a + 1} + b_3 y^{1/a + 2} + \cdots, given that

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.7 Exercise 9

For the reversion of $z = t - t^2,$ Algorithm T is applied to the general form $U_1 z + U_2 z^2 + \cdots = t + V_2 t^2 + V_3 t^3 + \cdots,$ so here $U_1 = 1,\quad U_n = 0 \ (n \ge 2), \qquad V_2 = -1,...

taocpmathematicsalgorithmsvolume-1simple
TAOCP 4.7 Exercise 7

The solution directly constructs a bilinear algorithm that expresses all entries $c_{ij}$ of $C=AB$ as linear combinations of exactly 21 bilinear products of linear forms in the entries of $A$ and $B$...

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.7 Exercise 6

Let $f(x) = x^{-1} - V(z).$ We seek a power series $x = W(z)$ such that $f(x)=0$, hence $W(z)^{-1} = V(z)$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.7 Exercise 5

Let the original relation be $z = t + V_2 t^2 + V_3 t^3 + \cdots,$ and let its reversion be $t = z + W_2 z^2 + W_3 z^3 + \cdots.$ Reversion constructs the compositional inverse in the sense that subst...

taocpmathematicsalgorithmsvolume-1math-immediate
TAOCP 4.7 Exercise 3

Formula (9) expresses $W_n$ for $n \ge 1$ in terms of the coefficients $V_k$ and the previously computed $W_{n-k}$, and it contains an explicit factor $1/n$.

taocpmathematicsalgorithmsvolume-1math-simple
TAOCP 4.7 Exercise 4

The solution directly constructs a bilinear algorithm that expresses all entries $c_{ij}$ of $C=AB$ as linear combinations of exactly 21 bilinear products of linear forms in the entries of $A$ and $B$...

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.7 Exercise 1

Let $V_m$ be the first nonzero coefficient of $V(z)$; thus $V(z)=z^m\widehat V(z),\qquad \widehat V_0=V_m\ne0.$ If $U(z)=z^r\widehat U(z),\qquad \widehat U_0=U_r\ne0,$ then $\frac{U(z)}{V(z)}=z^{\,r-m...

taocpmathematicsalgorithmsvolume-1math-simple
TAOCP 4.7 Exercise 2

**2.

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.4 Exercise 73

Let $N = m_1 \cdots m_k$ and consider a polynomial chain computing the discrete Fourier transform as a linear transformation $y = Fx,$ where $F$ is the $N \times N$ Fourier matrix with entries $\omega...

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.6.4 Exercise 72

Let $T=(t_{ijk})$ be an $m\times n\times s$ tensor with rational entries.

taocpmathematicsalgorithmsvolume-1math-research
TAOCP 4.6.4 Exercise 74

**Solution.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.4 Exercise 71

Let a quasipolynomial chain compute $f(x_1,\ldots,x_n).$ Write the chain values as $v_1,\ldots,v_N,$ where each $v_i$ is either an input variable, a constant, or is obtained from earlier values by one...

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.4 Exercise 70

X=\begin{pmatrix} x&u\\ e&Y \end{pmatrix},

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.6.4 Exercise 68

Let $f(x_1,\ldots,x_n)=\sum_{1\le i<j\le n} x_i x_j.$ We count arithmetic complexity in the sense of straight-line programs: each multiplication is one operation, each addition is one operation, and i...

taocpmathematicsalgorithmsvolume-1math-project
TAOCP 4.6.4 Exercise 69

No.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.4 Exercise 67

Let $T(m,n,s)$ denote the tensor associated with multiplying an $m \times n$ matrix by an $n \times s$ matrix.

taocpmathematicsalgorithmsvolume-1hm-project
TAOCP 4.6.4 Exercise 65

**Statement.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.4 Exercise 66

Let $M(n) = \operatorname{rank}(T(n,n,n))$ denote the rank of the $n \times n$ matrix multiplication tensor.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.4 Exercise 64

Let A=(a_{ij})_{1\le i,j\le 3}, \qquad B=(b_{ij})_{1\le i,j\le 3}, and let

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.4 Exercise 63

We restart from the correct structural facts about matrix multiplication tensors and tensor rank, and avoid any assumptions about multiplicativity of rank beyond what is valid: subadditivity under dec...

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.4 Exercise 61

We first restate the structure in a precise way consistent with the exercise.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.4 Exercise 62

Let $V$ be a $2$-dimensional vector space over a field $\mathbb{F}$ with basis ${e_1, e_2}$.

taocpmathematicsalgorithmsvolume-1math-medium