First-Order Entropic Sampling of Words with Prescribed Letter Counts in Linear Time
Olivier Bodini (LAGA), Francis Durand (LAGA)
Key points
From the paper's conclusion- We sample, exactly and uniformly, a word of length n over the alphabet {0, . . . , r} in which the letter j occurs a prescribed positive number k j of times, from a source of fair random bits.
Abstract
We sample, exactly and uniformly, a word of length n over the alphabet {0, . . . , r} in which the letter j occurs a prescribed positive number k j of times, from a source of fair random bits. Every exact sampler reads on average at least H = log 2 (___ n k0,...,kr )___ bits. We give a sampler that reads on average at most H fresh bits, whatever r and the counts, and that performs O(n) bit operations on average over every fixed alphabet, in a bit-RAM in which a memory access costs O(1) while arithmetic is charged bit by bit. Both bounds are optimal: the first one to first order, the second one up to a constant factor, since writing the output already costs $\Theta$(n). The sampler writes the word as a Huffman tree of independent binary words, and samples each of them in one of two ways. Binary words with few ones are generated by random insertions; the rank of each inserted letter among its copies, which the Fisher-Yates shuffle generates for nothing, is uniform and independent of the word, and is given back to a recycling source of uniform integers, where it pays for the next insertions. Binary words with many ones are generated by MergeShuffle driven by blocks of $\Theta$(log n) bits of entropy; a block is decoded by locating only its ones when the minority letter is rare, and otherwise, its number of ones being concentrated, by a precomputed table of the blocks of typical type, of size O( $\sqrt$ n log 4 n), the rare atypical blocks being decoded slowly.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Improved upper bound on the number of distinct k-decks for any k and alphabet size by counting the independent parametersarXiv · 2026
- Universal coding with the exhaustive peres transformarXiv · 2026
- Massively Parallel Algorithms for Huffman CodingarXiv · 2026
- Polynomial Sample Complexity of Noninteractive Simulation over Finite AlphabetsarXiv · 2026
- Binary Huffman Coding with Unequal Letter Costs Is NP-CompletearXiv · 2026
- Breaking the Binary-Lifting Barrier for DNA Minimizer Density: Exact Optimization of a Native 4-ary Order at (w, k) = (12, 5)arXiv · 2026