The Role of Probability Distributions, Random Numbers & the Computer in Simulations

Instructor: Bob Bruner

Bob is a software professional with 24 years in the industry. He has a bachelor's degree in Geology, and also has extensive experience in the Oil and Gas industry.

Computer simulations are valuable tools used to model complex systems. In this lesson we discuss random numbers and probability distributions in relation to their role in computer simulations.

Making Guesses About the Future

We often rely on our knowledge of the past in order to make accurate predictions about the future. For example, we can measure the height of a 2-year old child today and make an accurate guess about what that child's height will be when they reach maturity, based upon well-established historical growth charts.

When faced with complex problems that involve many different variables, or variables that have a great deal of inherent uncertainty, this type of predictive or deterministic model can be difficult or impossible to construct. In those cases we can use computer simulations to provide a range of possible results for analysis.

Each simulation run is a single output from a computer program that models the system we are studying. By evaluating hundreds or thousands of simulation results, each derived from a separate set of inputs, we obtain added confidence that we have accurately represented both the range and probability of the output data.

The Usefulness of Being Random

In many cases the input data used in a model is best described as coming from a range of valid values. For example, if we need to input data about temperature into a model to predict daily rainfall, that temperature data can have a range of valid values at different times and locations. It is impossible to select one single value of temperature that will honor these possibilities. In these cases, multiple simulations can account for this input variability by making independent selections from the full range of data.

When selecting from the range of values for the simulation process we want the selection to be made randomly, as if by chance, in order to avoid introducing any bias in the input data. Computer simulations rely upon random number selection to achieve this result. A random number is created from, or mapped to, the range of the input data, and that random value is used for one unique simulation run.

Various computational algorithms are available for creating numbers that are effectively randomized. These computational methods create pseudorandom numbers very efficiently and quickly. Most of these pseudorandom number generators create reproducible inputs, which can be beneficial if modeling programs are being calibrated, or need to be rerun with slight adjustments.

Probability Distributions

In using a basic random number generator to select from a range of values, it is important to understand if the actual data being sampled is uniformly distributed. A uniform distribution refers to the situation where all the possible values within the range of the data have an equal frequency of occurrence. In this situation, selecting a random number directly from the range of that distribution represents the input data very accurately.

However, natural phenomena are often not uniformly distributed. Many properties fit the well-known Bell Curve distribution pattern, where values occur most frequently near the middle of the range, with less frequency of occurrence near either end. Human height is a good example of this type of normal distribution pattern. Other properties can show different clustering effects, such as those found in bimodal or logarithmic distributions.

When sampling from these non-uniform distributions, we can use the probability distribution of the input data. Probability distributions show the relative frequency of occurrence in the data, where the total of all the probabilities is normalized; or set to a value of 1. Statistical methods can also be used to create probability distributions that better reflect uncertainty in the measured data.

Probability distributions are most easy to conceptualize in graphical form. In the image below the X-axis reflects the range of possible values of some data, and the Y-axis shows the probability of occurrence of those values. Three different probability distributions, none of which represent a uniform distribution, are shown in this image.

Probability Distribution Functions
Probability Distribution Functions

How can a random selection be made from data that is not uniformly distributed? We can do this by first converting the normalized probability distribution function into a cumulative distribution function. The cumulative distribution is an integration of the probability distribution data, with each value being summed across the X-axis. The cumulative distribution values will start at 0 and end at 1.

To unlock this lesson you must be a Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use

Become a member and start learning now.
Become a Member  Back
What teachers are saying about
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account