brain
tamnd's digital brain — notes, problems, research
43815 notes
[Section 2.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
In a conventional tree diagram with the root drawn at the top, each node at level $k+1$ is placed below its parent at level $k$.
[Section 2.
Proceed by induction on the number of nodes in the tree.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
Circular lists are used in Fig.
[Section 2.
[Section 2.
[Section 2.
Each of the $200$ rows contains at most $4$ nonzero entries, so the total number of nonzero matrix elements stored as nodes is at most 200 \cdot 4 = 800.
[Section 2.
We reorganize the personnel table so that every attribute list is an **inverted list sorted by a single fixed total order on persons**, for example by a unique person index $1,2,\dots,n$.
[Section 2.
[Section 2.
[Section 2.
[Section 2.
The lexicographic order used for $0 \le k \le j \le n$ is unchanged when the index set is shifted to $1 \le k \le j \le n$; only the origin of the indexing changes.
[Section 2.
Define new indices $I'_r = I_r - l_r$ for $1 \le r \le k$.
We are given a permutation of size $n$, and we need to consider every contiguous subarray. For each subarray, we take its elements and replace them with their relative ranks inside that subarray.
The simulation program maintains two principal dynamic structures, `QUEUE[IN]` and `ELEVATOR`, in which individual users are inserted and later removed according to events generated by the coroutines.
Let each node of $A$ occupy two consecutive memory words and suppose lexicographic (row-major) order is used.
For each floor $j$, record the behavior of the elevator under the following circumstances: 1.
Let $V[1], \dots, V[n]$ be the variables of the system, and let a step of the simulation specify a small subset of these variables to be updated simultaneously.
The `DECISION` subroutine is called whenever the elevator is in a dormant condition and a new request may require a change of state.
Step `E8` is the action that occurs after the elevator has moved one floor in its current direction.
The statement `JANZ CYCLE` at line 154 was intended to skip the "give up" activity `U4` for a user if the elevator had already arrived at the user's floor.
The desired change is that a user waiting on floor `IN` should enter the elevator only if the elevator is accepting passengers whose desired direction agrees with the user's destination.
The scenario given concerns the discrete simulation of the Caltech Mathematics building elevator, using the routines described in Section 2.
Activity `E9` in the elevator coroutine is a scheduled action that occurs after the completion of certain steps in the elevator's operation, specifically following step `E6` (door-closing and possible...
To demonstrate that the elevator system requires three independent binary variables per floor, we must exhibit sequences of button presses that show each variable can be set or cleared independently o...
In representation (1) of a doubly linked list, there are distinguished variables `LEFT` and `RIGHT` giving the locations of the leftmost and rightmost nodes, respectively.
A deque requires efficient insertion and deletion at both ends.
We are asked to design an efficient algorithm to "erase" an entire circular list by placing all its nodes onto the `AVAIL` stack.
Each node $x_i$ stores a single link field $\mathrm{LINK}(x_i)$ defined as the exclusive-or of the addresses of its two neighbors in the circular order.
Let a polynomial be represented as in Section 2.
Let $p$ denote the number of nonzero terms in $P$, $m$ the number of nonzero terms in $M$, and $q$ the number of nonzero terms in the initial polynomial stored in $Q$.
Let $P$ denote the pointer value initially in $rI1$, which points to a node of a circular list representation of a polynomial.
A polynomial equal to $0$ is represented by a single special node, called the terminating node, whose fields satisfy $\mathrm{COEF} = 0$ and $\mathrm{ABC} = -1$, and whose link field points to itself...
Let $P$ contain $n$ nonzero terms, and let $\operatorname{polynomial}(Q)=0$.
We are asked to create a subroutine `COPY` that produces a complete duplicate of a given polynomial represented as a circularly linked list with a sentinel node, preserving the original list and retur...
Algorithm `A` does **not** work properly when `P = Q`.
We wish to adapt Algorithms `A` (addition) and `M` (multiplication) for polynomials in a single variable $x$, allowing exponents up to $b^3 - 1$.
The list representation used in Algorithm $A$ is singly linked, so the link field of a node gives access only to its successor.
The decreasing order of the `ABC` fields makes it possible to compare the current terms of two polynomials and determine immediately whether the exponents are equal, or whether one polynomial contains...
The previous solution used a linear NIL-terminated list, but in TAOCP Section 2.
Let the given circular list be nonempty and let $PTR$ point to its rightmost node, so that $F = LINK(PTR)$ is the leftmost node in the cyclic order induced by following `LINK` pointers.
In representation (4), a circular linked list is maintained with a distinguished head node `HEAD`.
Let L_1 = (a_1, a_2, \dots, a_k), \qquad PTR_1 = a_k, so that
Let the circular list be a directed cycle in which each node has exactly one outgoing link.
Let the proposed convention be that an empty circular list is represented by $PTR = LOC(PTR)$, while a nonempty list is represented as in the text, where $PTR$ is the address of the rightmost node and...
We restart the argument from the correct fixed-point formulation and give a complete retrograde analysis that also accounts for positions that are neither winning nor losing.
The previous solution fails because it never commits to a _true MIX-level representation_: all structure was symbolic, fields were abstract, and control flow relied on pseudocode.
Let the directed graph be $G=(S,E)$ where $S$ is the set of nodes and $E$ is the set of ordered pairs $(u,v)$ indicating an edge $u \to v$.
For each directory node let \operatorname{SPACE}(P) denote the number of words required by subroutine $P$, and let
The flaw in the previous solution is the introduction of an auxiliary walk that is not part of Program $T$’s state.
Algorithm $T$ performs a topological sort on a directed graph with vertices $1,2,\dots,n$, using the array $\text{COUNT}$ and the queue controlled by $F$ and $R$.
Let Algorithm $T$ process an input consisting of relations of the form $j \prec k$.
Program $T$ becomes unsafe when an input value is used as a subscript without verification, since a negative or excessively large value of $k$ causes an access such as $X[k]$ or $\text{COUNT}[k]$ to r...
Algorithm $T$ in §2.
In Algorithm `T`, step `T5` accesses the front element of the queue via the pointer `F` without changing the queue structure, while step `T7` performs the structural update that removes that front ele...
Algorithm $T$ maintains a collection of nodes whose $\text{COUNT}$ field has just become $0$ but whose successor arcs have not yet been fully processed.
Let $(S,\preceq)$ be a finite partially ordered set, and let a _topological sort_ mean a linear extension of $\preceq$, i.
Let $S = {x_1,\ldots,x_n}$ be a finite set with a partial ordering $\preceq$.
We restart the solution from first principles and explicitly execute Algorithm $T$ on the given input.
Let $S$ be a finite partially ordered set with order relation $\preceq$.
Correcting the argument requires first fixing the fundamental mistake in the previous write-up: it is not valid to replace the given instance with a generic discussion.
Define the relation $\preceq$ by x \preceq y \iff (x = y \ \text{or}\ x \subset y).
Let $S$ be a set of $n$ elements.
The reviewer’s objections remove the entire structural collapse used in the previous solution.
The algorithm is correct (standard in-place reversal of a singly linked list).
Let $P$ be a pointer to the current node being processed, initially set to $FIRST$, let $Q$ be a pointer to the already reversed portion of the list, initially set to $\Lambda$, and let $R$ be an auxi...
A relation $\preceq$ is a partial ordering on $S$ if it is reflexive, antisymmetric, and transitive.
Use the standard representation employed in §2.
The previous solution fails at the only critical requirement of the exercise: it never actually changes the return address used by `JMP 0,3`, so it cannot produce return to $rJ - 2$.
Let the linked representation be the standard TAOCP structure with node fields $\mathrm{INFO}$ and $\mathrm{LINK}$, and with pointers $F$ and $R$ to the front and rear of the queue.
The flaw in the previous solution is that it still implicitly relies on evaluating $\text{LINK}(P)$ in the case where $P$ is the last node.
The correct solution must be rebuilt from the MIX calling convention of Section 1.
The stack part of the proposed solution is already correct under 0-origin indexing.
Operation (8) uses the allocation primitive $P \Leftarrow \text{AVAIL}$, which is defined in (6).
The error in the previous solution is exactly the attempt to control the additive $O(n)$ per repacking by bounding the number of repackings.