Vous êtes sur la page 1sur 42

Das Bild kann zurzeit nicht angezeigt werden.


Campus Duisburg

Prof. Dr.-Ing. Bernd Noche

Rechnergesttzte Netzanalysen
ehem.: Simulation in Logistics g II

Probability and Statistics in Simulation

Lecturer: Prof. Dr.-Ing. Bernd Noche



Rechnergesttzte Netzanalysen

Probability and Statistics

Design the simulation experiments Perform statistic analyses of the simulation output data

Model a probabilistic system

Probability and statistics

Generate random samples from the input distribution

Validate the simulation model d l


Choose the input probabilistic di t ib ti distribution

Rechnergesttzte Netzanalysen 2

Useful Statistical Models

1 1. Queueing Q i System: S t i t interarrival i l times ti and d the th service i times. ti Exponential distribution, Weibull distribution, and gamma distribution, normal distribution. 2. Inventory System: the number of units demanded per order or per time period, the time between placing an order, and the lead time. Geometric, Poisson, and negative binomial distribution provide a range of distribution shapes that satisfy a variety of demand patterns. The lead time distribution can often be fitted fairly well by a gamma distribution. 3. Reliability and Maintainability: time to failure, time to repair . Time to failure has been modeled with exponential, gamma and Weibull distribution. 4. Limited Data: in many instances simulations begin before data collection has been completed. Uniform triangular, Uniform, triangular and beta distribution. distribution
06.11.2013 Rechnergesttzte Netzanalysen 3

Random Variables and Probability y Distributions Random Variable (RV) Discrete Random Variable
A real number assigned to each outcome of an experiment in the sample space Can only take a finite or a countable infinite set of values e.g., hit or miss {0 or 1}, Flip a coin of shooting a basketball, outcome of throwing a dart {1, 2, , 20} number of customers waiting in a queue 20}, Simulate Monte Carlo: throw a dice {1, 2, 3, 4, 5, 6}, a pair of dices {2, 3, 4, , 10, 11, 12} Can take on a continuum of values (infinite) e.g., customer interarrival time
Rechnergesttzte Netzanalysen 4

Continuous Random Variable


Discrete Random Variables


Rechnergesttzte Netzanalysen

Discrete Random Variables

