brain
tamnd's digital brain — notes, problems, research
41641 notes
We restart from correct MIX semantics in TAOCP and rebuild the solution cleanly.
Let $\pi$ be a permutation of ${1,\ldots,n}$.
The correct replacement must reproduce the _defining semantics of_ `JSJ X` in MIX: \texttt{JSJ X: } J \leftarrow \text{address of next instruction}, \quad \text{then } \text{go to } X.
The previous answer failed because it replaced the TAOCP interface conventions with ad hoc parameter passing.
Let the array be x_0 x_1 \ldots x_{l+m+n-1} = \alpha\beta\gamma, where $\alpha$, $\beta$, and $\gamma$ are consecutive substrings of lengths $l$, $m$, and $n$, respectively.
Let m=2^{2^l},\qquad n=2^{2l+1}.
Let $N = m + n$.
Let $x_0x_1\ldots x_{l+m+n-1} = \alpha\beta\gamma$, where $\alpha = x_0\ldots x_{l-1}$, $\beta = x_l\ldots x_{l+m-1}$, and $\gamma = x_{l+m}\ldots x_{l+m+n-1}$.
Stopped thinking
Let $J_m(n)$ denote the Josephus permutation for step size $m>1$ on the positions ${1,2,\ldots,n}$.
Stopped thinkingIs this conversation helpful so far?
For each element $x$ in the underlying universe, let $t(x)$ denote the number of sets among $S_1,S_2,\ldots,S_M$ that contain $x$.
Let $S$ denote the perfect shuffle permutation on ${1,2,\ldots,2n}$.
Let $M = m_1 m_2 \cdots m_t$.
Find the variance of the quantity $A$ that enters into the timing of Algorithm $J$.
Let \alpha_1,\alpha_2,\ldots denote the numbers of cycles of lengths
Equation (25) for the rencontres numbers gives, when $k=0$, P_{n0} = n!
Let all cycles occurring in all permutations of $n$ elements be listed, including singleton cycles.
Algorithm $J$ is not defined in the provided excerpt, and the quantity $A$ in its timing analysis is also not defined within the given material.
No.
Let \pi=(x_1\,x_2\,\ldots\,x_n) be a cycle.
Let the data characteristics of Program $B$ be denoted by the frequencies $A,B,\ldots,Z$ appearing in its flowchart analysis.
The permutation `(acf)(bd)` consists of a $3$-cycle and a $2$-cycle.
Algorithm $B$, as described in Section 1.
The input (6) consists of five parenthesized cycles $(acfg)(bcd)(aed)(fade)(bgfae)$, so the number of input cards is X = 5.
Program A is analyzed in the text under the assumption that all blank words occur at the extreme right of the input.
Using the left-to-right convention of Section 1.
Applying the first permutation, then the second, as prescribed in the text, gives a\mapsto b\mapsto d,\qquad b\mapsto d\mapsto b,\qquad c\mapsto c\mapsto f,
The original solution fails because it inverts the byte decomposition of the `F`-field and uses an incorrect address validity test.
In MIX, each input-output device is governed by a device-specific behavior for the execution of I/O instructions.
The program has two distinct phases: a **construction phase** that builds a buffer in memory, and an **output phase** that repeatedly prints overlapping segments of that buffer.
Assume $n$ is not prime.
(a) In MIXAL, a label of the form $kB$ denotes a backward reference to the most recent preceding occurrence of the local label $kH$.
Line 03 executes `STJ EXIT`, which stores the contents of register $rJ$ into the address field of the instruction labeled `EXIT` (line 12).
The reviewer is correct on one central point: MIX opcodes, field encoding, and ALF representation are fixed parts of the TAOCP model and are not “missing data.
The program first performs input synchronization and then calls the subroutine `MAXIMUM` from Program $M$ on a shrinking prefix of the array $X[1], \ldots, X[100]$, after which it exchanges the curren...
The directive `X EQU 1000` only defines the symbol `X` as the assembly-time constant $1000$, so it does not affect any memory cell during execution.
The central error in the previous solution is the assumption that a field load or store can “shift” a register.
A proposed extension of MIX is sought, subject to the requirement that every program correctly written for MIX continue to operate without change.
The previous solution fails because it never implements a valid MIX-level mechanism for byte handling, numeric decoding, or address manipulation.
Working
The J-register is defined to contain the address of the instruction following the most recent jump operation.
Location $2000$ initially contains the integer $X$.
Let $M = 1$ denote the address used by all instructions.
The previous solution correctly recalls the general definition of execution time in the MIX model, but it never performs the only task the exercise asks for: instantiating that definition on the _spec...
The failure is entirely in the construction of the `HLT` word.
A _typewriter_ or _paper-tape_ block contains a single alphanumeric character, since these devices operate serially, transferring one character per I/O operation.
The core issue in the proposed solution is that it never correctly compares the index register $rI_1$ with the bound $rI_2$.
The previous solution fails because it builds the argument around a nonexistent need to construct a zero word and around an incorrect use of `MOVE`.
We restart from correct MIX semantics rather than relying on the incorrect assumption that $F=0$ nullifies the operation.
We restart from the MIX instruction semantics rather than attempting to reinterpret the field specification.
Let the instruction at location $1000$ be either $\mathrm{JOV}\ 1001$, $\mathrm{JNOV}\ 1001$, $\mathrm{JOV}\ 1000$, or $\mathrm{JNOV}\ 1000$.
We are given a tree, and for every node we want to measure how “large” a path can become if we force that node to lie somewhere on the path. More precisely, fix a node i.
We restart the analysis from the definition of how MIX modifies index registers.
The comparison indicator is assigned only by instructions whose operational definition explicitly specifies a comparison between a register field and a memory field, producing one of $\text{LESS}$, $\...
We restart from the MIX specification of the overflow toggle.
Let the contents of register $rA$ be $A = s_A \cdot a$ and the contents of register $rX$ be $X = s_X \cdot x$, where $s_A, s_X \in {+1,-1}$ and $a, x \ge 0$ are the absolute values represented in the...
Let the original example on page 133 define a fixed MIX division rAX \leftarrow D,\quad V \text{ given}, \quad D = VQ + R,\quad 0 \le R < |V|.
The sign is part of the address field in a MIX instruction word, so the quantity written as $\pm AA$ may be negative even though memory locations themselves are numbered $0$ through $3999$.
If (6) is viewed as a machine word in the instruction format, it has the structure \pm\ AA\ I\ F\ C, where $C$ determines the operation code, $F$ is the field specification, $I$ is the index specifica...
We work in standard MIX conventions from TAOCP: each word consists of a sign and 5 bytes, and each byte must satisfy $0 \le \text{byte} \le 63$.
Let $G(z)=\sum_{n\ge 0} a_n z^n$ be a generating function in the sense of (1).
A MIX byte has $64$ distinct values (as defined in TAOCP).
A MIX byte is guaranteed to contain at least $64$ distinct values, so $k$ adjacent bytes can represent at most $64^k - 1$ different unsigned values.
The instruction format places the sign and address $\pm AA$ in bytes $0$ through $2$, the index field $I$ in byte $3$, the field specification $F$ in byte $4$, and the operation code $C$ in byte $5$.
For $m \ge 1$, define the sum A_m(n,r;z_1,\ldots,z_m) = \sum_{k_1,\ldots,k_m \ge 0} \binom{r}{n-k_1}\binom{k_1}{n-k_2}\cdots\binom{k_{m-1}}{n-k_m}
Expand the right-hand side using the binomial theorem and the definition of generating functions: (1+zG(z))^m=\sum_{k=0}^m \binom{m}{k}(zG(z))^k =\sum_{k=0}^m \binom{m}{k} z^k G(z)^k.
For each integer $j \ge 0$, define A_j(z) = \sum_{k \ge 0} \binom{r}{k} z^{k 2^j}.
Consider \sum_k \binom{n}{k} 2^{\,n-2k}(-2)^k.
Let A_m(z)=\sum_{n\ge 0} n^m z^n.
Define H_x=\sum_{n\ge 1}\left(\frac{1}{n}-\frac{1}{n+x}\right), and let $0<p<q$ with $p,q\in\mathbb{Z}$.
Let $a_n = n!$ and let $G(z)$ be its ordinary generating function G(z) = \sum_{n \ge 0} n!
Let P(z)=\prod_{k=1}^{n}(1+kz).
For each of the $n$ objects, suppose the object is chosen $j$ times, where $0 \le j \le r$.
Start from the identity \frac{1}{(1-z)^w} = (1-z)^{-w} = \exp\!
Let $f(x)=\sum_k a_k [0 \le k \le x]$.
Let G(z)=\sum_{n\ge 0} a_n z^n,\qquad \omega=e^{2\pi i/m},\qquad \omega^m=1,\ \omega^k\ne 1\ (1\le k<m).
Let G_n(z) = \sum_{k=0}^{n} \binom{n-k}{k} z^k, and define the bivariate generating function
We restart from the exponential generating form and compute coefficients carefully, correcting the expansion of $A^2$ and the higher-order bookkeeping.
Let $\langle a_{mn} \rangle$ be a doubly indexed sequence for $m,n \ge 0$.
Let H(z)=\sum_{m\ge 0} h_m z^m,\qquad h_0=1, and let
Let $S_k$ denote the power-sum quantities and $h_k$ the sequence defined by Eqs.
Let $F_0=0$, $F_1=1$, and $F_{n+1}=F_n+F_{n-1}$.
Let $p(n)$ denote the number of representations of $n$ as a sum of positive integers, where order is disregarded and repetition is allowed.
Let a_n=\sum_{0<k<n}\frac{1}{k(n-k)} \qquad (n\ge 1), and $a_0=0$.
Define $S(k,n)$ as in Eq.
The previous solution failed because it did not use the correct form of Eq.
Let A(z)=\sum_{n \ge 0} H_n z^n=\frac{1}{1-z}\ln\frac{1}{1-z}.
Let A(z)=\sum_{n\ge 0}\frac{a_n}{n!
Let $\langle a_n \rangle = 2^n + 3^n$.
The recurrence a_{n+2}=a_{n+1}+6a_n,\quad a_0=0,\quad a_1=1 is linear with constant coefficients, so we seek solutions of the form $a_n=r^n$.
Let $v_k=(F_k,F_{k+1})$ for all integers $k$.
We start from a structural point that the flawed solution already had correct: the problem is not the decomposition via Binet’s formula, but the attempt to control the error term by a crude absolute b...
Define $L(n)=\left\lceil \log_2 n \right\rceil + \left\lceil \log_2 (n+1) \right\rceil - 2$ for $n\ge 1$.
Let $S_1=a$, $S_2=b$, and $S_{n+2}=S_{n+1}S_n$.
The previous solution fails because it assumes the Fibonacci structure of winning play without proving it.
The decisive error is the assumption that Fibonacci Nim is characterized at all times by pairs $(F_{k+1}, F_k)$.
A base-$\phi$ representation is a finite or infinite digit sequence $(\ldots a_2 a_1 a_0 . a_{-1} a_{-2}\ldots)_\phi$ with $a_k \in {0,1}$ and value \sum_{k=-\infty}^{\infty} a_k \phi^k.
Write z=\frac{\pi}{2}+i\ln\phi .
Assume the Fibonacci numbers are defined by F_1=1,\quad F_2=1,\quad F_{n+2}=F_{n+1}+F_n \quad (n\ge 1).