Skip to main content Accessibility help
×
Hostname: page-component-76fb5796d-vvkck Total loading time: 0 Render date: 2024-04-26T00:30:58.422Z Has data issue: false hasContentIssue false

4 - Generating Random Variables for Simulation

from II - Necessary Probability Background

Published online by Cambridge University Press:  05 February 2013

Mor Harchol-Balter
Affiliation:
Carnegie Mellon University, Pennsylvania
Get access

Summary

In Chapter 3 we reviewed the most common discrete and continuous random variables. This chapter shows how we can use the density function or cumulative distribution function for a distribution to generate instances of that distribution. For example, we might have a system in which the interarrival times of jobs are well modeled by an Exponential distribution and the job sizes (service requirements) are well modeled by a Normal distribution. To simulate the system, we need to be able to generate instances of Exponential and Normal random variables. This chapter reviews the two basic methods used in generating random variables. Both these methods assume that we already have a generator of Uniform(0,1) random variables, as is provided by most operating systems.

Inverse-Transform Method

This method assumes that (i) we know the c.d.f. (cumulative distribution function), Fx (x) = P{X ± x}, of the random variable X that we are trying to generate, and (ii) that this distribution is easily invertible, namely that we can get x from FX (x).

The Continuous Case

Idea: We would like to map each instance of a uniform r.v. generated by our operating system – that is, uU (0, 1) – to some x, which is an instance of the random variable X, where X has c.d.f. FX. We assume WLOG that X ranges from 0 to ∞. Let's suppose there is some mapping that takes each u and assigns it a unique x. Such a mapping is illustrated by g-1(·) in Figure 4.1.

Type
Chapter
Information
Performance Modeling and Design of Computer Systems
Queueing Theory in Action
, pp. 70 - 78
Publisher: Cambridge University Press
Print publication year: 2013

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×