brain

tamnd's digital brain — notes, problems, research

41641 notes

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 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 3

No.

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.1 Exercise 4

**Exercise 5.

taocpmathematicsalgorithmsvolume-3
TAOCP 5.1.2 Exercise 1

False.

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.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 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 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.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 Exercise 2

The reviewer is correct.

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 4.7 Exercise 28

**Exercise 4.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.7 Exercise 27

**Exercise 4.

taocpmathematicsalgorithmsvolume-1math-medium
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 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 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 24

**Exercise 4.

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 19

We continue from the definitions in exercise 17.

taocpmathematicsalgorithmsvolume-1math-medium
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 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 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 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 14

**Problem.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.7 Exercise 12

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

taocpmathematicsalgorithmsvolume-1math-medium
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 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 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 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 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 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 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 2

**2.

taocpmathematicsalgorithmsvolume-1medium
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.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 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 74

**Solution.

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 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 69

No.

taocpmathematicsalgorithmsvolume-1hm-hard
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 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 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 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 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 62

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

taocpmathematicsalgorithmsvolume-1math-medium
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 59

The original solution fails because it incorrectly attributes a Karatsuba-style recurrence $M(n)=3M(n/2)$ to the algorithm, which destroys the required bound on multiplications.

taocpmathematicsalgorithmsvolume-1math-project
TAOCP 4.6.4 Exercise 60

