brain

tamnd's digital brain — notes, problems, research

41288 notes

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

We consider 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 56

**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 53

Unusual activity has been detected from your device.

taocpmathematicsalgorithmsvolume-1hm-project
TAOCP 4.6.4 Exercise 52

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

taocpmathematicsalgorithmsvolume-1math-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 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 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 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 42

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

taocpmathematicsalgorithmsvolume-1project
TAOCP 4.6.4 Exercise 43

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

taocpmathematicsalgorithmsvolume-1medium
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 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 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 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 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 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 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 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 30

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

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

We restart from the structural requirement of Theorem E.

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

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

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.4 Exercise 21

Solution to TAOCP 4.6.4 Exercise 21.

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.4 Exercise 18

The proof of Ryser's identity is correct and complete.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 19

Let the scheme (11) represent the nested evaluation form for a fifth-degree polynomial $u(x)=u_5x^5+u_4x^4+u_3x^3+u_2x^2+u_1x+u_0,$ rewritten in adapted Horner form with coefficients $a_0,\ldots,a_5$...

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 15

Let $x_0, x_1, \ldots, x_n$ be distinct real numbers.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.4 Exercise 16

Yes, the inequality $\nu(n) \le 2^{l(n) - \lambda(n)}$ holds for all positive integers $n$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 17

We are asked to show that the interpolation formula (45) reduces to a simple expression involving binomial coefficients when the nodes are in an arithmetic progression, namely $x_k = x_0 + kh, \qquad...

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 14

Let $N = 2^n$ and write $\omega = e^{2\pi i/N}$.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.4 Exercise 13

**Solution to Exercise 4.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 12

Let $A,B \in F^{n\times n}$ and let $C=AB$.

taocpmathematicsalgorithmsvolume-1math-research
TAOCP 4.6.4 Exercise 11

Let $X = (x_{ij})$ be an $n \times n$ matrix.

taocpmathematicsalgorithmsvolume-1math-research
TAOCP 4.6.4 Exercise 10

Let $X = (x_{ij})$ be an $n \times n$ matrix.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.4 Exercise 9

Let R(X)=(-1)^n\sum_{\epsilon\in\{0,1\}^n} (-1)^{\epsilon_1+\cdots+\epsilon_n} \prod_{i=1}^n\sum_{j=1}^n \epsilon_jx_{ij}.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 7

**Exercise 4.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 6

We are asked to improve steps S1, .

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.4 Exercise 8

The clean way to remove the confusion is to derive the evaluation recurrence directly from the structure of the falling factorial basis, and then count operations in a single unified loop.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 4

Let $u(z) = u_n z^n + u_{n-1} z^{n-1} + \cdots + u_1 z + u_0$ be a polynomial of degree $n$, where each coefficient $u_k$ is complex and $z = x + iy$ is a complex variable.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 5

