brain
tamnd's digital brain — notes, problems, research
41311 notes
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.
Exercise 4.
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,
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.
Unusual activity has been detected from your device.
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...
A single-precision floating point number in MIX, as defined in Section 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...
Exercise 4.
We restate (10) in the form relevant here.
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 a positive normalized radix $16$ floating point number have fraction part $f$ satisfying $1/16 \le f < 1$.
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}.
Program **B** is designed to perform a sequence of numerical calculations using the X-register of a hypothetical or HP-style RPN calculator.
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$.
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.
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 point is that _cancellation_ is often misunderstood.
Let x = 1 \ominus u.
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$.
**Solution to Exercise 4.
Let T(x)=(x\otimes v)\oslash v, so that
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.
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 solution does address the exact question.
The previous solution is completely unrelated to the exercise.
Let $u$, $v$, and $w$ be floating point numbers, not necessarily normalized, and consider _unnormalized multiplication_, denoted by $\otimes$.
We are asked whether, in floating-point arithmetic, the computed midpoint of an interval always lies between the endpoints.
Let $m$ and $n\ne 0$ be integers represented exactly as normalized floating point numbers with $p$ significant digits in base $b$.
The proposed solution does **not** answer the question asked.
We are asked to **prove Lemma T** (TAOCP, Section 4.
In one's complement notation, the value represented by $(e,+.f)$ is $+.f\times 2^e$.
Equation (33) in Section 4.
Let the radix be $b$ and let the precision be $p$.
Consider binary floating point arithmetic with a small precision.
We consider each identity in turn, assuming that all operations are normalized floating point operations as defined in Section 4.
**Solution.
All computations are performed in eight-digit floating decimal arithmetic with rounding to the nearest floating point number, as in Section 4.
The answer is **no**.
Assume that $x\ge0$ and $y\ge0$.
**Exercise 4.
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)...
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 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$.
The key failure in the previous solution is the assumption that rounding only occurs in Algorithm N.
Let the input in register $A$ represent a floating point number in MIX format, possibly unnormalized.
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$.
We consider floating point arithmetic in the context of base-$b$ digits with normalized representation, following Section 4.
**Problem.
The answer is determined by the normalization routine used by FADD.
Let f_e=b^{p-2}F_e, where $F_e$ is an integer.
We are asked to determine the largest and smallest positive values representable in a base-$b$, excess-$q$, $p$-digit floating point system, both in general and under the _normalized_ constraint.
We are asked to compute the result of Algorithm A for the given pairs of floating-point numbers in base $b=10$ with precision $p=8$.
The proposed solution does **not** address the exercise that was asked.
In MIX floating point with byte size $100$, a number is represented as (\text{sign})\,(e,b_1,b_2,b_3,b_4), where
Let n=\sum_{i\ge0} a_i2^i, \qquad a_i\in\{-1,0,1\}.
Let u=(\ldots u_3u_2u_1u_0.
Let S_n=\left\{\sum_{i=0}^{n-1} a_i3^i : a_i\in D=\{-1,0,3\}\right\}, and let
Let A=\left\{\sum_{i\ge 0}\varepsilon_i3^i:\varepsilon_i\in\{0,1\}\right\}, \qquad B=\left\{\sum_{j\ge 0}\delta_j5^j:\delta_j\in\{0,1\}\right\}.
Let b_0,b_1,b_2,\ldots be a binary basis, that is, every integer has a unique representation
Let ${T_0, T_1, T_2, \ldots}$ be a collection of sets of nonnegative integers that satisfies **Property B**; that is, every nonnegative integer $n$ can be written uniquely as n = t_0 + t_1 + t_2 + \cd...
Let $z = a + bi$ be a nonzero Gaussian integer, where $a, b \in \mathbb{Z}$.
Let $n$ be a nonzero integer.
A skater moves on horizontal ice with both skate blades in contact with the surface.
Let D_t=\{0,1,2,3,4,5,6,7,8,10+t\}, \qquad t=0,1,2,\ldots We shall prove that every $D_t$ satisfies conditions (i), (ii), and (iii).
Let x=\frac{u}{v}, where $b\ge2$, $u>0$, $v>0$, and
**Exercise 4.
Let the digit set be D=\left\{-\frac{9}{2},-\frac{7}{2},-\frac{5}{2},-\frac{3}{2},-\frac{1}{2},\frac{1}{2},\frac{3}{2},\frac{5}{2},\frac{7}{2},\frac{9}{2}\right\}.
Let $D={d_1,\dots,d_b}\subset \mathbb{R}$ be a finite digit set with the property that every positive real number admits at least one representation of the form x=\sum_{k\le n} a_k b^k,\qquad a_k\in D...
**Exercise 4.
Let $D$ be a set of $b$ integers such that for each residue $j$ modulo $b$, there exists exactly one element $a \in D$ with a \equiv j \pmod{b}, \quad 0 \le j < b.
Let $B = i - 1$ denote the base of the number system under consideration.
Let (a_n a_{n-1} \ldots a_1 a_0)_{i-1} = \sum_{j=0}^{n} a_j (i-1)^j be a number in the $(i-1)$-ary system, where each digit satisfies
Let $\beta = i + 1$.
We correct the missing justification by giving a fully constructive expansion algorithm for the negative decimal system and then completing the standard argument for the quater-imaginary system.
We are given an even number of arrays, each array is a permutation of numbers from 1 to some common length $n$. The key operation allowed on any array is a cyclic rotation, where the last element moves to the front.
Let the base be $2i$, as in the quater-imaginary system.