brain
tamnd's digital brain — notes, problems, research
41641 notes
We are asked whether Theorem C from _The Art of Computer Programming_ would still hold if the variables $a$, $u_1, u_2, \dots, u_r$, and $u$ were allowed to be arbitrary real numbers instead of intege...
Equation (13) is obtained by the rule stated immediately before it.
Let m=\operatorname{lcm}(m_1,m_2,\ldots,m_r).
Find all integers $u$ satisfying u \equiv 1 \pmod 7, \qquad u \equiv 0 \pmod{11}, \qquad
The desired value of $w$ is the nearest integer to $uv/255$.
Let $u$ be a $2n$-place number and $v$ an $n$-place number in base $b$, with $0 \le u < b^{2n}$, $0 \le v < b^n$, and assume $u = vq$ so the remainder is zero.
We are given a directed graph whose vertices are cities and whose root is city 1, the capital.
Let u_i=(u_{i,n-1}\cdots u_{i,1}u_{i,0})_b, \qquad 0\le u_i<b^n, and let
Let $x = uv$, where $0 \le u,v < 2^n$.
The solution attempts to prove the lower bound on the true remainder when the trial quotient $\hat q$ underestimates the true quotient $q$ by 1.
Let \(\phi\) be given to \(n\) digits of precision in a fixed radix \(b\).
In Algorithm D, step D1 multiplies both the dividend and the divisor by the same power of $b$ so that the leading digit of the divisor satisfies $v_{n-1} \ge \lfloor b/2 \rfloor$.
A correct solution must design algorithms, not analyze radix transformations.
A correct design must first remove the ambiguity about what “word-level scaling” means and then express every operation in terms of explicit operations on fixed-size word arrays.
Assume first that $v \ne 0$.
**Solution to Exercise 4.
In Algorithm A, each digit $w_j$ is computed from the expression $u_j + v_j + k$, where $k$ is the carry from the previous position.
The claim is: > At the beginning of step D3 of Algorithm D, we always have $u_{j+n} = 0$.
Let $v = (.v_{n-1}\,v_{n-2}\,\ldots v_1\,v_0)_b$ with $v_{n-1} \ne 0$.
**Solution to Exercise 4.
**Corrected Solution to Exercise 4.
Step D8 in Program D performs the correction after an over-subtraction in the trial quotient step of the division algorithm.
Let the dividend be $(u_3 u_2 u_1 u_0)_{10} = (8500)_{10}$ and the divisor be $(v_2 v_1 v_0)_{10} = (101)_{10}$.
Let $b,v\in\mathbb{Z}$ with $1\le v<b$.
Section 4.
Let $u$ and $v$ be positive integers with $n$ digits in base $b$, written in the notation of Exercises 19 and 20: u = u_{n-1} b^{\,n-1} + u_{n-2} b^{\,n-2} + \cdots + u_0, \qquad v = v_{n-1} b^{\,n-1}...
**Solution to Exercise 4.
In the setting of Fig.
**Solution to Exercise 4.
The solution correctly addresses the exercise.
We prove the validity of Algorithm M by induction on the outer loop variable $j$, using the method of inductive assertions from Section 1.
The solution correctly addresses the exercise.
Let the multiplicand be stored in memory as U=(u_{n-1}\ldots u_1u_0)_b, with one digit per word, and let $v$ be a single precision number,
Exercise 4.
Program S represents the quantity $1+k$ in register A.
Exercise 4.
Compare the digits beginning with the most significant position.
Exercise 4.
Exercise 5 of section 4.
We are asked to design an algorithm that adds two numbers digit by digit from **most significant to least significant**, producing each output digit only when it cannot possibly be affected by future...
Unusual activity has been detected from your device.
A single-precision floating point number in MIX, as defined in Section 4.
Exercise 4.
**Solution: Generalizing Algorithm A for Column Addition of $m$ Nonnegative $n$-Place Integers** Let $x_1, x_2, \dots, x_m$ be $m$ nonnegative integers, each expressed in base $b$ as $n$-digit numbers...
We restate (10) in the form relevant here.
Let a positive normalized radix $16$ floating point number have fraction part $f$ satisfying $1/16 \le f < 1$.
Let $U$ be uniformly distributed on $[0,1)$.
Let a page of the antilogarithm table correspond to a fixed interval of the argument $y = \log_{10} x$, for example a unit interval $[k, k+1)$, where the table returns $x = 10^y$.
Let $U>0$ be a floating decimal number.
This exercise is experimental.
Write the floating point decimal numbers in normalized form: u=10^{e_u}f_u,\qquad v=10^{e_v}f_v, where
A single-precision floating point number in MIX, as defined in Section 4.
**Exercise 4.
Program M computes a double-precision product by expanding each normalized operand into high and low halves, forming four partial products, then discarding all terms that lie strictly to the right of...
**Exercise 4.
We write all numbers in the TAOCP double–precision format with \epsilon = \frac{1}{100}.
We are asked to determine all pairs $(a, b)$ such that \text{round}(b, \text{even}(x)) = \lfloor ax + b \rfloor + \lfloor ax - b \rfloor holds for all real $x$.
Program **B** is designed to perform a sequence of numerical calculations using the X-register of a hypothetical or HP-style RPN calculator.
The phenomenon arises from catastrophic cancellation.
Let x(y)=\left(\frac13-y^2\right)(3+3.
Let $F$ be the set of floating point numbers in the interval $[x_0 \mathinner{\ldotp\ldotp} x_1]$.
Solution to TAOCP 4.2.2 Exercise 29.
The point is that _cancellation_ is often misunderstood.
Let x = 1 \ominus u.
Let $u$, $u'$, $v$, and $v'$ be positive floating point numbers such that $u \sim u'$ ($r$) and $v \sim v'$ ($s$), where $r$ and $s$ are small relative errors in normalized arithmetic.
The statement is **false**.
We need to construct interval arithmetic for extended floating-point intervals, including signed zeros and infinities, with the ordering -\infty < -x < -0 < 0 < +0 < +x < +\infty for all positive $x$.
Let T(x)=(x\otimes v)\oslash v, so that
**Solution to Exercise 4.
Solution to TAOCP 4.2.2 Exercise 19.
We work in **unnormalized floating-point arithmetic** with base $b$ and precision $p$, and assume that no overflow or underflow occurs.
The bug in the previous solution is not in the algorithm itself but in the testing harness and how the function `can_divide` is scoped and used.
The previous solution is completely unrelated to the exercise.
The solution does address the exact question.
Let $m$ and $n\ne 0$ be integers represented exactly as normalized floating point numbers with $p$ significant digits in base $b$.
We are asked whether, in floating-point arithmetic, the computed midpoint of an interval always lies between the endpoints.
Let $u$, $v$, and $w$ be floating point numbers, not necessarily normalized, and consider _unnormalized multiplication_, denoted by $\otimes$.
We are asked to **prove Lemma T** (TAOCP, Section 4.
The proposed solution does **not** answer the question asked.
Equation (33) in Section 4.
In one's complement notation, the value represented by $(e,+.f)$ is $+.f\times 2^e$.
Let the radix be $b$ and let the precision be $p$.
We consider each identity in turn, assuming that all operations are normalized floating point operations as defined in Section 4.
Consider binary floating point arithmetic with a small precision.
The answer is **no**.
**Solution.
All computations are performed in eight-digit floating decimal arithmetic with rounding to the nearest floating point number, as in Section 4.
Assume that $x\ge0$ and $y\ge0$.
**Exercise 4.
Let the machine be as described: 36-bit words, positive floating numbers represented as (0\,e_1 e_2 \ldots e_6 \, f_1 f_2 \ldots f_{27})_2, with an excess-64 exponent $(e_1\ldots e_6)_2$ and a 27-bit...
The running time of the FADD subroutine in Program A depends on several characteristics of the input floating point numbers $u = (e_u, f_u)$ and $v = (e_v, f_v)$, and on the parameters $b$ (byte size)...
The goal is to design a single-word floating-point representation in which the exponent range increases as its magnitude increases, while the precision of the fraction decreases correspondingly.
We correct the solution by making all intermediate operations explicit in MIX terms and by giving a complete MIXAL-level subroutine.
Let $(a+bi)/(c+di)$ be a complex quotient with real floating point numbers $a$, $b$, $c$, and $d$, where $c+d \ne 0$.
Let the input in register $A$ represent a floating point number in MIX format, possibly unnormalized.
The key failure in the previous solution is the assumption that rounding only occurs in Algorithm N.
Let the floating point numbers be represented in normalized form with base $b$, precision $p$, and excess-$q$ exponent, as described in Section 4.
We are asked to exhibit normalized, eight-digit floating decimal numbers $u$ and $v$, with excess 50, such that multiplication of $u$ and $v$ results in _rounding overflow_.
We are asked to construct **normalized eight-digit floating decimal numbers** $u$ and $v$ whose **sum produces rounding overflow** in the sense of TAOCP, Section 4.
Work in the TAOCP floating-point model: base $10$, precision $p=8$, normalized numbers $0.d_1d_2\ldots d_8\times 10^e$, with exponent range $-50\le e<50$.