Simulation
Simulation
numeric value
random associated
outcome
experiment with each
outcome
Random Variables
• Random variable summarizes or represents the outcomes
with numerical values
• The realized value of a random variable is random
• To specify a random variable, identify its range of values
and probability assigned to each value
1
0.95 0.975
0.9
0.4
0.1
0 1 2 3 4 5 6
Random Variables
• The pmf/cdf of a random variable X specifies it completely
and
• Solution. Let Xi, i = 1, 2, 3 denote the firm’s profit from job i, then
total profit = X1 + X2 + X3. So E[total profit] = E[X1 + X2 + X3] = E[X1] +
E[X2] + E[X3].
• E[X1] = 10×0.2+0×0.8 = 2; E[X2] = 16 and E[X3] = 12
• E[X1 + X2 + X3] = 2 + 16 + 12 = 30
Expectation of Random Variables
• Example. What is the expected value of the number of times
that in a thoroughly shuffled deck of 52 cards two adjacent
cards are of the same rank (two aces, two kings, etc)?
Expectation of Random Variables
• Example. What is the expected value of the number of times
that in a thoroughly shuffled deck of 52 cards two adjacent
cards are of the same rank (two aces, two kings, etc)?
• In general:
𝐸[𝑓(𝑋)] = 𝑓 𝑥 𝑃 𝑋 = 𝑥 = 𝑓(𝑥)𝑝(𝑥)
𝑥 𝑥
Expectations of Functions of RV
• Often may be interested in expectation of a function of a
random variable
• In general:
𝐸[𝑓(𝑋)] = 𝑓 𝑥 𝑃 𝑋 = 𝑥 = 𝑓(𝑥)𝑝(𝑥)
𝑥 𝑥
• Example. R.v. X has the p.m.f p(2) = 0.2, p(1) = 0.5, p(-1) = 0.3.
Compute E[X2].
Expectations of Functions of RV
• Often may be interested in expectation of a function of a
random variable
• In general:
𝐸[𝑓(𝑋)] = 𝑓 𝑥 𝑃 𝑋 = 𝑥 = 𝑓(𝑥)𝑝(𝑥)
𝑥 𝑥
• Example. R.v. X has the p.m.f p(2) = 0.2, p(1) = 0.5, p(-1) = 0.3.
Compute E[X2].
𝐸[𝑎𝑋 + 𝑏] = 𝑎𝐸[𝑋] + 𝑏
• Variance of a constant is 0
• Useful properties:
– Cov(X, Y) = E[XY] – E[X]E[Y]
– Cov(X, Y) = Cov(Y, X)
– Cov(X, X) = Var(X)
– Cov(aX, Y) = aCov(X, Y)
– Cov(X + Z, Y) = Cov(X, Y) + Cov(Z, Y)
– Var(X + Y) = Var(X) + Var(Y) + 2Cov(X, Y)
Covariance
• Definition: Correlation between X and Y is
Covariance
• If X and Y are independent, Cov(X, Y) = 0, and E[XY] = E[X]E[Y]
𝐸 𝑌 =𝐸 𝐸 𝑌𝑋
2
• Define 𝑉𝑎𝑟 𝑌 𝑋 = 𝐸[ 𝑌 − 𝐸 𝑌 𝑋 |𝑋]. We also have
• E[X]; Var(X)
Bernoulli Random Variables
• A Bernoulli random variable is used to indicate the
success/failure of an event, with a success probability
p; e.g., a coin toss
• Sometimes called Bernoulli trial
• P(X = 1) = p; P(X = 0) = 1-p
1 0
Bernoulli Random Variables
• A Bernoulli random variable is used to indicate the
success/failure of an event, with a success probability
p; e.g., a coin toss
• Sometimes called Bernoulli trial
• P(X = 1) = p; P(X = 0) = 1-p
1 0
• E[X] = p
• Var(X) = p(1 – p)
• Notation: Ber(p)
Binomial Distribution
• Consider n independent repetitions of a Bernoulli trial
with success probability p
• X denotes the number of successes in n trials
𝑛
• Pmf: P(X = k) = p(k) = 𝑘
pk(1-p)n-k, k=0,…,n
Binomial Distribution
• Consider n independent repetitions of a Bernoulli trial
with success probability p
• X denotes the number of successes in n trials
𝑛
• Pmf: P(X = k) = p(k) = 𝑘
pk(1-p)n-k, k=0,…,n
• E[X]=np
• Var(X)=np(1-p)
• Denoted by Bin(n, p)
Geometric Distribution
• X = # of Bernoulli trials with success probability p until
we see a first success
• Pmf: P(X = k) = (1-p)k-1p, k = 1, 2, …
• E[X] = 1/p
• Var(X) = (1-p)/p2
• Denoted by Geo(p)
Geometric Distribution
• Example. Tom and his mom lost each other while wandering
through a crowded amusement park. Their iphones are out
of battery. Tom’s mom, being a wise woman, foresaw this
and made a prior agreement with Tom. Tom will wait at the
entrance of one of the 15 attractions and his mom searches
the attractions in a random order (the “wait-for-mommy”
strategy). What are the expected value and standard
deviation of the number of searches before Tom’s mom finds
him?
Geometric Distribution
• Example. Tom and his mom lost each other while wandering
through a crowded amusement park. Their iphones are out
of battery. Tom’s mom, being a wise woman, foresaw this
and made a prior agreement with Tom. Tom will wait at the
entrance of one of the 15 attractions and his mom searches
the attractions in a random order (the “wait-for-mommy”
strategy). What are the expected value and standard
deviation of the number of searches before Tom’s mom finds
him?
• Suppose now that Tom and his mom agrees that, in intervals
of 10 minutes, they will each pick a random entrance and go
to their chosen entrances. What are the expected value and
standard deviation of the number of searches in this case?
Poisson Distribution
• Poisson r.v. counts the number of occurrences of
interest in a segment of time or space; possible values
are 0, 1, 2, …
• Poisson distribution with parameter λ = np
approximates Bin(n, p) when n is large and p is small;
e.g., number of calls received by an emergency center
• X has a Poisson distribution with parameter λ>0 if its
pmf satisfies
P(X = k) = e-λλk/k!, k = 0, 1, 2, …
• E[X] = Var(X) = λ
• Denoted by Poi(λ)
Uniform Random Variables
• A random variable X is uniformly distributed over [a, b] if its
probability density function (pdf) f(x) is
1/(b-a)
a b
• Denote it by Unif(a, b)
• Used to model a “completely random” selection over the interval
Uniform Random Variables
• Note that this is a valid pdf because
a b
Uniform Random Variables
• Expectation of X ~ Unif(a, b) is
λ=2
λ=1 λ = 0.5
Exponential Random Variables
• Denoted by Exp(λ)
• Often used to model the time till some event (e.g.,
earthquake, phone call, radioactive decay, etc) occurs
• cdf F(x) is given by