brain
tamnd's digital brain — notes, problems, research
41641 notes
Let keys lie in the ordered set $\{1,2,\dots,m\}$, with $m$ fixed, and let $S_m(n)$ be the worst–case number of comparisons needed by an optimal comparison tree that produces a stable sorted order of...
Working
A correct analysis must avoid treating the evolving replacement process as i.
Let N(a,b,c) denote the number of permutations of the multiset
Let the table have size $M$, and let $n$ records be present, so exactly $M-n$ locations are empty.
**Exercise 5.
The running time of Program S is $9B+10N-3A-9.$ By the results stated in Section 5.
Let f_p(z)=z^p - z^{p-1}-\cdots-1.
Let $X_n$ denote the number of descents in a random permutation of ${1,2,\dots,n}$.
The root node compares $K_1$ and $K_2$.
Using the binomial theorem, (1-1)^n=\sum_{k=0}^{n}\binom{n}{k}1^{\,n-k}(-1)^k =\sum_{k=0}^{n}\binom{n}{k}(-1)^k .
Let $G_n$ be the $n$-cube with vertex set $\{0,1\}^n$.
The goal is to determine the sorted order of $n$ keys, knowing each key is either $0$ or $1$.
Let $K_a(n)$ denote the number of ordered (plane) rooted trees with $n$ nodes in which every leaf is at distance exactly $a$ from the root.
At initialization $i \leftarrow 1$.
Let $T_0(x)=x*x$, $T_1(x)=x$, and for $n \ge 0$, T_{n+2}(x)=T_{n+1}(x) * T_n(x).
The failure in the previous solution is the incorrect introduction of an inhomogeneous “deviation dynamics.
Let $s_0, s_1, \ldots, s_n$ be arbitrary distinct keys.
Let $T$ be a random AVL tree produced by Algorithm A from a uniformly random permutation of $\{1,\dots,n\}$, $n>6$.
The previous solution fails because it treats the weight data as missing.
Let keys $1,\dots,n$ have search probabilities $p_1,\dots,p_n$ and external probabilities $q_0,\dots,q_n$ as in Section 6.
We repair the argument from the ground up and keep only valid structural facts about optimal BSTs.
Let $H$ be a matrix with $R$ rows and one column for every possible key $K$.
The key issue is the conditioning of the truncation point.
Let $P$ be the number of external nodes of the loser tree and let $h$ be its height, so that every path from an external node to the root contains exactly $h$ internal nodes.
A $P$-way merge produces one output block per unit of time, where the time to write a block equals the time to read a block.
We give a clean decision-tree argument that avoids the gap in the previous solution and directly relates worst-case depths.
Yes.
Let V_n = (A_n, b_n, c_n, d_n, e_n).
Let $x = a_i$ and $y = a_j$ with $i < j$ and $x > y$.
The flaw in the previous argument is the assumption that LOSER pointers are merely passive storage.
Let $n$ be the total number of distinct elements.
Solution to TAOCP 5.3.3 Exercise 10.
We restart from a correct decision-tree formulation and remove the unverified state model.
No.
Let $N$ records reside initially on tape $T_0$.
Let each node $P$ contain fields $\operatorname{KEY}(P)$, $\operatorname{LLINK}(P)$, $\operatorname{RLINK}(P)$, and a tag $\operatorname{RTAG}(P)\in{0,1}$.
The changes preserve correctness.
A correct solution must start from a precise dual of Algorithm D and then state explicit, local pointer and tag updates that maintain inorder threading in all cases.
Let $P$ be the tableau corresponding to a permutation $a_1 a_2 \dots a_m$.
Let $B_h$ denote the number of balanced trees of height $h$, and define $C_h = B_h + B_{h-1}$.
Let a schedule be a permutation $a_1 a_2 \dots a_n$ of the jobs $1,2,\dots,n$.
The key point is not that File 2 is “unused”, but how Algorithm B assigns and clears buffers when a file changes role and when the first output block is actually produced.
The error in the previous solution occurs at exactly one decisive point: the computation of m_k=\left\lfloor \frac{r_k}{2}\right\rfloor from the binary expansion of $N$.
The reviewer is correct: the proposed solution does not address the problem at all.
The product is interpreted as P=\left(1-\frac{1}{5}\right)\prod_{k\ge 1}\left(1-\frac{1}{3^k}\right).
Batcher’s merge-exchange method is not stable.
Working
For each pair $(j,i)$ with $j<i$, step C4 increases exactly one of `COUNT[j]` or `COUNT[i]`.
The error in the previous solution is structural: it used an incorrect recurrence for the modified external path length and then built an unnecessary vector-valued dynamic program on top of it.
After Step 3 the current front keys of the four runs are $503,\ 170,\ 426,\ 612$ after the replacement of $154$ by $426$.
The expression in the prompt is clearly truncated, but the surviving fragment “$k>2$” together with the parameters $s>0$, $m>1$, and the cross-reference to Exercise 5.
We restart from the actual structure of the defining equation (15) and avoid introducing any artificial kernel.
The flaw in the previous argument is that it tried to _compute_ subtree validity and heights from the balance-factor sequence before establishing that a subtree actually exists.
The flaw in the previous argument is not the linear algebraic part but the missing derivation of the transition rule from the definition of the perfect Fibonacci (perfect polyphase) distributions in (...
The original submission contains no construction or argument, so the solution must be rebuilt from the definitions of Mauchly’s read-backwards radix sort and the 4-LIFO representation used in Section...
Let $B_h(z)$ denote the ordinary generating function in which the coefficient of $z^n$ equals the number of balanced binary trees with $n$ internal nodes and height exactly $h$.
A $t$-ary tree is a rooted ordered tree in which each internal node has at most $t$ children.
Algorithm D inserts keys one at a time.
In double hashing with open addressing, a key $K$ is examined in the sequence of table positions h_1(K),\; h_1(K) + h_2(K),\; h_1(K) + 2h_2(K),\; \dots \pmod{M}, so that $h_2(K)$ determines the step s...
The statement concerns three families of quantities $X_n(m)$, $Y_n(m)$, $S_n(m)$, together with a primed variant $X'_{n-1}(m)$.
Let M= \begin{pmatrix} q_1&q_2&\cdots&q_n\\ p_1&p_2&\cdots&p_n
Let $W_t(n)$ denote the worst-case number of comparisons required by any comparison-based algorithm for the structure defined in the exercise.
Phase 2 constructs the binary tree from the sequence produced by phase 1, which is a linear list of leaves (or partial trees) in symmetric order.
Storing the index of each node as its key forces the keys to represent a global linear order.
Let the sample space consist of all sequences $(K_1,\dots,K_7)$ of seven distinct keys chosen from the set of $MP$ possible keys, with each such sequence having equal probability under successive unif...
The previous solution fails because it replaces the problem with a partitioned memory model.
Let $T$ be a rooted tree with $n>0$ leaves, and let the degree path length $(6)$ be defined as in Section 5.
Let the hash table have $M$ locations.
Let the search tree be built by inserting keys in the order $K_1, K_2, \dots, K_n$, where the access probabilities satisfy $p_1 > p_2 > \cdots > p_n.$ The structure of Algorithm $T$ depends only on ke...
Let $S_N = d_1 + d_2 + \cdots + d_N$.
Working
After 14 outputs, all but two elements have been replaced by $-\infty$ in the tournament structure of Fig.
The previous argument failed at the very start because it assumed a functional equation without deriving the Schay–Spruth state recursion.
Algorithms 6.
Let $K$ be the search argument, and assume it is represented as a sequence of characters ending with the blank symbol used in Algorithm T.
Let $A$ denote the null pointer used in Algorithm T.
We analyze the modified versions of Algorithm B under the assumption that the table is sorted strictly increasing, k_1 < k_2 < \cdots < k_n, and that the key $K$ is present, with unique index $p$ such...
Let $T_7$ denote a balanced binary tree with $7$ internal nodes.
Patricia trees represent a set of strings by a compressed trie in which each branching decision is determined by inspecting selected character positions, and in which nodes are arranged so that every...
The flaw in the previous solution is that it replaces Algorithm U’s interval invariant with a “reachability” heuristic.
Algorithm T performs a search by repeatedly comparing $K$ with $KEY(P)$ and then moving to $LLINK(P)$ or $RLINK(P)$ until either the key is found or the pointer becomes $A$.
Let $M$ be the range of hash values $\{0,1,\dots,M-1\}$.
Let $P_{n,k}$ denote the number of permutations $a_1,\dots,a_n$ of $\{1,\dots,n\}$ such that, when Algorithm T inserts $a_1,\dots,a_n$ into an initially empty binary search tree, exactly $k$ compariso...
Let $M(m,n)$ denote the minimum number of comparisons required to merge two increasing sequences of lengths $m$ and $n$.
The previous solution fails because it replaces Carroll’s actual tournament mechanism with an invented dominance-based rule and then reasons about that artificial system.
After Program C has terminated, the value $\mathrm{COUNT}[i]+1$ is the final position of record $R_i$.
Let $T=5$ and hence $P=4$.
Let $M(m,n)$ be Knuth’s function from Section 5.
Let (17) be written in its full binomial-convolution form as it appears in Section 6.
Let \Delta[j]=\left\lfloor \frac{N+2^{j-1}}{2^j}\right\rfloor,\qquad 1\le j\le k,\quad k=\lfloor \lg N\rfloor+2.
Let $b_1 b_2 \dots b_n$ be the inversion table of the permutation $a_1 a_2 \dots a_n$.
Let condition (31) be the 2-descending condition for binary search trees: for every node $P$, every node $Q$ in the subtree rooted at $\mathrm{LLINK}(P)$ satisfies $\mathrm{KEY}(Q) < \mathrm{KEY}(P)$,...
The previous argument fails because it replaces the actual TAOCP merge-until-empty mechanism with a two-number Euclidean subtraction process.
Table 1 gives the following MIX running-time estimates for list-sorting methods: \begin{aligned} \text{List insertion:} \qquad &1.
We analyze a 2–3 tree built by inserting a random permutation of $n$ distinct keys, using the standard top-down insertion algorithm with node splitting.
We restart from the definition of Algorithm C as the binary search procedure on an ordered table $A[1],\dots,A[N]$, using repeated halving of the interval of possible locations of the search key $K$.
Let $d$ be fixed.
The reviewer is correct that the previous solution replaced Program F’s frequency model with an unjustified uniform-visitation assumption.
We restart from the correct structure of a 4-tape polyphase merge.