Let $T(m,n,s)$ denote the trilinear tensor corresponding to the $(m \times n)$ times $(n \times s)$ matrix multiplication problem, defined by $t_{(i,j')(j,k)(i,k)} = 1 \iff i' = i,\, j' = j,\, k' = k,...

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.4 Exercise 56

**Exercise 4.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.4 Exercise 57

Let $u(x)=\sum_{i=0}^{n} a_i x^i,\qquad y(x)=\sum_{j=0}^{n} b_j x^j.$ Their product is $z(x)=u(x)y(x)=\sum_{k=0}^{2n} c_k x^k,$ where $c_k=\sum_{i+j=k} a_i b_j.$

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 58

We consider Exercise 4.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.4 Exercise 54

In §4.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 55

Let $P$ be an arbitrary $n \times n$ matrix, and consider the tensor defined in equation (74), which is the $n \times n \times n$ tensor $T = \bigl(t_{ijk}\bigr) \quad \text{with} \quad t_{ijk} = \del...

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.6.4 Exercise 51

We redo the construction cleanly and explicitly, giving full Winograd decompositions and verifying correctness.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 52

Let $n = n'n''$ with $\gcd(n', n'') = 1$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 53

Unusual activity has been detected from your device.

taocpmathematicsalgorithmsvolume-1hm-project
TAOCP 4.6.4 Exercise 49

The key error in the previous solution is the incorrect step that an arbitrary rank-one term in the flattened matrix decomposition corresponds, after reshaping, to a rank-one $m\times n$ matrix.

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.6.4 Exercise 50

Let $V$ be the space of $m\times n$ matrices and let $W$ be the space of $n\times1$ column vectors.

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.6.4 Exercise 47

Let $V=F^{m}\otimes F^{n}\otimes F^{s}$, the vector space of all $m\times n\times s$ tensors over a field $F$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 48

Let ${t_{ijk}}$ be an $m \times n \times s$ tensor of rank $r = \text{rank}(t_{ijk})$, and let ${t'_{ijk}}$ be an $m' \times n' \times s'$ tensor of rank $r' = \text{rank}(t'_{ijk})$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 46

Let the two bilinear forms be z_1(x,y)=x^\top A y,\qquad z_2(x,y)=x^\top B y, where $A,B\in \mathbb{F}^{2\times 2}$.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.4 Exercise 44

Let u(x) = x^n + u_{n-1} x^{n-1} + \cdots + u_1 x + u_0 be a **monic polynomial** of degree $n$, with coefficients $u_{n-1}, \dots, u_0$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 45

Let $\rho(T)$ denote the rank of a tensor $T={t_{ijk}}$, where rank means the least integer $r$ for which t_{ijk}=\sum_{\nu=1}^{r} a_{i\nu} b_{j\nu} c_{k\nu}.

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.6.4 Exercise 43

Let S_n(x)=1+x+x^2+\cdots+x^n.

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.4 Exercise 42

Let $u(x)$ be a polynomial of degree $n$ over the integers.

taocpmathematicsalgorithmsvolume-1project
TAOCP 4.6.4 Exercise 40

Let $M(n)$ denote the minimum number of multiplications needed to evaluate some polynomial of degree $n$, with arbitrary coefficients, when no preliminary adaptation of the coefficients is allowed.

taocpmathematicsalgorithmsvolume-1math-simple
TAOCP 4.6.4 Exercise 41

We wish to compute the real and imaginary parts of the product of two complex numbers $(a + bi)(c + di)$ using only three real multiplications and five real additions, with two of the additions involv...

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.4 Exercise 39

The previous solution fails because it tries to control Euclidean remainders and ignores the integrality constraints.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.4 Exercise 37

Let $R(x)=\frac{x^2+10x+29}{x^2+8x+19}.$ Since numerator and denominator have the same degree, divide polynomials: (x^2+10x+29)-(x^2+8x+19)=2x+10.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 38

Let P(x;w_0,\ldots ,w_n) = \sum_{i=0}^{m} \Bigl(a_{i0}w_0+\cdots +a_{in}w_n+b_i\Bigr)x^i,

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.4 Exercise 35

Assume that a polynomial chain computes a general fourth-degree polynomial with three multiplications and four addition-subtractions.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 36

Exercise 35 established that a general fourth-degree polynomial cannot be computed with three multiplications and fewer than five addition-subtractions.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.4 Exercise 32

Let P(x) = u_1 x^3 + u_2 x^2 + u_0, where $u_0, u_1, u_2$ are independent parameters.

taocpmathematicsalgorithmsvolume-1math-simple
TAOCP 4.6.4 Exercise 34

Let $\lambda_0, \lambda_1, \ldots, \lambda_r$ be a polynomial chain in which all addition and subtraction steps are **parameter steps**, and suppose there is at least one **parameter multiplication**.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.4 Exercise 33

The previous solution fails because it never defines a correct model of computation and therefore cannot justify any dimension or “independent parameter” count.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 30

Let a **polynomial chain** be defined as in Section 4.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.4 Exercise 31

A polynomial chain computes expressions from the variable $x$ and parameters using additions, subtractions, and multiplications.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 27

Let $R$ be the set of all $(n+1)$-tuples $(q_n,\ldots,q_0)$ of real numbers with $q_n \ne 0$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 29

Let $R_1, \dots, R_m \subset \mathbb{R}^{n+1}$, and assume each $R_i$ has at most $t$ degrees of freedom.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 28

Let $f_0, \ldots, f_r$ be multivariate polynomials with integer coefficients in the variables $\alpha_1, \ldots, \alpha_s$.

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.6.4 Exercise 25

The construction in Theorem M is a straight-line program for a polynomial, and the associated coefficients $\beta_i$ are obtained by the reverse propagation rule for the final value $\lambda_{10}$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 26

Let u(x) = u_3 x^3 + u_2 x^2 + u_1 x + u_0 be a cubic polynomial with real coefficients.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 22

Restart from the goal: construct a Pan-style evaluation scheme (16), meaning a straight-line program that minimizes multiplications by first generating needed powers of $x$ via a short addition chain,...

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.4 Exercise 23

Let f(z) = a_n z^n + a_{n-1} z^{n-1} + \cdots + a_0 be a polynomial of degree $n$ with real coefficients, having at least $n-1$ roots with nonnegative real part.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.4 Exercise 24

We restart from the structural requirement of Theorem E.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 21

Solution to TAOCP 4.6.4 Exercise 21.

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.4 Exercise 20

We are asked to write a MIX program that evaluates a fifth-degree polynomial according to scheme (11) in Section 4.

taocpmathematicsalgorithmsvolume-1medium