probability and statistics modelling systems of random variables – computer system – traffic...
Post on 19-Dec-2015
216 views
TRANSCRIPT
ST2004 2011 Week 10 2
Systems• Teams in league– Games won by NA N B NC
– Sums of binary• Student attendance at class– Binary Name Chosen/ Not
Chosen– Given chosen Presence/Absence
• Sets of Dice– Scores X1 X 2 X3 Sums, Max S 3 M3
ModelDecompose
SplashBean Machine
ST2004 2011 Week 10 6
Systems of Random Variables
• Input Output– Simulation
• Joint Uncertainty (Input) Uncertainty(Output)
– Prob Dist
– Expected Values and VariancesIndependentDependentLinearNon-linear
ST2004 2011 Week 10 7
Linear Combs & Normal Distribution
• Linear Combinations – weighted sums– counts
• Simple for Normal• Normal a useful approx– Central Limit Theorem– SE(mean&prop) n Convergence
Dice sumDice max
ST2004 2011 Week 10 9
Prob Rules Prob Dist ExpVal etcMini League
Define = Number of wins by
twice as good as , ;
, evenly matched
Seek joint prob dist of ( , )
prob dist of
[ ], [ ]
prob dist of
joint prob dist of ( , )
[ , ]
B
A B
A B
A B
N B
A B C
B C
N N
S N N
E S Var S
D N N
S D
Cov S D
Joint NA Marg DistDist 0 1 2 NB
0 0 0.111 0.222 0.333NB 1 0.056 0.222 0.222 0.500
2 0.056 0.111 0 0.167NA 0.112 0.444 0.444 1
Cond Dists for NA0 1 2
Given 0 0.000 0.333 0.667 1.667 0.22NB= 1 0.112 0.444 0.444 1.332 0.45
2 0.335 0.665 0.000 0.665 0.22
Marg Dist
Cond Exp Vals
Cond Vars
ST2004 2011 Week 10 12
Max and Min CombinationsA system has 3 components A, B and C, with redundancy. It is designed such that it will work if either (C is working) or (both A and B are working). If the lifetimes of A, B and C are 10, 15 and 8 hours, resp, then it will work for 10 hours.
Components , ,
Sub-system , System
Random var identity
Event Id's
A B C
AB S
AB
S
AB
AB
S
S
T T T
T T
T
T
T t
T t
T t
T t
Probs
Times Exp Dist
Pr( )
Pr( )
Pr
Pr
Pr
Pr
~ ( )Comp
AB
AB
S
S
T
T t
T t
T t
T t
T t
T t
Exp mean
ST2004 2011 Week 10 15
Sum/Diff/Lin Comb indep random vars
• Expected Value & Var• simple rules, based on
– E[aX+bY] =aE[X] + bE[Y]– Var[aX+bY] =a2Var[X] + b2E[Y]
• cdf(system) pmf(system)– by tabulation, enumeration if discrete• some special cases
– intricate calculus, if continuous• some special cases
– but often, Normal approx
ST2004 2011 Week 10 17
Theory: Linear Combinations
X,Y random variablesa,b constantsZ = aX+bYSeek E[Z] and Var[Z]Using Normal (approx) for dist Z?
E[Z] and Var[Z] fully specifyDiscrete dists only in these notes; extension to continuous dists only a matter of notation; joint pdf instead of joint pmf; integrals instead of sums.
ST2004 2011 Week 10 18
Approach via dist Z =Y+X
31 2 127 27 27 3
32 2 127 27 27 3
3 2 1 127 27 27 331 2 2 1
9 9 9 9 9
Prob
and Poss 2 3 4 5 6
1 0 0
2 0 0
3 0 0
1
Y
sum
X
sum
E[Y] E[X]Var[Y] Var[X]E[Z]Var[Z]
InFill in given Indep
ST2004 2011 Week 10 19
Approach via dist Z =Y+X
3 6 7 6 31 127 27 27 27 27 27 27
Poss( ) are 3, 4, ...9
Prob( ) ?
Event Identities
( 3) ( 1, 2)
( 4) ( 1, 3) ( 2, 2)
( 3, 1)
Poss 3 4 5 6 7 8 9
Pr( )
Z z
Z z
Z X Y
Z X Y OR X Y
OR X Y
z
Z z
31 2 127 27 27 3
32 2 127 27 27 3
3 2 1 127 27 27 331 2 2 1
9 9 9 9 9
Prob
and Poss 2 3 4 5 6
1 0 0
2 0 0
3 0 0
1
Y
sum
X
sum
E[Y] = 2 E[X]=4Var[Y] =2/3 Var[X]=4/3E[Z]= 6 Var[Z]=6/3Cov(X,Y)=0
ST2004 2011 Week 10 23
Direct approach: when X,Y not indep
23
43
23
102 4 23 3 3 3
Without computing dist( )
[ ] 2 [ ]
4 [ ]
[ , ]
Use general result
[ ] [ ] 2 4 6
[ ] [ ] [ ] 2 ( , )
2
Z
E X Var X
E Y Var Y
Cov X Y
E Z E X Y
Var Z Var X Var Y Cov X Y
ST2004 2011 Week 10 24
2 2
2 2
2 2
[ ] [ ] [ ]
[ ] [ ] [ ] 2 [ , ]
[ , ] 0[ ] [ ]
[ ] [ ]
E aX bY aE X bE Y
Var aX bY a Var X b Var Y abCov X Y
a
in general
in general
whenCov X Y
when
Var X b Var Y
a Var inX b Var eY d p
Theory: Expected values for linear combs
ST2004 2011 Week 10 25
App: Travel Times
If time to travel A B,B C ,
Time to travel A C via B =
If told can model via:
~ 35,10 , ~ 45,25
Seek 1 Pr >10% longer than avg
2 Pr >10% longer than avg
3 Pr >10% longer than a
AB BC
AC AB BC
AB BC
AB
BC
AC
T T
T T T
T N T N indep
T
T
T
vg
80, 35, ~ 80,35AC AC AC
Theory
E T Var T T N
ST2004 2011 Week 10 27
App: Travel Times
Time to travel A C via B =
If told ~ 35,10 , ~ 45,25
Seek 1 Pr >10% longer than avg
2 Pr >10% longer than avg
3 Pr >10% longer than avg
80, 35, ~ 80,35
AC AB BC
AB BC
AB
BC
AC
AC AC AC
T T T
T N T N indep
T
T
T
Theory
E T Var T T N
ST2004 2011 Week 10 28
Travel Times
~ 35,10 ~ 45,25 ~ 80,35AB A ABT N T N T N
mean 35 45 80var 10 25 35Probs 0.134 0.184 0.088
2If ~ , then Z ~ 0,1
Event Identity
Y
y
Y N N
Y y Z
ST2004 2011 Week 10 29
Times Different?
~ 35,10 , ~ 45,25
Seek Pr >
- 10, - 35
0 ( 10) 10 - >0 Std Norm 1
35 35
Event Identity > - >0AB B
AB BC
AB BC
AB BC AB BC
AB BC
C AB BC
T N T N indep
T T
Theory
E T T Var T T
T T
T T T
Z
T
Pr = 0.045
ST2004 2011 Week 10 32
Proof: discrete case
,
, ,
[ ] (Poss( ) Probs)
= ( ) Pr( , )
= Pr( , ) Pr( , )
= Pr( , ) Pr( , )
= Pr( ) Pr( )
[ ] [ ]
x y
x y x y
x y y x
x y
E X Y Sum X Y
x y X x Y y
x X x Y y y X x Y y
x X x Y y y X x Y y
x X x y Y y
in gE X E e raY ne l
ST2004 2011 Week 10 34
Packing a pillbox
2
2
2
Mean Pill Depths 40 SD 3
Model Pill Depths ~ 40,3
Tube 420,5
Cork in Tube 15,2
Seek Pr(All fit)
Pill Tube designed to take 10 pills;
mm mm
N iid
N
N
ST2004 2011 Week 10 36
Extension
1 1 2 2 3 3 1 1 2 2 3 3
1 1 2 2 3 3
2
2
[ ...] [ ] [ ...]
[ ] [ ] [ ...]
General Result
i i i i
i i i i
i i i i
E a X a X a X a E X E a X a X
a E X a E X E a X
E a X a E X
Var
in general
whenindepa X a Var X
Va
In gene
r a X a Var X
ral
2 ,i j i j
i j
a a Cov X X
ST2004 2011 Week 10 38
Common Error
Let Pill Depth; Tube; Cork
(All fit) 10 0
10
420 (40 ... 40) 15 5
[ ] 25 100(9) 4 929
0 5( 0) Std Norm
929
X T C
T X C
Z T X C
E Z
Var Z
Z
ST2004 2011 Week 10 39
Important Special Cases
2 2
1 2
1 2
21 1
1 11 2
1 1
2 21 1 1
.....
[ ] .....
[ ] ..
.....
[ ]
[
increases at rate
always
decreases at ra] t[ ]
Total
Avg
n n
n n
n n
n n nn n
n nn n
n n nn n
Y X X X iid
E Y E X E X E X n
Var Y Var X Var X Var X n
X X X X Y
E X E Y n
Var X Var Y n
n
1
1
e
decreases at [ a e] r t
n
n nSD X
n
ST2004 2011 Week 10 41
Simulation Convergence
8.00
9.00
10.00
11.00
12.00
13.00
14.00
15.00
16.00
1 101 201 301 401 501 601 701 801 901
S4 lo
S4 hi
Running avg of S4
Confidence Intervals for Simulations Sec5.7
ST2004 2011 Week 10 43
Theory: Normal Approximationvia Central Limit Theorem
1
If indep with common [ ], [ ]
Then approx [ ], [ ]
1 1and approx [ ], [ ]
~
~
i
n
n i
n n
Y E Y Var Y
S Y N nE Y nVar Y
Y S N E Y Var Yn n
ST2004 2011 Week 10 44
Application: sums and averages
1 2
7 352 12
1
1
7 352 12
72
Let , .......... .. regular die
[ ] ; [ ]
Define
(scores on dice)= ; (scores on dice)
Recall [ ] ; [ ]
Thus [ ] ;
n
i i
n
n i n nn
i
n nn n
n
indep identically disX X X
E X Var X
Y sum n X X Y avg n
E Y V
tributed ii
a
E
d
r Y
X
3512[ ]n nVar Y
2
2
Normal Approx via Central Limit Theorem
7 35,
2 12
7 35,
2 12
~
~
n
n
n nY N
X Nn
ST2004 2011 Week 10 45
Application: precision
2
2
21 2
General Result
, .......... .. [ ] ; [ ]
Sample Mean (values of )
Show [ ] ; [ ]
Implications? used as estimator of
Precision of estimator 2
n i i
n i
n n n
n
n
X X X E X Var X
X avg X
E X Var Y
i
X
id