Restrictions/Conditions / 0 p(xi) 1 for all i (all i) p( p(xi) = 1 certain outcome Alternative representation for the probability distribution is the cumulativedistribution function (CDF) (Verteilungsfunktion), F(x) Definition: F(x) = P(X x) relative to probability mass function: F(x) = (xi x) p(xi) Properties of F(x): (1) 0 F(x) 1 (2) F( ) = 0 (3) F( ) = 1
06.11.2013 Rechnergesttzte Netzanalysen 6

Discrete Random Variables

Ex: S = {0, 1, 2, 3} four possible outcomes p(0) = 1/8 p(1) = 3/8 p(2) = 3/8 p(3) = 1/8 (i = 0 to 3) p(xi) = 1/8 + 3/8 + 3/8 + 1/8 = 1
p(Xi) 1 3/4 1/2 1/4 Xi F(Xi) 1 3/4 1/2 1/4 0.500 1 0.125 0 1 2 3 Xi 0 1.000 0.875 2


Rechnergesttzte Netzanalysen

Continuous Random Variables

Probability density function (pdf)(Dichtefunktion), f(x) D fi iti Definition: P( X b) = P(a f( ) dx d (from a to b) f(x) Conditions: f(x) (1) f(x) 0 and ( 2 ) (f (from to t ) f(x) dx = 1
a ( ) f(x)

x b P(a X b)

Cumulative distribution function (cdf), F(x) Definition: F(x) = (from to x) f(y) dy = P(X x) Defines the probability that the continuous random variable X assuming a value less than or equal to x 8 06.11.2013 Rechnergesttzte Netzanalysen

Continuous Random Variables

Ex: RN RNs s with uncountable infinite number of possible continuous values between 0 and 1 and equal probability
f (X) UNFRM (0,1)
P (0.50 X 0.75) =

F (X)



1 dX = 0.25


0.5 0.75 pdf

X cdf


Rechnergesttzte Netzanalysen

Discrete and Continuous Random Variables bl Mixed d Distribution b

Ex: Value 1 - 1/3 probability Value 2 - 1/3 probability Between 1 and 2 - 1/3 probability
F (X) 1/3 1/3 1 2/3 1/3 X 1.00 0 67 0.67 (1,2) 1/3 0.33 1 0 1 2 0 0
06.11.2013 Rechnergesttzte Netzanalysen

f (X) 1 2/3

p(1) = 1/3 p(2) = 1/3 p(1x2) = 1/3 = 1

X 2

1/3 + (x-1)/3 ( 1)/3

X 1

Expectation p and Moments

Used to characterize probability distribution functions The Expectation (expected value) of a random variable when x is discrete x E[x]: x, E[x] = (all i) xi p(xi)
E[x] = (all x) x f(x)dx when x is continuous when x is discrete when h x is continuous

In I general, l can be b a function f ti of fx

E[xn] = (all i) xin p(xi) n f( )d E[x [ n] = (all x) x f(x)dx

The expectation of xn is defined as the nth moment of a random d variable i bl Expected value is a special case when n = 1, it is thus called the first moment the mean (Erwartungswert/Mittelwert)
06.11.2013 Rechnergesttzte Netzanalysen 11

Expectation and Moments

A variant of the nth moment is the nth moment of a random variable about the mean E[(x E[x])n] Important: the second moment about the mean E[(x E[x])2] = 2 = Var[x] where the variance (Varianz) of x Var[x] = measures of the spread of probability distribution = standard deviation (Standardabweichung) of the random d variable i bl
06.11.2013 Rechnergesttzte Netzanalysen 12

Expectation and Moments

Other higher order of moments - measures of probability of distributions Skewness (Schiefe) - measures if the distribution is symmetric
Mode Median Mean

Skewed Positively

Skewed Negatively

Kurtosis (Wlbung) - measures flatness or peakedness

Flat (with short broad tails) Peaked long thin tails


Rechnergesttzte Netzanalysen


For two random variables x and y:
Cov[x, y] = E[(x E[x]) (y E[y])] Measures the linear association between x and y
Causal relationship x and y are independent if Cov[x, Cov[x y] = 0 Formally, p(y|x) = p(y) for discrete f (y|x) ( | ) = f (y) ( ) for f continuous ti

Measure of dependence correlation coefficient,


Cov[ x, y ] Var[ x ] Var[ y ]


Rechnergesttzte Netzanalysen


Functions of Random Variables and Th i Properties Their P ti

Properties for Expectation of functions of RV
E[x + y] = E[x] + E[y] E[kx] = kE[x] E[x + k] = E[x] + k where here k is an arbitrary arbitrar constant x + y is a RV kx is a RV x + k is a RV

Properties for Variances

Var[x + y] = Var[x] + Var[y] + 2Cov[x, y] If x, y are independent, Var[x + y] = Var[x] + Var[y] Var[kx] = k2 Var[x] Var[x + k] = Var[x] Var[kx + ny] = k2 Var[x] + n2 Var[y] + 2kn Cov[x, y]
06.11.2013 Rechnergesttzte Netzanalysen 15

Random Variables


Rechnergesttzte Netzanalysen


Discrete Random Variable

Example :Constant
100 3s

Constant No uncertainty Degenerate D t case No variation (sd = 0)

100 trials ti l
06.11.2013 Rechnergesttzte Netzanalysen 17

Bernoulli Trial and Distribution

Consider an experiment consisting of n trials, each can be b a success or a failure. f il
Xj = 1 if the jth experiment is a success Xj = 0 if the jth experiment is a failure

The Bernoulli distribution (one trial): p, x j = 1, j = 1,2,..., n 1 p = q, x j = 0 ,j = 1,2 ,...,n p j ( x j ) = p( x j ) = 0, otherwise


Jacob Bernoulli (16541705)

where E(Xj) = p and V(Xj) = p (1p) = p q


Rechnergesttzte Netzanalysen


Binomial Distribution
Let N = # trials, p = p probability y of each success trial

Example: N=7, p=0.5 X = # of success SSSFSSF X=5 FFSFSSS X=4 SSFSFSF X=4 ...etc. t

The mean, E(x) = p + p + + p = np The variance, V(X) = pq + pq + + pq = npq

06.11.2013 Rechnergesttzte Netzanalysen 20 1 9

Binomial Distribution Example

A production d ti process manufactures f t machines hi on the th average at t 2% nonconforming. Every day a random sample of size 50 is taken from the process. If the sample contains more than 2 nonconforming machines , the process will be stopped. stopped Question: what is the probability that the process is stopped by the sampling scheme? Solution: P(X > 2) = 1 P( X 2) the probability P(X 2) is calculated from: P( X 2) = 0.92 Thus, the probability that the production process is stopped on any day, based on the sampling process, process is ca. ca 0.08. 0 08 the mean number of nonconforming and variance machines in a random sample of size 50 is: E(X) = np = 50(0.02) 50(0 02) = 1, 1 V(X) = npq = 50(0.02)(0.98) 50(0 02)(0 98) = 0.98 0 98
06.11.2013 Rechnergesttzte Netzanalysen 20

Geometric Distribution
The geometric Th t i distribution di t ib ti is i related l t d to t a sequence of f Bernoulli B lli trials; t i l the th random d variable of interest , X, is defined to be the number of trials to achieve the first success. The distribution of X is given by

p(x) = qx1p, x = 1, 2,
the event {X = 0} occurs when there are x 1 failures followed by a success. Each of the failures has an associated probability of q = 1 p, and each success has a probability p. Thus, P(FFFFS) = qx1p the mean and variance are given by E(X) = 1/p 1/ and V(X) = q/P
06.11.2013 Rechnergesttzte Netzanalysen 21

Geometric Distribution Example

Forty percent of f the h assembled bl d machines h are rejected d at the h inspection station. Question Q ti : Find Fi d the th probability b bilit that th t the th first fi t acceptable t bl machines is the third one inspected. Solution: consider each inspection as a Bernoulli trial with q = 0.4 and p = 0.6, 06 P(3) = 0.4(0.6) = 0.096 thus in only about 10% of the cases is the first acceptable thus, machines the third one from any arbitrary starting point.


Rechnergesttzte Netzanalysen


Poisson Distribution
Gives (probability of) the number of events that occur in a given period Formula looks quite complicated (and NOT discrete), but it is discrete and using it is not that difficult

e - x p(x) = x! 0
Poisson (Simon Denis, Fr. 17811840 )
Das Bild kann zurzeit nicht angezeigt werden.

X {0,1,...,t} otherwise

Where is the mean arrival rate. Note that must be positive E(X) = V(X) = Applications of Poisson Distribution Discrete distribution, used to model the number of independent events occuring per unit time, E Batch Eg. B h sizes i of f customers and d items i If the time betweeen successive events is exponential, then the number of events in a fixed time interval is poisson.


Rechnergesttzte Netzanalysen


Poisson Distribution Example

A drilling d illi machine hi repairman i i called is ll d each h time ti th there i a call is ll for f service. i The Th number of calls per hour is known to occur in accordance with a Poisson distribution with a mean of 2 per hour . Question i : The h probability b bili of f three h calls ll in i the h next hour? h ? Solution: p(3) = e22 /3! = (0.135)(8)/6 = 0.18

Question: determine the probability of two or more calls in period. P( ( 2 or more) )=? one hour p
Rechnergesttzte Netzanalysen 24


Bernoulli Relatives



06.11.2013 Rechnergesttzte Netzanalysen 25

Random Variables


Rechnergesttzte Netzanalysen


Uniform Distribution
A random variable X is uniformly distributed on the interval (a,b), U(a,b), if its pdf and cdf are:

1 , a x b f ( x) = b 0, otherwise a
0, x a x , a x b F ( x) = ab a x b 1,
E(X) = (a+b)/2 V(X) = (ba)2/12

The uniform distribution plays a vital role in simulation. Random numbers, uniformly distributed between 0 and 1, provide the means to generate random events.
Rechnergesttzte Netzanalysen 27


Uniform Distribution
The Bus 933 arrives every 15 minutes at the terminal MArea beginning at 6:50 P .M. until 7:50 P .M. A certain passenger does not know the schedule and arrives randomly (uniformly distributed) between 7:00 P .M. and 7:30 P .M. every Wednesday evening. What is the probability that he waits more than 5 minutes for a bus? The probability is P(5 < x < 15) + P(20 < x < 30) X is uniform random variable on (0,30). The desired probability is given by F(15) F(5) + F(30) F(20) = 15/30 5/30 + 1 20/30 = 2/3
06.11.2013 Rechnergesttzte Netzanalysen 30 2 8

Exponential Distribution
exponential p

F(x) = f(y)dy = e y dy = 1 e x 0 0 . 1 E[X ] = ; Var(X ) = 1 . 2

Applications of Exponential Distribution: Used to model time between independent events like arrivals or breakdowns. events,like breakdowns model service times that are highly variable. Inappropriate for modeling process delay times times.

Exponential Memoryless property: P{X > s + t|X > t}= P{X > s} t,s 0.
06.11.2013 Rechnergesttzte Netzanalysen 29

Example of the use of the memoryless property of Exponential Distribution A queueing system has two servers. The service times are assumed to be exponentially distributed (with the same parameter). Upon arrival of a customer () both servers are occupied () but there are no other waiting customers. customers


Rechnergesttzte Netzanalysen


Exponential Distribution Example

The life Th lif of f a light li ht bulb b lb is i given i b X, by X which hi h is i said id to t have h an exponential ti l distribution with mean 2 years. Its pdf is shown below:

Question: whats the probability that the life of the light bulb is between 2 and 3 years? Solution:

Question: What is the probability that it lasts for another year if it has already
being operating for 2.5 2 5 years?


Rechnergesttzte Netzanalysen


Erlang Distribution
Agner Krarup Erlang

The Erlang distribution is the distribution of the sum of k independent identically distributed random variables each having an exponential distribution. Events which occur independently with some average rate are modeled with a Poisson process. The waiting times between k occurrences of the event are Erlang distributed. PDF: CDF: the shape k, which is a nonnegative integer, and the rate , which is anon negative real number .
Rechnergesttzte Netzanalysen 32


Erlang Distribution Example

A welding ldi machine hi has h two t welding ldi heads. h d The Th welding ldi heads h d will ill switch it h the th current to the second welding head if the first fails. The life expectancy of the welding heads is exponentially distributed with average life 1000 hours. Question i : What h is i the h probability b bili that h the h machine hi still ill works k after f 90 days. d The probability that the system will still operate at least x hours is called the reliability function R(x), where R(x) = 1 F(x) Solution: the total system lifetime is given k = 2 welding head, and = 1/1000. F(2160) = 0.636 0 636 therefore, the chances are about 36% that the machine still works after 90 days.


Rechnergesttzte Netzanalysen


Normal Distribution
Johann Carl Friedrich Gauss


E[X]= , Var(X)= 2 .

Normal Canonical: C i l mean = 0, 0 = 1. 1 f(-x)=f(+x); the pdf is symmetric about . The maximum value of the pdf occurs at x = . bellshaped curve symmetric about its mean . Shape determined by its standard deviation .
06.11.2013 Rechnergesttzte Netzanalysen 34

Normal Distribution
T Transformation f ti of f variables: i bl let l t Z = (X ) / ,


Rechnergesttzte Netzanalysen


Normal Distribution
The time Th i required i d to load l d an oceangoing i vessel, l X, X is i distributed di ib d as N(12,4). Question: What is the p probability y that the vessel is loaded in less than 10 hours? Solution:


Rechnergesttzte Netzanalysen


Weibull distribution
The random variable X with probability density function
1 x x f ( x) = p exp
Waloddi Weibull 18 June 188712 October 1979

for x > 0 i a Weibul is W ib l random d variable i bl with ith scale parameter > 0 and shape parameter > 0. p By inspecting the probability density function, it is seen that when h = 1, 1 the th Weibull W ib ll distribution is identical to the p distribution. exponential

The effect of the Weibull shape parameter on the pdf.

39 Netzanalysen Rechnergesttzte

3 Rechnergesttzte Netzanalysen 7

Weibull distribution
Weibul distribution is often used to model the time until failure of many different physical systems. Distribution parameters provide a great deal of flexibility to model systems in which the number of failures: Increases with h time (e.g., ( b bearing wear). ) Decreases with time (some semiconductors). Remains constant (failures caused by external shocks h k to the h system). ) with < 1 exhibit a failure rate that decreases with time,with = 1 have a constant failure rate (consistent with the exponential distribution) and populations with > 1 have a failure rate that increases with time. time
49 Netzanalysen Rechnergesttzte

The effect of on the Weibull failure rate function.


3 Rechnergesttzte Netzanalysen 8

Weibull distribution


41 Netzanalysen Rechnergesttzte

3 Rechnergesttzte Netzanalysen 9

Weibull distribution Example

The h time to failure f l f a electronic for l d device is known k h have a Weibull distribution with = 1/3, and = 200 hours (time measured in use hours). hours) Question: what is the mean time to failure of this device? What is the probability that it fails before 2000 hours? Solution: E(X) = 200(3+1) = 200(3!) = 1200 hours F(2000) = 1 exp[ (2000/200) ] = 0.884
06.11.2013 Rechnergesttzte Netzanalysen 40

Empirical Distributions
A distribution whose parameters are the observed values in a sample of data.
May be used when it is impossible or unnecessary to establish that a random variable has any particular parametric distribution Advantage: no assumption beyond the observed values in the sample. Disadvantage: Di d t sample l might i ht not t cover the th entire ti range of possible values.
06.11.2013 Rechnergesttzte Netzanalysen 41

The world that the simulation analyst sees is probabilistic, not deterministic. Reviewed several important probability distributions and Showed applications of the probability distributions in a simulation context. Difference between discrete, , continuous, , and empirical distributions.
06.11.2013 Rechnergesttzte Netzanalysen 42