BU275 Lecture Notes - Lecture 11: Pseudorandom Number Generator, Discrete Uniform Distribution, Random Variable
BU-75 Lecture
Computer Simulation
• Problem: Simulating Demand
In the past, a small computer store typically sells between 0 to 4 laptops a day
Data from the past 100 days:
Sales
Frequency
Probability
0
20
0.2
1
40
0.4
2
20
0.2
3
10
0.1
4
10
0.1
• We can use simulation to answer questions about systems, like:
o What is the average daily sales?
o What is the probability of selling more than 10 laptops in 5 days?
• To run a Simulation, we need random numbers
o Ways to generate random numbers:
▪ Physical tool, dice
▪ Random # tables
▪ Pseudo-random number generator
• We can generate a random number (RN) between 0 and 99 by spinning a roulette wheel
o We can then map that RN to any random variable X using the right function or mapping
table
o Let’s start with the empirical distribution (from data)
Sales
Probability
Cumulative
Probability
MAP
0
0.2
0.2
0-0.2
1
0.4
0.6
0.2-0.6
2
0.2
0.8
0.6-0.8
3
0.1
0.9
0.8-0.9
4
0.1
1.0
0.9-1.0
• Any random number generated on the wheel, can be mapped to a random variable X, that
represents sales on a random day
o 0.98 Would be 4 sales on the MAP
o 0.25 would be 1 sale on the MAP
• The more simulations we run, the more accurate the results will be
• More Introductory Distributions:
o Discrete Uniform
▪ The number of customers at a small mechanic is a random variable with a
discrete uniform distribution between 5 and 13
find more resources at oneclass.com
find more resources at oneclass.com