REVIEW 7 minor 2 cited by
MichelangeRoll: Sculpting Rational Distributions Exactly and Efficiently
T0 review · 0 major / 7 minor · reviewed 2026-08-06 · deepseek-v4-flash
Pith's one-line read MichelangeRoll samples any rational distribution exactly with H(D)+ε fair coin tosses per sample and polynomial memory.
desk verdict A clean, honest algorithm paper that breaks the '+2' barrier by recycling leftover entropy with ANS; the proof holds, and the result is real though incremental over concurrent work. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The load-bearing object is the asymmetric numeral system (ANS), an entropy-coding scheme that compresses a stream of symbols into a single integer by alternating multiplication and addition. Here it takes a residual pair $(N_t,S_t)$ and updates one state $A_t$; Lemma 4 shows the aggregated state is uniform in $\{0,1,\ldots,N_1\cdots N_t-1\}$, so no randomness is lost inside the accumulator. The companion bit-extraction loop—output the parity of $A_t$, halve both $A_t$ and $N_t$, and stop when $N_t$ is odd and $A_t=N_t-1$—turns that integer back into fair, independent coin tosses, and Lemma 6's expected-toss bound $>\log_2(N)-3$ makes the recycling loss small. The subinterval construction with $M=\lfloor 2^{j+k}/m\rfloor m$ keeps the rejection rate and the reset frequency low enough that the combined loss is $O(\varepsilon)$ per sample.
What would settle it
Evaluate the recurrence $T(N)=1+T(N/2)$ for even $N$ and $T(N)=((N-1)/N)(1+T((N-1)/2))$ for odd $N$ up to large $N$ (or find a closed form) and check whether $T(N)\ge \log_2(N)-3$ ever fails for a positive integer $N$. A counterexample would invalidate the entropy accounting; a proof of the stronger $T(N)\ge \log_2(N)-2$ would tighten the algorithm's constant.
Extended reading notes
Core claim
At the center of the paper is the observation that a non-dyadic uniform draw still carries randomness that can be saved instead of thrown away. MichelangeRoll draws a uniform integer from $[0,2^{j+k})$, locates it in one of $n$ subintervals of lengths $Mp_i$ plus a rejection interval, and emits the interval index whenever it is a genuine $D$-outcome. The pair $(N_t,S_t)$—the interval length and the offset inside it—is pushed into the asymmetric numeral system through $A_t := A_{t-1}N_t + S_t$, so residual uniform numbers aggregate into one large uniform integer; at resets, a halving procedure converts $A_t$ into fair coin tosses, with Lemma 6 bounding the loss by fewer than three bits per reset. Since the rejection rate is below $\varepsilon^2$ and the ANS is reset every $O(1/\varepsilon)$ samples, the total loss is $O(\varepsilon)$ per sample, which proves Theorem 1's $H(D)+\varepsilon$ entropy guarantee under the stated memory and time bounds.
Load-bearing premise
The paper's entropy guarantee rests on the claim that the bit-extraction procedure recovers at least $\log_2(N)-3$ tosses in expectation from a uniform integer in $\{0,\ldots,N-1\}$; if the true loss per reset were larger than three bits, the per-sample entropy bound would not follow.
Editorial extensions
If this is right
- For every rational distribution $D$, an ongoing sample stream can be generated with $H(D)+\varepsilon$ fair coin tosses per sample, so the old '+2' overhead disappears without batching exponentially many samples.
- The memory bound $O((n+1/\varepsilon)\log(m/\varepsilon))$ avoids the $n^{1/\varepsilon}$ and $m^{1/\varepsilon}$ blow-up that batch-amortization would require.
- Distributions with small entropy, such as Bernoulli(1/100), benefit most because the former fixed overhead was large relative to $H(D)$.
- The algorithm can be run indefinitely with a bounded buffer, since the coin-toss buffer is emptied before each reset rather than merely with high probability.
Reading between the lines
- Beyond the paper: the same recycle-the-residual pattern should extend to other entropy sources, such as non-dyadic dice or biased coins; the paper lists this as future work, and nothing in the aggregation lemma depends on the source being fair.
- Beyond the paper: a public proof of the sharper two-bit extraction bound would improve the additive constant in the entropy guarantee; the paper currently relies on a private communication for that sharper estimate.
- Beyond the paper: an implementation for small $m$ could reveal whether the theoretical entropy saving survives practice, since the quoted $O(\log(m/\varepsilon)^2/\varepsilon)$ operation count is dominated by schoolbook integer multiplication.
Signed reviews
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. This paper presents MichelangeRoll, an algorithm for generating an ongoing sequence of exact samples from a rational discrete distribution D=(p_1,...,p_n) with common denominator m, using fair coin tosses. The main result (Theorem 1) states that for any small constant ε>0, the expected number of fresh coin tosses per D-sample is H(D)+ε, with O((n+1/ε) log(m/ε)) memory and O(log(m/ε)^2/ε) operations per sample. The construction generates a uniform integer U_t in [0,2^{j+k}) and partitions the range into n outcome intervals and one rejection interval. When U_t falls into the i-th interval, the algorithm outputs i; the offset S_t inside the interval is fed into an asymmetric numeral system (ANS) that aggregates these uniform remainders into a large integer A_t. At reset, A_t is converted back into fair coin tosses, which are reused as randomness for future samples. The proof bounds two sources of entropy loss: the rejection indicator, contributing O(ε^2 log(1/ε)) per sample, and the ANS reset, contributing at most 3 bits per reset, which amortizes to O(ε). The exactness and independence of the recycled bits are established in Lemmas 4-5, and Lemma 6 proves that the expected number of tosses extracted from a uniform integer in [0,N) exceeds log2(N)-3.
Significance. If correct, the theorem is a significant advance in exact random variate generation: it breaks the Knuth-Yao '+2' barrier for exact sampling without the exponential space blow-up of batching, matching Shannon entropy up to an arbitrarily small additive ε. The proof is self-contained for the main theorem; importantly, the sharper Conjecture 8 is not used, so the H(D)+ε claim rests only on Lemmas 4-7, whose induction and mean-value-theorem estimates are explicit and verifiable. The paper also gives a clear comparison with prior work (Knuth-Yao, Han-Hoshi, rejection sampling, Draper-Saad), and the acknowledgment of concurrent work is honest. The cost is higher time complexity, but the paper is upfront about this trade-off.
minor comments (7)
- [Section 4.3] The text says 'we lost 3 bits every time the ANS is reset' and 'it resets once every 1/ε samples'; the first should be 'at most 3 bits' (since Lemma 6 is an upper bound) and the second should be 'at most once every 1/ε samples', because the proof only shows the product N_1...N_t grows by a factor less than 2^{j+k} per iteration, so resets cannot occur more frequently than once per 1/ε samples.
- [Abstract and Theorem 1] The phrase 'per samples' should be 'per sample' in both the abstract and the theorem statement.
- [Section 4.5 and Table 1] The expression 'O(log(m/ε)2/ε)' is ambiguous and should be typeset as O(log^2(m/ε)/ε) to avoid confusion with multiplication by 2.
- [Appendix A] The symbol ν is not defined, and the proof sketch relies on [Eli72, (14)] and [KY76, (2.19)] without the necessary context; since Conjecture 8 is not required for Theorem 1, this is a presentation issue, but the appendix as written is not self-checkable.
- [Section 3.3, proof of Lemma 6] In the odd case of the induction, the intermediate line '= N + 3/N log2(N − 1) − 3K + 1/N' appears garbled; it should be '= ((N+3)/N) log2(N−1) − 3 − 1/N' with the erroneous 'K' removed.
- [Section 4.4, footnote] The footnote says the buffer bound is 'an almost always bound'; this should be 'a deterministic (worst-case) bound', since the argument is not probabilistic.
- [Section 2.1] There is a typo: 'deviates away form Shannon's prediction' should be 'deviates away from Shannon's prediction'.
Circularity Check
No significant circularity identified.
full rationale
The derivation of Theorem 1 is self-contained and does not reduce to its inputs by construction. The central entropy-saving claim rests on Lemma 6, whose proof is an induction with a mean-value-theorem bound supplied by Lemma 7, not on a fitted parameter or an assumed conclusion. The entropy accounting in Section 4.3 separately bounds rejection loss and per-reset loss, then amortizes the constant per-reset loss over an ANS block of length about 1/epsilon; none of these steps presuppose the H(D)+epsilon result. The recycled-bit independence and fairness are established by Lemmas 4 and 5. External results cited, including Knuth-Yao, are classical and used for context or for the non-load-bearing Appendix A confirmation of Conjecture 8; that conjecture is explicitly not needed for Theorem 1. There are no self-citations by the authors, no fitted input renamed as a prediction, and no uniqueness theorem imported from prior work by the same authors. The paper compares against external benchmarks such as Knuth-Yao's H(D)+2 and Draper-Saad's recent work, and the claimed improvement is proved rather than assumed.
Assumptions & free parameters
assumptions (3)
- domain assumption D is a rational distribution with a known common denominator m.
- standard math Uniform random integers can be converted into fair independent bits by the parity-extraction procedure.
- standard math Knuth-Yao's bound on the function ν(N), cited as [KY76, Theorem 2.2], used in Appendix A to prove the sharper entropy extraction bound.
Cite this review
Pith. "Pith review of MichelangeRoll: Sculpting Rational Distributions Exactly and Efficiently." pith.science (2026). https://pith.science/paper/E6RMSDUW
@misc{pith2026250700915,
author = {Pith},
title = {Pith review of: MichelangeRoll: Sculpting Rational Distributions Exactly and Efficiently},
year = {2026},
howpublished = {\url{https://pith.science/paper/E6RMSDUW}},
note = {Machine review of arXiv:2507.00915}
}
abstract
Simulating an arbitrary discrete distribution $D \in [0, 1]^n$ using fair coin tosses incurs trade-offs between entropy complexity and space and time complexity. Shannon's theory suggests that $H(D)$ tosses are necessary and sufficient, but does not guarantee exact distribution. Knuth and Yao showed that a decision tree consumes fewer than $H(D) + 2$ tosses for one exact sample. Draper and Saad's recent work addresses the space and time aspect, showing that $H(D) + 2$ tosses, $O(n \log(n) \log(m))$ memory, and $O(H(D))$ operations are all it costs, where $m$ is the common denominator of the probability masses in $D$ and $n$ is the number of possible outcomes. In this paper, MichelangeRoll recycles leftover entropy to break the "$+2$" barrier. With $O((n + 1/\varepsilon) \log(m/\varepsilon))$ memory, the entropy cost of generating a ongoing sequence of $D$ is reduced to $H(D) + \varepsilon$ per sample.
Figures
Figures from the paper (4 more)
Forward citations
Cited by 2 Pith papers
-
Space-Entropy Lower Bounds for Random Sampling
Exact entropy-efficient random sampling with per-sample entropy loss ε requires Ω(log(1/ε)) bits of persistent space, with sharp constants for Bernoulli(1/3) and almost all k-outcome distributions.
-
Online Random Sampling with Real Probabilities
An online sampler converts fair coin flips into exact samples from arbitrary computable distributions with entropy loss O(log n) and O(log n) persistent space, matching lower bounds up to constants.
Reference graph
Works this paper leans on
- [1]
-
[2]
M. Blum. Independent unbiased coin flips from a correlated biased source: A finite state markov chain. In 25th Annual Symposium onFoundations of Computer Science, 1984. , pages 425--433, October 1984
work page 1984
-
[3]
Thomas L. Draper and Feras A. Saad. Efficient Online Random Sampling via Randomness Recycling , July 2025
work page 2025
-
[4]
Thomas L. Draper and Feras A. Saad. Efficient Rejection Sampling in the Entropy-Optimal Range , April 2025
work page 2025
-
[5]
Jarek Duda. Asymmetric numeral systems: Entropy coding combining speed of Huffman coding with compression rate of arithmetic coding, January 2014
work page 2014
-
[6]
The efficient construction of an unbiased random sequence
Peter Elias. The efficient construction of an unbiased random sequence. The Annals of Mathematical Statistics , 43(3):865--870, 1972
work page 1972
-
[7]
P \'a l Erd \"o s and M Ram Murty. On the order of a (mod p). In CRM Proceedings and Lecture Notes , volume 19, pages 87--97, 1999
work page 1999
-
[8]
T. S. Han and M. Hoshi. Interval algorithm for random number generation. IEEE Transactions on Information Theory , 43(2):599--611, March 1997
work page 1997
Show all 17 references
-
[9]
Optimal rolling of fair dice using fair coins, December 2024
Mark Huber and Danny Vargas. Optimal rolling of fair dice using fair coins, December 2024
2024
-
[10]
Optimal Coin Flipping
Dexter Kozen. Optimal Coin Flipping . In Franck Van Breugel, Elham Kashefi, Catuscia Palamidessi, and Jan Rutten, editors, Horizons of the Mind . A Tribute to Prakash Panangaden , volume 8464, pages 407--426. Springer International Publishing, Cham, 2014
2014
-
[11]
Knuth and A
D. Knuth and A. Yao. Algorithms and Complexity: New Directions and Recent Results , chapter The complexity of nonuniform random number generation. Academic Press, 1976
1976
-
[12]
Optimal Discrete Uniform Generation from Coin Flips , and Applications , April 2013
J \'e r \'e mie Lumbroso. Optimal Discrete Uniform Generation from Coin Flips , and Applications , April 2013
2013
-
[13]
Iterating Von Neumann 's Procedure for Extracting Random Bits
Yuval Peres. Iterating Von Neumann 's Procedure for Extracting Random Bits . The Annals of Statistics , 20(1), March 1992
1992
-
[14]
Sung-il Pae and Michael C. Loui. Optimal random number generation from a biased coin. In Proceedings of the Sixteenth Annual ACM-SIAM Symposium on Discrete Algorithms , Soda '05, pages 1079--1088, Vancouver, British Columbia and USA, 2005. Society for Industrial and Applied Ma...
2005
-
[15]
J.R. Roche. Efficient Generation Of Random Variables From Biased Coins . In Proceedings. 1991 IEEE International Symposium on Information Theory , pages 169--169, Budapest, Hungary, 1991. IEEE
1991
-
[16]
Saad, Cameron E
Feras A. Saad, Cameron E. Freer, Martin C. Rinard, and Vikash K. Mansinghka. The Fast Loaded Dice Roller : A Near-Optimal Exact Sampler for Discrete Probability Distributions , June 2020
2020
-
[17]
Various techniques used in connection with random digits
John Von Neumann et al. Various techniques used in connection with random digits. John von Neumann, Collected Works , 5:768--770, 1963
1963
Reviewed August 6, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.