Justin R. Caram
Department of Materials Science and Engineering, University of California, USA
Publications
-
Research Article
A Simple Algorithm for Converting Random Number Generator Outputs to Universal Distributions to Aid Teaching and Research in Modern Physical Chemistry
Author(s): Barry Y. Li*, Tim Duong, Daniel Neuhauser, Anastassia N. Alexandrova and Justin R. Caram
Molecules and materials often display distributed heterogeneous properties. Modeling the behavior of a single molecule with these properties (e.g. via Monte-Carlo simulations) requires a rapid way to sample distributions of interest and describe how they evolve. Here, we pedagogically introduce a simple algorithm that converts evenly distributed random number generator outputs to any defined probability density function (PDF) called the Random Number Converter (RNC). We demonstrate a numerical approach to obtain cumulative distribution functions (CDFs) and utilize a binary search algorithm to circumvent the need for analytical inverse CDFs. This simple method is demonstrated for various distributions, including single-exponential and Gaussian distributions and non-standard PDFs, for which neither the CDF nor its inverse are analytically solvable. We then apply this algorithm to the ra.. Read More»
