Sampling from Discrete and Continuous Distributions with C-Rand

  • Ernst Stadlober
  • Ralf Kremer
Conference paper
Part of the Lecture Notes in Economics and Mathematical Systems book series (LNE, volume 374)


C-RAND is a system of Turbo-C routines and functions intended for use on microcomputers. It contains up-to-date random number generators for more than thirty univariate distributions. For some important distributions the user has the choice between extremely fast but rather complicated methods and somewhat slower but also much simpler procedures. Menu driven demo programs allow to test and analyze the generators with regard to speed and quality of the output.


Shape Parameter Random Number Generator Beta Distribution Hypergeometric Distribution Uniform Random Number 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. Ahrens, J.H. and Dieter, U. (1972): Computer methods for sampling from the exponential and normal distributions, Comm. ACM 15, 873–882.CrossRefGoogle Scholar
  2. Ahrens, J.H. and Dieter, U. (1974): Computer methods for sampling from gamma, beta. Poisson and binomial distributions, Computing 12, 223–246.CrossRefGoogle Scholar
  3. Ahrens, J.H. and Dieter, U. (1982a): Generating gamma variates by a modified rejection technique, Comm. ACM 25, 47–54.CrossRefGoogle Scholar
  4. Ahrens, J.H. and Dieter, U. (1982b): Computer generation of Poisson deviates from modified normal distributions, ACM Trans. Math. Software 8, 163–179.CrossRefGoogle Scholar
  5. Ahrens, J.H. and Dieter, U. (1988): Efficient table-free sampling methods for the exponential, Cauchy and normal distributions, Comm. ACM 31, 1330–1337.CrossRefGoogle Scholar
  6. Ahrens, J.H. and Dieter, U. (1989): An alias method for sampling from the normal distribution, Computing 42, 159–170.CrossRefGoogle Scholar
  7. Ahrens, J.H. and Dieter, U. (1990): A convenient sampling method with bounded computation times for Poisson distributions, Amer. J. Math. Management Sci. 25, in press.Google Scholar
  8. Best, D.J. and Fisher, N.I. (1979): Efficient simulation of the von Mises distribution, Appl. Statist. 28, 152–157.CrossRefGoogle Scholar
  9. Box, G.E.P. and Muller, M.E. (1958): A note on the generation of random normal deviates, Ann. Math. Statist. 29, 610–611.CrossRefGoogle Scholar
  10. Bratley, P., Fox, B.L. and Schrage, L.E. (1987): A Guide to Simulation, 2nd Edition, Springer, New York.Google Scholar
  11. Burr, I.W. (1942): Cumulative frequency functions, Ann. Math. Statist. 13, 215–232.CrossRefGoogle Scholar
  12. Chambers, J.M., Mallows, C.L. and Stuck, B.W. (1976): A method for simulating stable random variables, J. Amer. Statist. Assoc. 71, 340–344; (Correction: J. Amer. Statist. Assoc. 82, (1987), 704).Google Scholar
  13. Cheng, R.C.H. (1977): The generation of gamma variables with non-integral shape parameter, Appl. Statist. 26, 71–75.CrossRefGoogle Scholar
  14. Cheng, R.C.H. (1978): Generating beta variates with nonintegral shape parameters, Comm. ACM 21, 317–322.CrossRefGoogle Scholar
  15. Coveyou, R.R. and MacPherson, R.D. (1967): Fourier analysis of uniform random number generators, J. Assoc. Comput. Mach. 14, 100–119.CrossRefGoogle Scholar
  16. Dagpunar, J. (1988): Principles of Random Variate Generation, Clarendon Press, Oxford.Google Scholar
  17. Devroye, L. (1986): Non-Uniform Random Variate Generation, Springer, New York.Google Scholar
  18. Dieter, U. (1971): Pseudorandom numbers: the exact distribution of pairs, Math. Comp. 25, 855–883.Google Scholar
  19. Johnson, N.L. (1949): Systems of frequency curves generated by methods of translation, Biometrika 36, 149–176.Google Scholar
  20. Kachitvichyanukul, V. and Schmeiser, B.W. (1985): Computer generation of hypergeometric random variates, J. Statist. Comput. Simulation 22, 127–145.CrossRefGoogle Scholar
  21. Kachitvichyanukul, V. and Schmeiser, B.W. (1988a): Binomial random variate generation. Comm. ACM 31, 216–222.CrossRefGoogle Scholar
  22. Kachitvichyanukul, V. and Schmeiser, B.W. (1988b): ALGORITHM 668 H2PEC: Sampling from the hypergeometric distribution, ACM Trans. Math. Software 14, 397–398.CrossRefGoogle Scholar
  23. Kachitvichyanukul, V. and Schmeiser, B.W. (1990): ALGORITHM BTPEC: Sampling from the binomial distribution, ACM Trans. Math. Software 16, to appear.Google Scholar
  24. Kemp, A.W. (1981): Efficient generation of logarithmically distributed pseudo-random variables, Appl. Statist. 30, 249–253.CrossRefGoogle Scholar
  25. Kinderman, A.J. and Monahan, J.F. (1977): Computer generation of random variables using the ratio of uniform deviates, ACM Trans. Math. Software 3, 257–260.CrossRefGoogle Scholar
  26. Kinderman, A.J. and Monahan, J.F. (1980): New methods for generating Student’s t and gamma variables, Computing 25, 369–377.CrossRefGoogle Scholar
  27. Knuth, D.E. (1981): The Art of Computer Programming, Vol. 2: Seminumerical Algorithms, 2nd Edition, Addison Wesley, Reading.Google Scholar
  28. Kremer, R. (1989): C-RAND: Generatoren für nicht-gleichverteilte Zufallszahlen, Diplomarbeit, 152 pp., Techn. Universität Graz.Google Scholar
  29. Lehner, K. (1989): Erzeugung von Zufallszahlen für zwei exotische stetige Verteilungen, Diplomarbeit, 107 pp., Techn. Universität Graz.Google Scholar
  30. Monahan, J.F. (1987): An algorithm for generating chi random variables, ACM Trans. Math. Software 13, 168–172; (Correction: ACM Trans. Math. Software 14 (1988), 111).CrossRefGoogle Scholar
  31. Ramberg, J.S. and Schmeiser, B.W. (1974): An approximate method for generating asymmetric random variables, Comm. ACM 17, 78–82.CrossRefGoogle Scholar
  32. Ripley, B.D. (1987): Stochastic Simulation, John Wiley, New York.CrossRefGoogle Scholar
  33. Stadiober, E. (1989a): Sampling from Poisson, binomial and hypergeometric distributions: ratio of uniforms as a simple and fast alternative, Math. Statist. Sektion 303, 93 pp., Forschungsgesellschaft Joanneum Graz.Google Scholar
  34. Stadiober, E. (1989b): Ratio of uniforms as a convenient method for sampling from classical discrete distributions, Proc. 1989 Winter Simulation Conf., Eds. E. A. MacNair et al., 484–489.CrossRefGoogle Scholar
  35. Stadiober, E. (1990): The ratio of uniforms approach for generating discrete random variables, J. Comput. Appl. Math. 31, 181–189.CrossRefGoogle Scholar
  36. Walker, A.J. (1977): An efficient method for generating discrete random variables with general distributions, ACM Trans. Math. Software 3, 253–256.CrossRefGoogle Scholar
  37. Zechner, H. (1990): Erzeugung gammaverteilter Zufallszahlen mit allgemeinem Formparameter, Grazer Math. Berichte 311, 123 pp., Graz.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  • Ernst Stadlober
    • 1
  • Ralf Kremer
    • 1
  1. 1.Institut für StatistikTechn. Universität GrazGrazAustria

Personalised recommendations