
CAP 4800/5805 Computer Simulation Concepts
Lecture 6
Random variables
• Probabilistic measures are important to simulation since it is often possible to define
the frequency associated with some dynamical process.
• A random variable can have a range of possible values where a value is called a
random number (RN)
• RN is obtained by sampling the distribution that defines the random variable.
• Discrete or Continuous
• A random variable differs from a variable
Operation Variable Random variable
get X Æ value Sample X Æ value
store X Å value X Å function with value range
- get: obtain the value of a variable
- store: put a new value into a variable
Generation random numbers (RN)
• Uniform distribution: a probability distribution function that is flat or constant
across the range of values that a random variable will assume.
• For instance, to generate random numbers in the range [0,1) for a uniform
distribution function, we would expect any number in [0,1) to be likely as any other
number when a number is picked
• If we know how to generate random numbers u ∈ [0,1) and we desire a uniform
random distribution between A and B, we can generate y from u by the following
y = A + (B – A) u, where y ∈ [A,B) and u ∈ [0,1)