You are on page 1of 33

CIV 1540

Urban Operations Research

Probabilistic Modelling
Experiment: Stick Cutting
1m

 Mark 2 points x1 and x2 on a one-metre stick in some


non-deterministic way (e.g. blind fold a person and have
him/her mark the stick twice using chalk)

0 x1 x2 1

 Cut the stick into 3 pieces at the points x1 and x2


 Repeat the experiment many times
 How often can the three pieces form a triangle? 2
Solution
 Note that every time you do the experiment, x1 and x2 will each
have a random value between 0 and 1
 Define the following “Random Variables” (in capital letters)
 X1: location of first mark
 X2: location of second mark
 Define the joint “Sample Space” of all possible combinations of
X1 and X2 values as the square in the graph below
 Each point within the square represents a possible outcome of the
experiment
X2
1

0 1 X1
Solution (cont’d)
 For the 3 pieces to form a triangle, no single piece can be too long
 Specifically each piece must be shorter than 0.5 m

 In general, X1 could be less than X2 (i.e. the first mark is to the left of
the second mark) or the opposite

 If X1 < X2, then a triangle can be formed if the experiment outcome


meets the 3 conditions
 X1 < 0.5 X2

 X2 – X1 < 0.5 1

 1 – X2 < 0.5
0.5
1m

x2 4
X1
x1 0 0.5 1
Solution (cont’d)
 If X1 > X2, then a triangle can be formed if the experiment outcome
meets the 3 conditions:
 X2 < 0.5
 X1 – X2 < 0.5
 1 – X1 < 0.5 X2
1

0.5

0 0.5 1 X1

1m

x1
5
x2
Solution (cont’d)
 Therefore, the shaded areas below represent all possible outcomes
of the experiment when the 3 pieces of the stick can form a triangle.
X2
1

0.5

0 0.5 1 X1

 Since each point in the square has equal likelihood to be the


outcome of the experiment (since the marks are selected randomly),
the ratio of the shaded area to the total area of the square represents
the percentage of trials when we can form a triangle or the
“probability” of forming a triangle (=0.25) 6
Events
 An event is defined as a collection of points in the sample space,
each point representing a possible experimental outcome
 A and B are 2 events X2

 The entire sample space (square)


is the “universal event”, U A
B
 An event with no points in the
sample space is called the “empty
event”, Ø
X1

 Algebraic operators of events


 Union: A  B = set of all points in either A or B (or both)
 Intersection: A  B = set of all points in both A and B
 Complement: A’ = set of all points in U outside of A

7
Events (cont’d)
 Two events A and B are said to be “mutually exclusive”
if they share no points in common
 AB=Ø

 Events A, B, C,…… are said to be “collectively exhaustive” if they


include all points in the sample space
 A  B  C  …… = U

 Event probability
 P{A} is the probability that the experiment outcome lies within
event A
 Three axioms of probability
 0  P{A}  1
 P{U} = 1
 If A  B = Ø, P{A U B} = P{A} + P{B} 8
Random Variables
 A RV represents the outcomes of a non-deterministic
experiment (e.g. flipping a coin)

 Each RV has a set (or range) of possible values, called its


“sample space” (the textbook uses “event space”)

 Two types of random variables


 Discrete RV, integer values
 sample space contains a finite or countably infinite number of values
 e.g. Class size at U of T
 Continuous RV, real values
 sample space contains a non-countably infinite number of values
 e.g. location of mark in the stick cutting example 9
Discrete Random Variables
 Suppose you go to a particular bus stop everyday at the same time and
count the passengers waiting for the bus. Define a random variable Y as
the number of passengers waiting for the bus

 Suppose the sample space of Y is y1, y2, y3, …. That is, every day you
count the passengers, Y could be any one of y1, y2, y3, ….

 If you perform the experiment “many” independent times, and compute


the percent frequency of each outcome

25% 22%
20% 17%
% Frequency

15%

10%
5% 4%
5%

0% 10

y1 y2 y3 …. y10
Discrete Random Variables (cont’d)
 This frequency plot “approximates” the Probability Mass Function
(PMF) of the RV Y, which is denoted as pY(y)
 pY(y)  P{Y=y}  probability that the random variable Y takes on the
experimental value y on a performance of the experiment

 In our example
 pY(y1)  P{Y=y1}  0.05
 pY(y2)  P{Y=y2}  0.17
 ……
 pY(y10)  P{Y=y10}  0.04

 Note that
 0  pY(y)  1  y
 ∑ pY(y) = 1

11
Discrete Random Variables (cont’d)
 Associated with each PMF pY(y) is its Cumulative
Distribution Function (CDF), denoted as PY(y)

 PY(y) = P{Y≤y} = probability that the random variable Y assumes


