brain
tamnd's digital brain — notes, problems, research
43815 notes
Let the memory consist of locations $L_0 < L \le L_\infty$.
A correct proof must introduce a coupling invariant that controls how the two executions can differ.
For fixed $n$, the multinomial vector satisfies the multivariate central limit theorem.
Let $S_n=k_1(n)+k_2(n)$ and $D_n=k_1(n)-k_2(n)$.
We restart from the definitions and construct a **valid Monte Carlo experiment** that faithfully simulates both Algorithm $G$ and the earlier **one-by-one shifting algorithm**, then describe how to es...
Let $a_1,\ldots,a_m$ be independent choices with $\Pr{a_j=1}=\Pr{a_j=2}=1/2$.
The mathematical model of Exercise 9 assigns a random sequence of stack operations and defines the total number of moves as a sum of contributions from individual insertions, where each insertion may...
Let the model in the text generate a random sequence a_1,a_2,\dots,a_n, where each $a_i$ is chosen independently and uniformly from $\{1,2,\dots,m\}$.
Let $m$ be the number of items $a_1, a_2, \ldots, a_m$, where each $a_j \in {1,2,\ldots,n}$.
The previous solution failed because it replaced the actual state of the memory in Fig.
The key point of the exercise is that the _global memory management_ (Algorithm G with rules (9), (10), and repacking) is unchanged in spirit: it still allocates contiguous blocks to each list and rep...
The variable `OLDTOP[j]` is defined as the value of `TOP[j]` immediately after the previous allocation of memory.
We extend the circular array representation $X[1],\ldots,X[M]$ used in (6a) and (7a), with pointers $F$ (front) and $R$ (rear), where the queue is empty exactly when $F = R$.
Let (8) denote the standard MIX sequence that performs table access via a relocatable base and indexing, of the form \texttt{LD1 I},\quad \texttt{LDA BASE},\quad \texttt{STA *+1},\quad \texttt{LDA *,1...
We adopt the MIX indirect addressing semantics from the extension in Exercise 3: - An effective address $a$ may be modified by index additions $rI_i$.
Let MIX effective address modification be governed by an $I$-field taking values $0,1,\dots,7$, where $0,\dots,6$ are ordinary modifications and $7$ denotes indirect addressing.
A queue is a linear list in which insertions occur at the rear and deletions occur at the front, using Knuth’s notation (4) and (5).
We correct the solution by fixing the Baxter characterization and by making the deque–Baxter correspondence explicit as a cited theorem rather than an informal claim.
Let $a_n$ denote the number of permutations of $12\ldots n$ obtainable by a stack, as in Exercise 4.
The queue is stored in the circular array $X[1], \ldots, X[M]$ with pointers $F$ and $R$, initially $F = R = 1$.
A sequence of operations on an output-restricted deque consists of symbols $S$, $Q$, and $X$, applied to the input stream $1,2,\dots,n$ in that order.
The correct resolution is that **every permutation of $1,2,\ldots,n$ is obtainable** using an unrestricted deque, but the proof must explicitly justify why adding the largest element does not restrict...
Fix a convention.
Let $b_n$ denote the number of permutations of $1,2,\dots,n$ obtainable by an output-restricted deque, equivalently by an input-restricted deque, as established in earlier exercises.
A deque supports insertions and deletions at its ends.
Let $a_n$ denote the number of permutations of ${1,2,\dots,n}$ obtainable by a stack operating as in Exercise 2, where each element is pushed once and popped once.
Every insertion into the queue places the new element at the rear, and every deletion removes the element at the front.
We prove the equivalence carefully from first principles, correcting both directions.
A legal sequence of operations consists of reading cars $1,2,3,4,5,6$ in order, each either being pushed onto the stack or popped to output when it becomes the next required output.
An output-restricted deque permits insertions at both ends and deletions at only one fixed end.
Let a sequence of operations consist of symbols $S$ and $X$, where $S$ inserts the next input car into the stack and $X$ removes the top stack car to the output.
The previous solution does not implement any MIX program because it has no access to the content of steps $B1$–$B3$.
We first restate a clean and valid MIX representation and then give a corrected program that follows MIX conventions consistently.
Let TOP denote the word containing the link field of the top node.
Let $TOP$ denote the address of the top card of the pile, with $TOP = 0$ representing an empty pile.
The operation $ \text{CARD} \leftarrow \text{NODE}(\text{TOP}) $ copies each field of the node at $\text{TOP}$ into the corresponding fields of the node-valued variable $\text{CARD}$.
Let the pile be represented as a linked structure of cards.
Let $TOP$ denote the address of the first card in the pile, and let $NEXT(X)$ denote the link field of card $X$, with value $0$ meaning “no successor.
Let the structure in Figure (3) consist of four nodes linked by the field $NEXT$: TOP \rightarrow N_1 \rightarrow N_2 \rightarrow N_3 \rightarrow N_4 \rightarrow NIL and suppose the figure specifies t...
For any variable $V$, the expression $\mathrm{CONTENTS}(\mathrm{LOC}(V)) = V$ holds whenever $V$ denotes a storage cell in the sense of Section 2.
Let the three buffers be `BUF1`, `BUF2`, and `BUF3`, each consisting of 100 words.
The exercise asks for a formulation of the "green-yellow-red-purple" buffering scheme of Fig.
In the multiple-buffering scheme described in the text, the normal discipline is \cdots\ \text{ASSIGN}\ \cdots\ \text{RELEASE}\ \cdots\ \text{ASSIGN}\ \cdots\ \text{RELEASE}\ \cdots so that the comput...
In the multiple buffering scheme, anticipated input is used: whenever a buffer is released for processing, the CONTROL coroutine immediately initiates reading of another card into a free buffer.
There are twelve buffer assignments in the computation sequence.
Subroutine (4) detects the end of a buffer by placing a sentinel in the 101st word of each buffer.
Let $n$ be the number of I/O devices referred to by the program, and let $T_i$ denote the time required to perform a complete unbuffered I/O operation on device $i$, for $1 \le i \le n$.
Let a program process $n$ blocks of data using a single I/O device.
The unbuffered method is \texttt{OUT 1000(6); JBUS *(6).
(a) No.
The output analogue of (4) should keep one buffer available for writing by the program while the other buffer is being written onto tape.
Writing trace output directly to a printer or similar output device forces the trace routine to compete with the traced program for that device.
The previous solution fails because it assumes a clean separation between “program being traced” and “tracing mechanism.
The original solution correctly removed self-exclusion, but it failed to address the essential point: MIX tracing does not inherently create recursive invocations of the tracer.
Let $T_A$ and $T_B$ denote two physically distinct copies of the trace routine in Section 1.
The correct construction is event-based: one output is produced exactly when a jump instruction is executed, and the output records that instruction’s location and its destination.
The critical issue is the incorrect assumption that control can be returned after restoring $rJ$ using `JMP *`.
We are asked to determine the truth of the statement: _Whenever line 010 of the simulator program is executed, we have $0 \le rI6 < \text{BEGIN}$.
At each cycle the trace routine reaches location `INST` (line 34) immediately before the simulated execution of the external instruction.
The simulator maintains the state of the simulated MIX machine, including the registers `AREG`, `I1REG`, …, `I6REG`, `XREG`, `JREG`, and the special registers `CLOCK`, `OVTOG`, and `COMPI`, together w...
The simulator assigns execution time $2$ to the instruction `LDA`, as shown by the entry \texttt{LDA \ \ LOAD(2)} in `OPTABLE`.
The operation code 6 corresponds to the shift group handled by the single routine `SHIFT`, entered from the switching table `OPTABLE` with execution time $2$.
In the given program the label `BEGIN` performs the initialization that, in the actual MIX machine, is performed by pushing the GO button.
In the original linkage (4), only one register-save location is introduced, and only one direction of communication is protected: the contents of register $A$ are saved when control passes from one co...
The error in the previous solution is the treatment of the resume labels.
The previous solution fails primarily because it is not a valid MIX program: it uses non-existent instructions, inconsistent state handling, and an incoherent coroutine structure.
Consider a conventional stored-program computer with a program counter $\mathrm{PC}$ and memory cells that can hold addresses.
We address the reviewer’s objections by rebuilding the argument from the actual structural role of the three occurrences of `CMPA PERIOD` inside `OUT`, without assuming anything global beyond what is...
Short examples of coroutines tend to collapse either into ordinary sequential programs or into degenerate cases where the coroutine mechanism is not exercised.
Self-modifying code is discouraged because modern computer architectures and software systems separate the treatment of instructions and data, and this separation is essential for correctness, perform...
The proposed failure analysis is incorrect because it assumes a missing or premature dependency in the initialization of `INX`.
We restart from correct MIX semantics in TAOCP and rebuild the solution cleanly.
In MIX without a J-register, subroutine linkage must be achieved by explicitly storing the return address in a general register or memory cell before transferring control to the subroutine, and then r...
The original attempt fails because it tries to update memory-resident variables with `INCX`/`DECX`, which in MIX affect only register $X$.
Let the call `JMP MAX100` occur at location $L$.
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.
Let $\pi$ be a permutation of ${1,\ldots,n}$.
The previous answer failed because it replaced the TAOCP interface conventions with ad hoc parameter passing.
Let $N = m + n$.
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 $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}$.
Let m=2^{2^l},\qquad n=2^{2l+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?
Let $S$ denote the perfect shuffle permutation on ${1,2,\ldots,2n}$.
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 $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.
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.
No.
Program A is analyzed in the text under the assumption that all blank words occur at the extreme right of the input.
The input (6) consists of five parenthesized cycles $(acfg)(bcd)(aed)(fade)(bgfae)$, so the number of input cards is X = 5.
Algorithm $B$, as described in Section 1.
The permutation `(acf)(bd)` consists of a $3$-cycle and a $2$-cycle.