brain
tamnd's digital brain — notes, problems, research
41266 notes
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 $X_M$ denote the number of probes required for an unsuccessful search in a linear probing table of size $M$ containing $N$ stored keys.
The claim is that for integers $n,k,q>0$, \binom{n}{q}\binom{k}{q}\in \mathbb{Z}.
Let the Fibonacci rabbit model be the standard one: a single initial pair is present at month $0$; every pair produces exactly one new pair in each month starting from its second month of life; no pai...
Let $A$ denote the null pointer used in Algorithm T.
In the six-tape case we have $T=6$ and hence $P=T-1=5$.
Let C^*(w)=\min_T \sum_{v} w_v d_v(T) be the optimal alphabetic tree cost for the ordered weight sequence
The reviewer’s objection is correct: simply replacing FIFO queues by LIFO stacks breaks stability.
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.
Let $b_1 b_2 \dots b_n$ be the inversion table of the permutation $a_1 a_2 \dots a_n$.
The solution fails at the very first structural step: the cost formulas for the five trees are partly incorrect, so everything built on them (inequalities, regions, integrals) is invalid.
The earlier solution fails primarily because it never instantiates Algorithm C’s actual state mechanism: a 5-way polyphase merge on six tapes driven by a 5-term Fibonacci-type (pentanacci) distributio...
The previous solution incorrectly assumed that the cost functional decomposes as C_y = \frac{1}{M}\sum_K C(K), with each $C(K)$ depending only on the increment sequence assigned to $K$.
Let $T$ be a rooted tree with $n>0$ leaves, and let the degree path length $(6)$ be defined as in Section 5.
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...
Algorithm 6.
Let the sequence maintained by the Garsia–Wachs algorithm be $L = (l_1, l_2, \dots, l_m)$ in symmetric order.
The key fix is to discard the incorrect “uniform random cycle” model and replace it with a correct symmetry argument for double hashing: the probe sequence is not uniform over all permutations, but it...
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$.
Batcher’s merge-exchange method is not stable.
For a fixed value of $j$, step S2 selects the maximum of the keys $K_1,\ldots,K_j$.
Let the tapes be $0,1,\dots,P$, where tape $q$ is the designated output tape and the remaining $P$ tapes are work tapes.
Let Algorithm L be the straight two-way merge sort in which the initial step L1 sets the system so that every record $R_i$ forms a run of length $1$, and later steps repeatedly merge runs of fixed siz...
We restart the analysis from the actual structure of the comparison, without introducing abstract per-iteration cost parameters.
Let $I_n$ denote the internal path length of the random BST built from $n$ keys.
No.
The review identifies three genuine failures: an unjustified symmetry factor, an unsupported intermediate bound, and a mismatch between the run decomposition and the claimed inequality.
We analyze the random-permutation model: all $n!$ input permutations of distinct keys are equally likely.
Let $p\ge 1$ and let $(F_n)_{n\ge 0}$ satisfy F_n = \sum_{i=1}^p F_{n-i}\qquad (n\ge p), with fixed initial values $F_0,\dots,F_{p-1}$.
For $n>0$, the recurrence $P_n=\sum_{k=1}^{n} \binom{n}{k} P_{n-k}$ together with $P_0=1$ is multiplied by $z^n/n!$ and summed over all $n\ge 1$.
A correct analysis must avoid treating the evolving replacement process as i.
The errors in the previous solution stem from two issues: (i) failure to verify that the transformation “descending run = apply $x \mapsto 1-x$” preserves the structural hypotheses of Theorem K at the...
Let M= \begin{pmatrix} q_1&q_2&\cdots&q_n\\ p_1&p_2&\cdots&p_n
Let a variable-length key $K$ be a finite sequence of MIX characters $K = c_1 c_2 \dots c_\ell,$ where each $c_i$ is an element of a fixed alphabet of radix $r$ (for MIX, typically $r = 64$ or $r = 10...
We restart from the actual structure of Program C and compute the averages directly from the frequency model, without introducing non-uniform quantities as constants.
Let $N$ keys be stored in an $M$-ary trie under the uniform random model in which each digit of each key is independently uniformly distributed in ${0,1,\dots,M-1}$.
Let $T_N$ be the Coffman–Eve $M$-ary digital search tree built from $N$ independent random infinite strings over an alphabet of size $M>2$.
Let $P$ be a tableau of shape $(m_1,m_2,\dots,m_k)$, with $m_1 \ge m_2 \ge \dots \ge m_k > 0$.
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.
Let $P = T-1 \ge 2$.
The previous solution fails because it treats the weight data as missing.
**Exercise 5.
Let $S_N = d_1 + d_2 + \cdots + d_N$.
Algorithm R initializes the selection tree by filling all external nodes with the next input records.
Let the initial distribution place $S$ runs onto $P$ input tapes for a $P$-way merge under Algorithm F in Section 5.
Let the 31 keys be the most common English words in Fig.
By equation (42), the quantity $Q_o(M,N)$ satisfies Q_o(M,N) = 1 + \frac{N}{M} Q_o(M,N-1).
We restart from the definition of the condition and first extract its actual global consequence, instead of interpreting it geometrically.
We repair the argument from the ground up and keep only valid structural facts about optimal BSTs.
Let $K_1, K_2, \dots, K_r$ be the binary keys, each a finite string over ${0,1}$, and let $T$ be the binary trie formed by these keys.
Solution to TAOCP 5.3.3 Exercise 10.
The running time of Program S is $9B+10N-3A-9.$ By the results stated in Section 5.
Let $C_N$ denote the quantity defined in equation (14) of Section 6.
The earlier solution fails because it imports a Fibonacci _tape-capacity invariant_ from polyphase merging that does not belong to radix distribution.
The previous solution failed because it tried to analyze the function $\delta(t)=d(t,i)-d(t,i+1)$ directly on the cycle, where it is not monotone and in fact has multiple regime changes.
Let $m=1$.
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 $A_n$ be the expected cost of an $M$-ary digital search tree built from $n$ random keys, and let $P(z)$ be its Poisson transform.
The reviewer is correct that the original attempt destroys the essential feature of TAOCP §5.
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)$,...
Let w = 3111231423342244 a word on $\{1,2,3,4\}$ having 5 runs (maximal weakly increasing consecutive blocks).
The previous solution failed because it tried to _postulate_ a kernel and then retrofit a “memoryless explanation” instead of deriving the joint law from the actual state evolution at the instants whe...
Algorithm 5.
Let $T$ be a binary search tree with cost C(T)=\sum_{i=1}^n p_i\,\mathrm{depth}(k_i)+\sum_{i=0}^n q_i\,\mathrm{depth}(d_i), where all $p_i,q_i\ge 0$ and $p_n=q_n=0$.
Let the comparison used in Algorithm R for the selection tree be denoted by $\prec$, where in the original algorithm $a \prec b$ means that key $a$ is smaller than key $b$.
The flaw in the previous solution is that it never uses the data in Tables 3 and 4.
Six tapes are partitioned into three logical pairs.
Let $M$ be the number of hash addresses and let $n$ be the number of occupied cells at the moment a new key $K$ is inserted by Algorithm C.
Working
(a) The permutation $376981452$ has the disjoint cycle decomposition (1\,3\,6\,4\,9\,2\,7)(5\,8).
**Exercise 5.
Let $F = \mathrm{GF}(2^n)$, and let $a \in F$ be an element of order $n$.
We restart the analysis from the definition of **four-way replacement selection** (TAOCP §5.
Algorithm C still works if $i$ varies from $2$ up to $N$ in step C2 instead of from $N$ down to $2$, because the comparisons made in step C4 depend only on the relative ordering of $K_i$ and $K_j$, no...
We restart the analysis from the structure actually used in Algorithm F (as modified in Exercise 14): a Fibonacci tree representation where the search space consists of all internal and external nodes...
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 Algorithm B denote the standard binary search of Section 6.
The error in the previous solution is not cosmetic.
The core mistake in the previous argument is the attempt to manufacture a per-level varying radix structure from tape-role behavior.
In step D3, Program D performs three actions before any comparison outcome is known: it sets $i = j - h$, it loads $K = K_j$, and it loads $R = R_j$.
We construct all values for $V_t(8)$ using a single consistent method: an optimal 8-element tournament followed by explicit optimal selection in the induced comparison structure.
At the start, Algorithm H sets $i \leftarrow 0$ and then sets $P \leftarrow \mathrm{TOP}[0]$.
Let $K$ be the number of records in a fixed bucket.
The goal is to determine the sorted order of $n$ keys, knowing each key is either $0$ or $1$.
Let $W_t(n)$ denote the worst-case number of comparisons required by any comparison-based algorithm for the structure defined in the exercise.
For the input $N,N-1,\ldots,2,1$, the sequence $K_1, K_2, \ldots, K_j$ is strictly decreasing for every $j \ge 2$.
**Exercise 5.
The flaw in the previous solution is that it replaces Algorithm U’s interval invariant with a “reachability” heuristic.
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...
Let the Fibonacci tree of order $k$ be defined as usual: a node of order $t$ has a left child of order $t-1$ and a right child of order $t-2$.
**Exercise 5.
The original proof failed because it tried to replace the evolving tree by a “random BST” argument and then imported harmonic search costs that only hold for that model.
The previous proof failed because it incorrectly treated reachability in a general DAG as if it could be incremented only locally per comparison, and then incorrectly decomposed two dependent costs as...
The previous solution fails because it never reconstructs the _actual performance quantity in TAOCP’s striping model_.
Let Algorithm S be the full sequence of insertions described in Algorithm I applied successively, terminating with a tableau $P$ and a final added position $(r,s)$ determined at the last insertion ste...
A correct proof must specify an invariant state of the polyphase algorithm and show that this invariant is exactly the Fibonacci decomposition encoded by Fibonacci trees.
h_k(z)=\sum_{m\ge k}p_{km}z^m is the probability generating function of the total length S_k=L_1+\cdots+L_k
**Corrected Solution for Exercise 5.
Let the positions be $1,2,\dots,N$.
Let M_n = \max_{0 \le i < n} S_i(m_1,\ldots,m_p) be the maximum load.