an experimental value less than or equal to y

 In the previous example of the bus stop,


 PY(y1) = P{Y ≤ y1} = P{Y=y1}
 PY(y2) = P{Y ≤ y2} = P{Y=y1} + P{Y=y2}
 ….
 PY(y10) = P{Y ≤ y10} = P{Y=y1} + P{Y=y2} + P{Y=y3} + ….+ P{Y=y10} = 1

12
Discrete Random Variables (cont’d)
 If we wish to consider two discrete RVs simultaneously
(i.e. our experiment has 2 discrete outcomes), we must
use the “Joint” PMF

 pX,Y(x,y)  P{X=x, Y=y} for all x,y

 If a Joint PMF pX,Y(x,y) is known, the Marginal PMF of X


is

 pX(x)  P{X=x}  pX,Y(x,y1) + pX,Y(x,y2) + pX,Y(x,y3) + ….

13
Discrete Random Variables (cont’d)
 Conditional probability – 3 types of conditioning
 Conditioning among events within sample space
 P{B|A} = P{outcome of the experiment lies within event B, given
that it lies within event A}; which could also be written as
 P{B|A} = P{outcome of the experiment lies within event B A,
given that it lies within event A}
 P{B|A} = P{B  A} / P{A}

 Conditioning of RV on event A
 pX(x|A) = pX(x) / P{A} for all x  A; P{A} > 0
 pX,Y(x,y|A) = pX,Y(x,y) / P{A} for all (x,y)  A; P{A} > 0

 Conditioning among RVs


 pX|Y(x|y) = P{X=x | Y=y} = pX,Y(x,y) / pY(y) pY(y) > 0

14
Discrete Random Variables (cont’d)
 Independence – 2 types
 Independence among events within sample space
 Events A and B are said to be “independent” if information
concerning the occurrence of one of them does not alter the
probability of occurrence of the other, that is
 P{B|A} = P{B}
 Also if A and B are independent, then P{A  B} = P{A} . P{B}

 Independence among RVs


 RVs X and Y are independent iff
 pX|Y(x|y) = pX(x) for all possible values of x and y
 The above also implies
 pY|X(y|x) = pY(y)and
 pX,Y(x,y) = pX(x) pY(y) for all possible values of x and y

15
Discrete Random Variables (cont’d)
 Consider again the RV Y representing the number of passengers
waiting for the bus at a specific time
 The sample average of the “many” independent experiment outcomes
will be “very close to” the expected value (or mean) of the discrete RV
Y, which we denote as E[Y]

Y  E[Y ]  y1 pY ( y1 )  y2 pY ( y2 )  .....   ypY ( y )


y

 The sample variance of the “many” independent outcomes will be


“very close to” the variance of Y, which we denote as σY2

 Y2  E[(Y  E[Y ]) 2 ]  ( y1  Y ) 2 pY ( y1 )  ( y2  Y ) 2 pY ( y2 )  ....   ( y  E[Y ]) 2 pY ( y )


y
 The Standard Deviation of the RV X is the square root of the variance

16
Discrete Random Variables (cont’d)
 Important Relationships

 If X and Y are any 2 RVs


 E[X+Y] = E[X] + E[Y]

 If X and Y are 2 independent RVs


 Var[X+Y] = Var[X] + Var[Y]

17
Common PMFs
 Bernoulli
 Geometric
 Binomial
 Poisson
 Hypergeometric
 Negative Binomial

18
Bernoulli PMF
 A Bernoulli RV X can take on either 0 (failure) or 1 (success)
 If pX(1) = p, then pX(0) = 1-p
 E[X] = p
 Var[X] = p(1-p)

 Example
 If you have a roulette wheel as shown
 The outcome of spinning is 1 if arrow points to the shaded area
and 0 otherwise

 p = 0.25
 E[X] = 0.25 19

 Var[X] = 0.25(1-0.25) = 0.1875


Geometric PMF
 Related to the Bernoulli PMF

 A Geometric RV is defined as the number of Bernoulli trials


required to achieve the 1st “success”

 In the previous example, it is the number of times you have to spin


the wheel before the pointer falls into the shaded area

 If X is a geometric RV and its sample space is 1, 2, 3, …..


 pX(x) = (1-p)x-1p x=1,2,….
 E[X] = 1/p and Var[X] = (1-p)/p2
 In our example
 E[X] = 1/0.25 = 4 and Var[X] = 0.75/(0.75)2 = 12

20
Geometric PMF (cont’d)
 Now suppose that we spun the wheel 1 time with no
success, what is the probability that the next spin will
result in a success?
 Let X1 and X2 represent the first and second spins respectively
 Note that X1 and X2 are 2 Bernoulli RVs which are independent of
each other
 P{X2=1|X1 = 0} = P{X2=1, X1=0}/P{X1=0} = P{X2=1}

 Given that any geometric RV is a series of independent


Bernoulli trials, the above result indicates a “No
Memory” property of Geometric RVs. That is
 The number of times we wait for the first success does not
