Computer Science, Informatik 4 Communication and Distributed Systems
Simulation
“Discrete-Event System Simulation”
- Dr. Mesut Güneş
Simulation Discrete-Event System Simulation Dr. Mesut Gne Computer - - PowerPoint PPT Presentation
Computer Science, Informatik 4 Communication and Distributed Systems Simulation Discrete-Event System Simulation Dr. Mesut Gne Computer Science, Informatik 4 Communication and Distributed Systems Chapter 4 Statistical Models in
Computer Science, Informatik 4 Communication and Distributed Systems
Computer Science, Informatik 4 Communication and Distributed Systems
Statistical Models in Simulation
Computer Science, Informatik 4 Communication and Distributed Systems 3 Chapter 4. Statistical Models in Simulation
Computer Science, Informatik 4 Communication and Distributed Systems 4 Chapter 4. Statistical Models in Simulation
Computer Science, Informatik 4 Communication and Distributed Systems 5 Chapter 4. Statistical Models in Simulation
Rx = possible values of X (range space of X) = {0,1,2,…} p(xi) = probability the random variable X is xi , p(xi) = P(X = xi)
distribution of X, and p(xi) is called the probability mass function (pmf) of X.
∞ =
1
i i i
Computer Science, Informatik 4 Communication and Distributed Systems 6 Chapter 4. Statistical Models in Simulation
a collection of intervals.
X R X
X
b a
x x
Computer Science, Informatik 4 Communication and Distributed Systems 7 Chapter 4. Statistical Models in Simulation
−
2 / x
3 2 2 /
−
x
Lifetime in Year
Computer Science, Informatik 4 Communication and Distributed Systems 8 Chapter 4. Statistical Models in Simulation
F(x) = P(X ≤ x)
≤
=
x x i
i
x p x F ) ( ) (
−
x
) ( lim 3. 1 ) ( lim 2. ) ( ) ( then , If function. ing nondecreas is 1. = = ≤ ≤
−∞ → ∞ →
x F x F b F a F b a F
x x
Computer Science, Informatik 4 Communication and Distributed Systems 9 Chapter 4. Statistical Models in Simulation
2 / 2 /
x x t
− −
1 =
−
1 ) 2 / 3 (
− −
Computer Science, Informatik 4 Communication and Distributed Systems 10 Chapter 4. Statistical Models in Simulation
V(X) = E( (X – E[X])2 )
V(X) = E(X2) – ( E(x) )2
mean
=
i i i
x p x x E
all
) ( ) (
∞ ∞ −
⋅ = dx x f x x E ) ( ) (
) (x V = σ
Computer Science, Informatik 4 Communication and Distributed Systems 11 Chapter 4. Statistical Models in Simulation
2 / 2 /
∞ − ∞ ∞ −
x x
2 / 2 / 2 2
∞ − ∞ ∞ −
x x
2
Computer Science, Informatik 4 Communication and Distributed Systems 12 Chapter 4. Statistical Models in Simulation
2 / 2 /
∞ − ∞ ∞ −
x x
) ) 2 ( 1 ) 2 ( ( 2 1 2 1 ) ( 2 ) ( 1 ) ( ' ) ( ' ) ( Set ) ( ) ( ' ) ( ) ( ) ( ' ) ( n Integratio Partial 2 2 / 2 1 ) (
2 / 2 / 2 / 2 / 2 / 2 / 2 /
dx e e x dx xe X E e x v x u e x v x x u dx x v x u x v x u dx x v x u dx e x dx xe X E
x x x x x x x
− ∞ ∞ − ∞ − − − ∞ − ∞ ∞ −
− ⋅ − − ⋅ = = − = = ⇒ = = − = = + − = =
Computer Science, Informatik 4 Communication and Distributed Systems 13 Chapter 4. Statistical Models in Simulation
Computer Science, Informatik 4 Communication and Distributed Systems 14 Chapter 4. Statistical Models in Simulation
(either positive or negative)
restricted value.
(involving location of the modes of pdf’s and the shapes of tails.)
Computer Science, Informatik 4 Communication and Distributed Systems 15 Chapter 4. Statistical Models in Simulation
demands).
has occurred.
Computer Science, Informatik 4 Communication and Distributed Systems 16 Chapter 4. Statistical Models in Simulation
Computer Science, Informatik 4 Communication and Distributed Systems 17 Chapter 4. Statistical Models in Simulation
Computer Science, Informatik 4 Communication and Distributed Systems 18 Chapter 4. Statistical Models in Simulation
Computer Science, Informatik 4 Communication and Distributed Systems 19 Chapter 4. Statistical Models in Simulation
a failure.
p(x1,x2,…, xn) = p1(x1)p2(x2) … pn(xn)
j j j j j
Computer Science, Informatik 4 Communication and Distributed Systems 20 Chapter 4. Statistical Models in Simulation
The number of
required number of successes and failures Probability that there are x successes and (n-x) failures
−
x n x
Computer Science, Informatik 4 Communication and Distributed Systems 21 Chapter 4. Statistical Models in Simulation
−
1
x
Computer Science, Informatik 4 Communication and Distributed Systems 22 Chapter 4. Statistical Models in Simulation
−
k k y
{
success th successes 1 1
1 1 ) (
− − −
⋅ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ − − =
k ) (k- k k y
p p q k y x p 4 4 3 4 4 2 1
Computer Science, Informatik 4 Communication and Distributed Systems 23 Chapter 4. Statistical Models in Simulation
−
x α
= −
x i i
α
Computer Science, Informatik 4 Communication and Distributed Systems 24 Chapter 4. Statistical Models in Simulation
p(3) = 23/3! e-2 = 0.18 also, p(3) = F(3) – F(2) = 0.857-0.677=0.18
p(2 or more) = 1 – ( p(0) + p(1) ) = 1 – F(1) = 0.594
Computer Science, Informatik 4 Communication and Distributed Systems 25 Chapter 4. Statistical Models in Simulation
Computer Science, Informatik 4 Communication and Distributed Systems 26 Chapter 4. Statistical Models in Simulation
[F(x2) – F(x1) = (x2-x1)/(b-a)]
V(X) = (b-a)2/12
Computer Science, Informatik 4 Communication and Distributed Systems 27 Chapter 4. Statistical Models in Simulation
−
x λ
⎪ ⎩ ⎪ ⎨ ⎧ ≥ − = < = ∫
− −
, 1 0, ) ( x e dt e x x F
x x t λ λ
λ
Computer Science, Informatik 4 Communication and Distributed Systems 28 Chapter 4. Statistical Models in Simulation
times when arrivals are completely random, and to model service times that are highly variable
exponential pdf’s (see figure), the value of intercept on the vertical axis is λ, and all pdf’s eventually intersect.
Computer Science, Informatik 4 Communication and Distributed Systems 29 Chapter 4. Statistical Models in Simulation
P(X > 3) = 1-(1-e-3/3) = e-1 = 0.368
P(2 <= X <= 3) = F(3) – F(2) = 0.145
2.5 hours:
P(X > 3.5 | X > 2.5) = P(X > 1) = e-1/3 = 0.717
Computer Science, Informatik 4 Communication and Distributed Systems 30 Chapter 4. Statistical Models in Simulation
) (
t s t s
− − + − λ λ λ
Computer Science, Informatik 4 Communication and Distributed Systems 31 Chapter 4. Statistical Models in Simulation
⎪ ⎩ ⎪ ⎨ ⎧ ≥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎣ ⎡ ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ − − ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ − =
−
, , exp ) (
1
ν α ν α ν α β
β β
x x x x f
) ( ∞ < < −∞ ν
Computer Science, Informatik 4 Communication and Distributed Systems 32 Chapter 4. Statistical Models in Simulation
−
1
β β
−
1
α
x
When β = 1, X ~ exp(λ = 1/α)
Computer Science, Informatik 4 Communication and Distributed Systems 33 Chapter 4. Statistical Models in Simulation
equal. ) ( lim and , ) ( lim = =
∞ → −∞ →
x f x f
x x
2
2 >
Computer Science, Informatik 4 Communication and Distributed Systems 34 Chapter 4. Statistical Models in Simulation
Z ~ N(0,1)
− −
= Φ
z t
dt e z
2 /
2
2 1 ) ( where , π
/ ) ( / ) ( 2 /
2
σ µ σ µ σ µ
− − ∞ − − ∞ − −
x x x z
Computer Science, Informatik 4 Communication and Distributed Systems 35 Chapter 4. Statistical Models in Simulation
Computer Science, Informatik 4 Communication and Distributed Systems 36 Chapter 4. Statistical Models in Simulation
random variable X
⎪ ⎩ ⎪ ⎨ ⎧ > ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ − − =
0, , 2 ln exp 2 1 ) (
2 2
x σ µ x σx π x f
µ=1, σ2=0.5,1,2.
Computer Science, Informatik 4 Communication and Distributed Systems 37 Chapter 4. Statistical Models in Simulation
Poisson-distributed with mean λ(t-s)
−
t n λ
Computer Science, Informatik 4 Communication and Distributed Systems 38 Chapter 4. Statistical Models in Simulation
Stationary & Independent Memoryless
Ai is the elapsed time between arrival i and arrival i+1
hence: P(A1 > t) = P(N(t) = 0) = e-λt P(A1 <= t) = 1 – e-λt [cdf of exp(λ)]
mean 1/λ Arrival counts ~ Poisson(λ) Interarrival time ~ Exp(1/λ)
Computer Science, Informatik 4 Communication and Distributed Systems 39 Chapter 4. Statistical Models in Simulation
with probability p and Type II, with probability 1-p.
with rates λp and λ(1-p)
N(t) ~ Poisson(λ) N1(t) ~ Poisson[λp] N2(t) ~ Poisson[λ(1-p)] λ λp λ(1-p) N(t) ~ Poisson(λ1 + λ2) N1(t) ~ Poisson[λ1] N2(t) ~ Poisson[λ2] λ1 + λ2 λ1 λ2
Computer Science, Informatik 4 Communication and Distributed Systems 40 Chapter 4. Statistical Models in Simulation
random variable has any particular parametric distribution.
Computer Science, Informatik 4 Communication and Distributed Systems 41 Chapter 4. Statistical Models in Simulation