Generating key points…
Answers are grounded in this paper and cite their sources.
Colin Ramsay asked whether the constant amortised time suggested by his operation counts holds for his necklace and bracelet generators. It does. For every integer rank \(g≥2\) and length \(n≥1\), the total generation work of either \(genNeck\) or \(genBrace\), divided by the number of representatives it produces, is bounded by an absolute constant independent of \(g\) and \(n\). The same bound holds with Ramsay's modification for generating only representatives that are not proper powers. The algorithms use \(O(n)\) working words on a word RAM in which alphabet symbols and string indices fit in machine words. Copying or printing a representative still requires writing its \(n\) symbols. Ramsay, *Listing Words in Free Groups*, §5 and Appendix A The alphabet for the free group has \(k=2g\) symbols, ordered from \(0\) to \(k-1\), with inverse \( a=a{xor}1\), where XOR is bitwise exclusive-or. A freely reduced word has no adjacent inverse pair. Cyclic reduction imposes the same condition across the last-to-first edge. A necklace is the lexicographically least word among its cyclic rotations. A bracelet is the least among the rotations of the word and of its inverse, obtained by reversing the word and inverting each symbol. Both generators use the ordinary prenecklace recurrence. A prenecklace is a prefix of a necklace, and a Lyndon word is strictly smaller than each of its nontrivial rotations. For a prefix \(w\) of length \(t≥1\) whose longest Lyndon prefix has length \(p\), try symbols \(x≥ w[t-p]\) using zero-based indices. Equality retains \(p\), and strict inequality sets it to \(t+1\). Reject an append that creates an inverse pair and check the cyclic edge on the final append. At length \(n\), the ordinary output condition is \(p n\), and the primitive-only condition is \(p=n\). For bracelets the first symbol is even, and a prefix \(w\) is rejected if it exceeds its own inverse \(w⁻¹\). The inverse rotation obtained by cutting a completion after that prefix begins with \(w⁻¹\), so the comparison already decides the order at that cut. A freely reduced nonempty prefix cannot equal its inverse. Cattell et al., Theorem 2.1 and Table I The count governing the search is the number of freely reduced prenecklaces, including prefixes whose cyclic edge would fail. Write \(r=k-1\), and let \(L_f(j)\) and \(L_c(j)\) count freely and cyclically reduced Lyndon words, respectively, of length \(j≥1\). The new estimates give \[L_c(j)≤ {k rʲ⁻¹}{j}, L_f(j)≤ L_c(j)+4k L_c(j+1)+(k/2)^j=O(r^j/j). \] The extension term accounts for words that fail cyclic reduction and whose least letter lies in the lower half of the alphabet. The last term bounds the upper-half case. A prenecklace is determined by repeating its longest Lyndon prefix and truncating to the required length. Thus the number \(P_f(t)\) of freely reduced prenecklaces of length \(t≥1\) satisfies \[P_f(t)≤∑ⱼ₌₁^t L_f(j)=O(r^t/t). \] At most two symbols per parent can fail the inverse-edge checks. Each other trial corresponds to a distinct freely reduced prenecklace, even if an inverse comparison later rejects it. The work outside the inverse scans is therefore \(O(n+k+∑ₜ₌₁^n P_f(t))\). For the bracelet generator, reaching the \(h\)th comparison in a scan of a length-\(t\) candidate fixes its final \(h-1\) symbols from its first \(t-h+1\) symbols. For each \(t,h\), this bounds the number of such comparisons by \(P_f(t-h+1)\), including comparisons on candidates that are eventually rejected. The total number of scan comparisons is at most \[∑ₜ₌₁^n∑ₕ₌₁^t P_f(t-h+1) =∑ⱼ₌₁^n(n-j+1)P_f(j)=O(r^n/n). \] All these big-O constants are absolute. The same \(O(r^n/n)\) bound covers the work outside the scans, including start-up. For \(n≥2\), each generator produces at least \(4r^n/(9n)\) representatives in full mode and at least \(r^n/(9n)\) in primitive-only mode. These bounds count cyclically reduced words and use the maximum orbit sizes \(n\) for necklaces and \(2n\) for bracelets. At most \(2rn/2\) words are proper powers, since each is determined by a repeating prefix of length at most \( n/2\). At \(n=1\), all representatives are primitive, with \(k\) necklaces and \(k/2\) bracelets. The output lower bounds give the constant amortised guarantee in both modes by dividing the total generation work by the corresponding output count.
No takes yet. Share an insight, caveat, or question.
Zixuan He (2026) studied this question.
Synapse has enriched 8 closely related papers on similar clinical questions. Consider them for comparative context: