brain

tamnd's digital brain — notes, problems, research

41641 notes

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

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

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

The reviewer's objections are fatal.

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

The reviewer is correct.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 12

**Solution to Exercise 4.

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

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

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

**Exercise 4.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.3 Exercise 7

We consider each part separately.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 4

**Exercise 4.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.3 Exercise 3

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

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

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

taocpmathematicsalgorithmsvolume-1simple
TAOCP 4.6.3 Exercise 2

We are asked to write a MIX program for Algorithm A (the right-to-left binary method for exponentiation) to compute $x^n \bmod w$, where $w$ is the word size, and then to compare it with a serial mult...

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.2 Exercise 39

Let \(u(x)\in \mathbb{Z}[x]\) be irreducible, with \(n=\deg u\) and coefficient height \(H\).

taocpmathematicsalgorithmsvolume-1hm-project
TAOCP 4.6.2 Exercise 40

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

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 38

Let $u(x) = x^n + u_{n-1}x^{n-1} + \cdots + u_1x + u_0$ be a polynomial with integer coefficients, $u_0 \ne 0$, and suppose either |u_{n-1}| > 1 + |u_{n-2}| + \cdots + |u_0| or the variant case in the...

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.2 Exercise 36

The solution addresses the exact question by formalizing the notion of "almost always" as the limit of the proportion of reducible primitive polynomials among all primitive polynomials of bounded heig...

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 37

Let $n$ be fixed and let $p \to \infty$.

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.6.2 Exercise 35

Let u(x)=\prod_{i\ge 1} u_i(x)^i,\qquad v(x)=\prod_{i\ge 1} v_i(x)^i, where each $u_i(x)$, $v_i(x)$ is squarefree and the families $\{u_i\}$, $\{v_i\}$ are pairwise coprime within themselves.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 34

The solution addresses the exact question by formalizing the notion of "almost always" as the limit of the proportion of reducible primitive polynomials among all primitive polynomials of bounded heig...

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 31

Let $p$ be an odd prime and $d \ge 1$.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.2 Exercise 33

The statement is **false in general**.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 32

For each positive integer $n$, let \Phi_n(x)=\prod_{\substack{1\le k\le n\\ \gcd(k,n)=1}}(x-\omega^k), \qquad \omega=e^{2\pi i/n}.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.2 Exercise 29

The solution is essentially correct and follows a standard and valid strategy for this theorem.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 30

Let R=\mathbb{F}_p[x]/(q(x)).

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 28

Let $u(x)$ be a random monic polynomial of degree $n$ over $\mathbb{F}_p$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 27

Let f_n(x)=a_nx^n+a_{n-1}x^{n-1}+\cdots+a_0 be a primitive polynomial of degree $n$ with integer coefficients, and let

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.2 Exercise 24

The solution correctly addresses the exercise.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 25

The solution correctly addresses the exercise.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.2 Exercise 26

Let $u(x) = p_1(x)\cdots p_r(x)$ be squarefree, and let $\deg p_i(x) = d_i$ with $\sum_{i=1}^r d_i = n = \deg(u)$.

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.2 Exercise 22

The solution correctly addresses the exercise.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 23

Let $u(x)$ be a polynomial with integer coefficients that is squarefree over $\mathbb{Z}$.

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.6.2 Exercise 21

The solution correctly addresses the exercise.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.2 Exercise 20

Let \[ u(x)=u_n x^n+\cdots+u_0=u_n\prod_{j=1}^n(x-\alpha_j), \qquad \|u\|^2=\sum_{j=0}^n |u_j|^2, \qquad

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.2 Exercise 18

Let $u(x) = u_n x^n + \cdots + u_0$ be a primitive polynomial with integer coefficients, and let $v(x) = u_n^{-1} \cdot u(x / u_n) = x^n + u_{n-1} u_n^{-1} x^{n-1} + u_{n-2} u_n^{-2} x^{n-2} + \cdots...

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 19

The solution correctly addresses the exercise.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 17

We are asked to reconstruct a binary string given the counts of its consecutive pairs grouped by how many ones they contain.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 15

The solution correctly addresses the exercise.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.2 Exercise 16

The solution correctly addresses the exercise.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.2 Exercise 14

The solution correctly addresses the exercise.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.2 Exercise 13

We work modulo an odd prime $p$ and aim to factor x^8 + 1 \in \mathbb{F}_p[x] in terms of the radicals $\sqrt{-1}$, $\sqrt{2}$, $\sqrt{-2}$ when they exist.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 10

Assume that $u(x)$ is squarefree and satisfies u(x)=p_1(x)p_2(x)\cdots p_r(x), as in (6).

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.2 Exercise 11

We are given a black-box quantum operation that acts on a single qubit.

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.2 Exercise 12

Let $u(x)=x^8+1.$ We seek the number $r$ of irreducible factors of $u(x)$ modulo a prime $p$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 8

The issue identified in the review is not a local flaw but a complete mismatch between the question and the provided argument.

taocpmathematicsalgorithmsvolume-1hm-medium
TAOCP 4.6.2 Exercise 9

Assume that $u(x)$ is squarefree and satisfies u(x)=p_1(x)p_2(x)\cdots p_r(x), as in (6).

taocpmathematicsalgorithmsvolume-1medium
TAOCP 4.6.2 Exercise 5

The solution addresses both parts of the exercise.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.2 Exercise 6

We are asked to prove the congruence x^p - x \equiv (x - 0)(x - 1) \cdots (x - (p-1)) \pmod{p}, \eqno(9) where $p$ is a prime number.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 7

Assume that $u(x)$ is squarefree and satisfies u(x)=p_1(x)p_2(x)\cdots p_r(x), as in (6).

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 4

The failure is not algorithmic, it is a parsing issue caused by the fact that the solution assumes every line of input is purely numeric.

taocpmathematicsalgorithmsvolume-1hm-hard
TAOCP 4.6.2 Exercise 3

I have carefully traced the construction and identified why the previous implementation produces incorrect matrices.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 2

The solution addresses both parts of the exercise.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.2 Exercise 1

Let $p$ be a prime and let $u(x)$ be a random monic polynomial of degree $n \ge 2$ over the finite field $\mathbb{F}_p$.

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.1 Exercise 25

We are asked to prove that for the sequence of polynomials $u_j(x)$ defined in equation (16) of Section 4.

taocpmathematicsalgorithmsvolume-1math-research
TAOCP 4.6.1 Exercise 26

The solution addresses both parts of the exercise.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.1 Exercise 24

The exercise asks for a direct algebraic simplification of two displayed identities involving content and primitive part of polynomials over a unique factorization domain $S$.

taocpmathematicsalgorithmsvolume-1math-hard
TAOCP 4.6.1 Exercise 23

Let $u_0(x),u_1(x),\dots,u_{k+1}(x)$ be the Sturm sequence generated from a real polynomial $u(x)$ of degree $m=\deg(u)$ as in (29): u_0(x) = u(x),\qquad u_1(x) = u'(x), and for $j \ge 1$,

taocpmathematicsalgorithmsvolume-1math-medium
TAOCP 4.6.1 Exercise 19

We treat the problem in two parts: first the general existence theorem for greatest common right divisors of integer matrices, then the explicit computation for the specific matrices.

taocpmathematicsalgorithmsvolume-1math-project
TAOCP 4.6.1 Exercise 20

The game is played on a tree, which is an undirected, connected, acyclic graph.

taocpmathematicsalgorithmsvolume-1math-project