Let $n$ be given and write $u(x)=u_n x^n+u_{n-1}x^{n-1}+\cdots+u_1x+u_0.$ Define the even and odd parts with respect to $x^2$: $E(x)=\sum_{k\ge 0} u_{2k} x^{2k}, \qquad O(x)=\sum_{k\ge 0} u_{2k+1} x^{...

taocpmathematicsalgorithmsvolume-1math-simple
TAOCP 4.6.4 Exercise 3

Let $u(x,y)=\sum_{i+j\le n} u_{ij} x^i y^j$ be a bivariate polynomial of total degree $n$.

taocpmathematicsalgorithmsvolume-1hard
TAOCP 4.6.4 Exercise 2

Let $u(x) = u_n x^n + u_{n-1} x^{n-1} + \cdots + u_1 x + u_0$ be a polynomial with coefficients in a ring $\mathcal{R}$, and suppose we wish to evaluate $u(x)$ when $x$ itself is a polynomial over $\m...

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 35

Let the chains in Exercise 34 be written in the standard form determined by the exponents \[ e_0>e_1>\cdots, \] and recall that two addition chains are regarded as equivalent when they have the same p...

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.3 Exercise 34

We are asked to consider two addition chains for an integer n = 2^{e_0} + 2^{e_1} + \cdots + 2^{e_t}, \quad e_0 > e_1 > \cdots > e_t \ge 0, and to determine whether the **S-and-X chain** and the **Alg...

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.4 Exercise 1

Let $u(x)=u_{2n+1}x^{2n+1}+u_{2n-1}x^{2n-1}+\cdots+u_1x.$ Factor out $x$: $u(x)=x\left(u_{2n+1}x^{2n}+u_{2n-1}x^{2n-2}+\cdots+u_1\right).$ Introduce the substitution $y=x^2$.

taocpmathematicsalgorithmsvolume-1simple
TAOCP 4.6.3 Exercise 33

We are asked: > How many addition chains of length $9$ have (52) as their reduced directed graph (RDG)?

taocpmathematicsalgorithmsvolume-1simple
TAOCP 4.6.3 Exercise 32

Let the addition chain be 1=a_1<a_2<\cdots<a_m=n,\qquad a_i=a_j+a_k\ (j,k<i), and assign cost $a_j a_k$ to step $a_i=a_j+a_k$.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.3 Exercise 31

We are asked to **explore the problem of minimizing** f = cq + (r - q) for an addition chain

taocpmathematicsalgorithmsvolume-1math-research
TAOCP 4.6.3 Exercise 30

We are asked to find an _addition-subtraction chain_ for some integer $n$ that has fewer steps than the minimal _addition chain_ length $l(n)$.

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.3 Exercise 27

Let $n$ be a positive integer, and recall that a **small step** in an addition chain is a step of the form $a_{i+1} = a_i + 1$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 28

Let $(a_0,a_1,\ldots,a_r)$ be an addition chain for $n$, where $a_0=1$ and each term $a_i$ with $i>0$ is the sum of two earlier terms.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.3 Exercise 29

Yes, the inequality $\nu(n) \le 2^{l(n) - \lambda(n)}$ holds for all positive integers $n$.

taocpmathematicsalgorithmsvolume-1
TAOCP 4.6.3 Exercise 26

We are asked to compute the $n$th Fibonacci number $F_n$ modulo $m$, for given large integers $n$ and $m$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 25

Let $y = (.d_1 d_2 \ldots d_k)_2$ be a binary fraction, where $0 < y < 1$ and each $d_j \in {0,1}$.

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.3 Exercise 23

Brauer's inequality (50) asserts that, for any positive integers $a_1, a_2, \dots, a_n$ satisfying $a_1 < a_2 < \cdots < a_n$ and any addition chain of length $l$ ending at $a_n$, the following inequa...

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 24

We fix the argument by making the reuse of $F$-addition chains explicit and by separating cleanly the two sources of cost: the chain for $B$ and the chain for $n$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 22

Let $C(n)$ denote the addition chain produced by the construction in the proof of Theorem F.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.3 Exercise 21

Let $l(n)$ denote the minimum addition-chain length of $n$, and let $l^F(n)$ denote the length obtained by the factor method.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.3 Exercise 20

The reviewer's objections are fatal.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 18

We are asked to show that for any positive constant $\beta$ there exists a constant $\alpha < 2$ such that \sum \binom{m+s}{t+v} \binom{l+v}{v}^2 \binom{(m+s)^2}{t} < \alpha^m for all sufficiently lar...

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.6.3 Exercise 19

Let the multiplicity of an element $x$ in a multiset $A$ be denoted by $m_A(x)$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 17

In Lemma J, we are concerned with a sequence of indices or points along which a certain property holds.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 16

Let $l^{(0)}(n)$ denote the length of the addition chain for $n$ produced by the binary S-and-X method, and let $\lambda(n)$ denote the minimal length of an addition chain for $n$.

taocpmathematicsalgorithmsvolume-1hm-simple
TAOCP 4.6.3 Exercise 15

Let s(n)=l(n)-\lambda(n),\qquad s^*(n)=l^*(n)-\lambda(n), where $\lambda(n)=\lfloor \log_2 n\rfloor$.

taocpmathematicsalgorithmsvolume-1math-simple
TAOCP 4.6.3 Exercise 14

The proposed solution does **not** answer the exercise that was asked.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.3 Exercise 12

**Solution to Exercise 4.

taocpmathematicsalgorithmsvolume-1math-simple
TAOCP 4.6.3 Exercise 13

The reviewer is correct.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 11

Let 1=a_0<a_1<\cdots<a_r=n be an addition chain for $n$, and let $l(n)$ denote the minimal length of an addition chain for $n$.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.3 Exercise 10

Each node in the tree of Figure 15 corresponds to an integer $n \le 100$ and stores the information of which two previously computed powers were multiplied to produce $x^n$.

taocpmathematicsalgorithmsvolume-1simple
TAOCP 4.6.3 Exercise 8

Let $T(n)$ denote the power tree defined in Exercise 5, and let $d(n)$ be the length of a shortest path from the root $1$ to the node $n$ in this tree.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 9

There is not enough information to diagnose the algorithm from this sample alone.

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.3 Exercise 7

We consider each part separately.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 6

**Exercise 4.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.3 Exercise 4

**Exercise 4.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 5

We are asked to construct the first $r+1$ levels of the "power tree" as defined in Figure 14 and in Exercise 4.

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.3 Exercise 3

We are asked to compute $2^{375}$ by various exponentiation methods.

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.3 Exercise 1

Let u(x)=u_nx^n+\cdots+u_0 be reducible over the integers, and let

taocpmathematicsalgorithmsvolume-1simple