Research Article

Finite-Input Error Bounds for Three-Uniform Gamma Sampling

Bohan Cheng*
The Chinese University of Hong Kong, Shenzhen

* Corresponding author: [email protected]

Abstract

In computer simulation, approximating continuous uniform inputs by finite grids can alter the distribution of generated random variates, including Gamma samples, and affect the accuracy of Monte Carlo estimates. This paper quantifies the resulting distributional error and derives explicit finite-input error bounds for Greaves's three-uniform Gamma sampler, assuming exact subsequent arithmetic. The main result is a Kolmogorov distance bound of the form m i n { 1 , 9 C a + 4 N } , valid uniformly over all output thresholds and for every real shape parameter a≥1. Integrating out the third input yields a conditional distribution function whose coordinate-wise variations are controlled by monotone factors and Box–Muller geometry. Endpoint quadrature bounds the first two discretization errors, whereas exact counting bounds the third. For independent inputs of common grid size N=2 p and every real shape a≥1, the Kolmogorov error is less than 17/N, with an explicit shape-dependent bound. Floating-point arithmetic and pseudorandom dependence are outside the model.

Keywords: Gamma sampling; finite uniform inputs; bounded variation; Kolmogorov distance
Published: December 1, 2026
DOI: 10.54254/2753-8818/2027.39751
Volume: TNS Vol.207
pp. 61-66
Download PDF

References

  1. Greaves, D. (2026). Extended one-liners for the gamma, Poisson, and binomial distributions. arXiv:2609.11539. https://arxiv.org/abs/2609.11539
  2. Marsaglia, G., & Tsang, W. W. (2000). A simple method for generating gamma variables.ACM Transactions on Mathematical Software, 26(3), 363–372. https://doi.org/10.1145/358407.358414
  3. Derflinger, G., Hörmann, W., & Leydold, J. (2010). Random variate generation by numerical inversion when only the density is known.ACM Transactions on Modeling and Computer Simulation, 20(4), Article 18. https://doi.org/10.1145/1842722.1842723
  4. Saad, F. A., & Lee, W. (2025). Random variate generation with formal guarantees.Proceedings of the ACM on Programming Languages, 9(PLDI), Article 152. https://doi.org/10.1145/3729251
  5. Haney, S., Desfontaines, D., Hartman, L., Shrestha, R., & Hay, M. (2022). Precision-based attacks and interval refining: How to break, then fix, differential privacy on finite computers. arXiv:2207.13793. https://arxiv.org/abs/2207.13793
  6. Appell, J., Banaś, J., & Merentes, N. (2014).Bounded variation and around. De Gruyter. Proposition 1.10, p. 62. https://doi.org/10.1515/9783110265118
  7. Niederreiter, H. (1992).Random number generation and quasi-Monte Carlo methods. SIAM. https://doi.org/10.1137/1.9781611970081