change the PMF, mean or variance of the remaining times we
have to wait for the first success
21
Binomial PMF
 Related to the Bernoulli PMF

 A Binomial RV is defined as the number of successes


in n independent Bernoulli trials

 In our example, it is the number of times the pointer


falls into the shaded area in n spins

 Consider a Binomial RV W
n!
pW ( w)  p w (1  p ) n  w for w  0,1,2,...., n
w!(n  w)!
E[W ]  np
Var[W ]  np (1  p ) 22
Poisson PMF
 A Poisson RV K is defined as the number of
“arrivals” occurring in a specified time interval [0,t]

 Example: Number of passengers arriving at a bus stop


within a specified time interval, say between 9:00 and
9:10am

 t
( t ) e
k
pK (k )  for k  0,1,2,....
k!
  is the mean arrival rate

23
Continuous Random Variables
 A continuous RV takes on real values (e.g. travel time
between 2 points)

 Each continuous RV X has a Probability Density


Function (PDF), denoted as fX(x)

 Recall that for a discrete RV Y, pY(y) is the probability


that Y takes on the specific value of y on a performance
of the experiment

 What is the equivalence for continuous RVs? Let’s


consider your travel time by car from home to school, T
24
Continuous Random Variables
(cont’d)
 In PDFs, we define probabilities over ranges of
the RV, not for specific values

 If RX defines the sample space of a continuous


RV X
 fX(x)  0  x  RX
  fX(x) dx = 1
Rx

25
Continuous Random Variables
(cont’d)
 Associated with any PDF of a continuous RV X is its CDF
(Cumulative Distribution
x
Function), denoted as FX(x)
 FX(x) = P{Xx} =  fX(x) dx
-

 If we wish to consider 2 continuous RVs simultaneously (e.g. stick


cutting problem), say X and Y, then we should study their “joint”
(aka “compound”) PDF, denoted as fX,Y(x,y)
 fX,Y(x,y)  0  x  RX and y  RY and   fX,Y(x,y) dy dx = 1
Rx Ry

 If we are given a joint PDF fX,Y(x,y), we may be interested in the


“Marginal” PDF of X, denoted as fX(x)
 fX(x) =  fX,Y(x,y) dy
Ry

26
Continuous Random Variables
(cont’d)
 Conditional PDF
 Conditioning on event A
 If we have fX(x) and we are interested in the experimental
outcome within event A, then
 fX(x|A) = fX(x) / P{A}  x  A and p{A}>0
 If we have fX,Y(x,y) and we are interested in the experimental
outcome within event A, then
 fX,Y(x,y|A) = fX,Y(x,y) / P{A}  x,y  A and p{A}>0

 Conditioning on another RV
 If we have fX,Y(x,y) and we are interested in the experimental
outcome of X given a specific value of Y, then
 fX|Y(x|y) = fX,Y(x,y) / fY(y)
 Also, fY|X(y|x) = fX,Y(x,y) / fX(x)

27
Continuous Random Variables
(cont’d)
 Independence of RVs

 2 continuous RVs are said to be independent iff


 fY|X(y|x) = fY(y)  x and y
 fX|Y(x|y) = fX(x)  x and y
 fX,Y(x,y) = fX(x) fY(y)  x and y

28
Continuous Random Variables
(cont’d)
 For a continuous RV X

 E[X] = - x fX(x) dx


 Var[X] = E[(X-E[X])2] =  (x-E[X])2 fX(x) dx
-

 For 2 continuous RVs X and Y


 E[X+Y] = E[X] + E[Y]
 If X and Y are independent
 Var[X+Y] = Var[X] + Var[Y]

29
Common PDFs
 Uniform
 Gaussian (Normal)
 Exponential
 Gamma
 Weibull
 Lognormal
 Beta

30
Uniform PDF

1 (b  a) a  x  b
fU (x)  
 0 otherwise

b
1 1 b
1 ba
E[ X ]   x dx  x | 
2
(b 2  a 2 ) 
a
ba 2(b  a ) a 2(b  a ) 2

( b  a ) 2
 x2  Var [ X ] 
12

 0 xa

FU (x)  x  a b  a a  x  b
 x b
 1 31
Gaussian (or Normal) PDF
 Generally describes natural phenomena
 Height distribution of human beings
 Age distribution among women
 PDF

 Based on Central Limit Theorem


 The PDF of the sum of a large number of independent RVs
approaches a normal PDF with a mean equal to the sum of the
individual means and variance equal to the sum of individual
variances
 Example
 Travel time along a corridor, where individual block travel times
are large and independent of one another. 32
Exponential PDF
 Related to the Poisson process
 Represents the inter-arrival time OR the time to the next
arrival
 An exponential RV has the following PDF
e t t  0,   0
fT (t)  
 0 otherwise
 is the arrival rate

 E[T] = 1/ 
 Var[T] = 1/ 2
 Note that the exponential PDF has a no-memory
property similar to the geometric PMF 33

You might also like