1
play

1 Discrete Conditional Distributions Operating System Loyalty - PDF document

Sum of Independent Binomial RVs Sum of Independent Poisson RVs Let X and Y be independent random variables Let X and Y be independent random variables X ~ Poi( l 1 ) and Y ~ Poi( l 2 ) X ~ Bin(n 1 , p) and Y ~ Bin(n 2 , p) X


  1. Sum of Independent Binomial RVs Sum of Independent Poisson RVs • Let X and Y be independent random variables • Let X and Y be independent random variables  X ~ Poi( l 1 ) and Y ~ Poi( l 2 )  X ~ Bin(n 1 , p) and Y ~ Bin(n 2 , p)  X + Y ~ Bin(n 1 + n 2 , p)  X + Y ~ Poi( l 1 + l 2 ) • Intuition: • Proof: (just for reference)  X has n 1 trials and Y has n 2 trials  Rewrite (X + Y = n ) as (X = k , Y = n – k ) where 0  k  n o Each trial has same “success” probability p n n             P ( X Y n ) P ( X k , Y n k ) P ( X k ) P ( Y n k )  Define Z to be n 1 + n 2 trials, each with success prob. p   k 0 k 0  Z ~ Bin(n 1 + n 2 , p), and also Z = X + Y l l  l l   l  l k n k k n k ( ) n n e n n !   1 2    l  l   l  l  l l  1 2 ( ) 1 2 k n k e 1 e 2 e 1 2 • More generally: X i ~ Bin(n i , p) for 1  i  N    1 2 k ! ( n k )! k ! ( n k )! n ! k ! ( n k )!    k 0 k 0 k 0     n N    n n !     l  l  l l  ~ Bin ,  Noting Binomial coefficient: ( ) n k n k X n p  i i 1 2 1 2     k ! ( n k )!    i 1 i 1  l  l   k 0 ( ) e 1 2    l  l n so, X + Y = n ~ Poi( l 1 + l 2 )  P ( X Y n ) 1 2 ! n Dance, Dance, Convolution Sum of Independent Uniform RVs • Let X and Y be independent random variables • Let X and Y be independent random variables  X ~ Uni(0, 1) and Y ~ Uni(0, 1)  f ( a ) = 1 for 0  a  1  Cumulative Distribution Function (CDF) of X + Y:    F ( a ) P ( X Y a )   What is PDF of X + Y? X Y   a y      1 1 f ( x ) f ( y ) dx dy f ( x ) dx f ( y ) dy       ( ) ( ) ( ) ( ) X Y X Y f a f a y f y dy f a y dy  X Y X Y X       x y a y x   y 0 y 0   When 0  a  1 and 0  y  a , 0  a – y  1  f X ( a – y ) = 1    ( ) ( ) F a y f y dy   a X Y  ( ) f a dy a   y  X Y  y 0  F X+Y is called convolution of F X and F Y  When 1 < a < 2 and a – 1  y  1, 0  a – y  1  f X ( a – y ) = 1  Probability Density Function (PDF) of X + Y, analogous:   1   ( a ) f  f ( a ) dy 2 a X   Y X Y    f ( a ) f ( a y ) f ( y ) dy   y a 1  1 X Y X Y    a 0 a 1    y        Combining: f ( a )  2 a 1 a 2   In discrete case, replace with , and f ( y ) with p ( y )  X Y  a  0 otherwise 1 2   y y Sum of Independent Normal RVs Virus Infections • Let X and Y be independent random variables • Say your RCC checks dorm machines for viruses  X ~ N( m 1 , s 1 2 ) and Y ~ N( m 2 , s 2 2 )  50 Macs, each independently infected with p = 0.1  100 PCs, each independently infected with p = 0.4  X + Y ~ N( m 1 + m 2 , s 1 2 + s 2 2 ) A ~ Bin(50, 0.1)  X ~ N(5, 4.5)  A = # infected Macs B ~ Bin(100, 0.4)  Y ~ N(40, 24)  B = # infected PCs • Generally, have n independent random variables  What is P(≥ 40 machine infected)? X i ~ N( m i , s i 2 ) for i = 1, 2, ..., n :  P(A + B ≥ 40)  P(X + Y ≥ 39.5)     n n n  X + Y = W ~ N(5 + 40 = 45, 4.5 + 24 = 28.5)       m s  2 ~ , X N      i   i i  W 45 39 . 5 45             i 1 i 1 i 1 P ( W 39 . 5 ) P 1 ( 1 . 03 ) 0 . 8485   28 . 5 28 . 5 • Be glad it’s not swine flu! 1

  2. Discrete Conditional Distributions Operating System Loyalty • Recall that for events E and F: • Consider person buying 2 computers (over time) ( ) P EF  X = 1st computer bought is a PC (1 if it is, 0 if it is not)   P ( E | F ) where P ( F ) 0 P ( F )  Y = 2nd computer bought is a PC (1 if it is, 0 if it is not) • Now, have X and Y as discrete random variables  Joint probability mass function (PMF):  What is P(Y = 0 | X = 0)?  Conditional PMF of X given Y (where p Y ( y ) > 0): X 0 1 p Y (y)   Y p ( x , y ) P ( X x , Y y ) ( 0 , 0 ) p 0 . 2 2      ,      ( | ) ( | ) X Y X , Y P x y P X x Y y P ( Y 0 | X 0 )  X | Y 0 0.2 0.3 0.5 ( ) ( ) p ( 0 ) 0 . 3 3 P Y y p y X Y  What is P(Y = 1 | X = 0)?  Conditional CDF of X given Y (where p Y ( y ) > 0): 1 0.1 0.4 0.5 p ( 0 , 1 ) 0 . 1 1        X , Y P ( X a , Y y ) P ( Y 1 | X 0 )     p X (x) 0.3 0.7 1.0 ( 0 ) 0 . 3 3 F ( a | y ) P ( X a | Y y ) p X X | Y  P ( Y y )   What is P(X = 0 | Y = 1)? p ( x , y )    X , Y  ( 0 , 1 ) x a p 0 . 1 1 p ( x | y )      X , Y P ( X 0 | Y 1 ) X | Y p ( y )  p ( 1 ) 0 . 5 5 Y x a Y And It Applies to Books Too… Web Server Requests Redux • Requests received at web server in a day X ~ Poi( l 1 )  X = # requests from humans/day Y ~ Poi( l 2 )  Y = # requests from bots/day  X and Y are independent  X + Y ~ Poi( l 1 + l 2 )  What is P(X = k | X + Y = n )?       P ( X k , Y n k ) P ( X k ) P ( Y n k )      P ( X k | X Y n )     P ( X Y n ) P ( X Y n )  l  l   l l l l k n k ! ! k n k e 1 e 2 n n      1 2 1 2   l  l l  l  l  l ( ) n n k ! ( n k )! e ( ) k ! ( n k )! ( ) 1 2 1 2 1 2    k   n k   l l n        1 2       l  l l  l  k      1 2 1 2   l    1  X | X + Y ~ Bin X Y ,   l  l P(Buy Book Y | Bought Book X)   1 2 Let’s Do an Example Continuous Conditional Distributions • Let X and Y be continuous random variables • X and Y are continuous RVs with PDF:  12     x ( 2 x y ) wh ere 0 x,y 1  Conditional PDF of X given Y (where f Y ( y ) > 0):   5 f ( x , y )  0 otherwise f ( x , y )  , ( | ) X Y f x y X | Y ( ) f y Y  Compute conditional density: f ( x | y ) X | Y f ( x , y ) dx dy  X , Y f ( x | y ) dx ( , ) ( , ) f x y f x y X | Y f ( y ) dy   X , Y X , Y f ( x | y ) Y |       X Y 1 f ( y ) P ( x X x dx , y Y y dy )          Y f ( x , y ) dx P ( x X x dx | y Y y dy ) ,    X Y P ( y Y y dy ) 0 12    Conditional CDF of X given Y (where f Y ( y ) > 0):     x ( 2 x y ) x ( 2 x y ) x ( 2 x y )  5     a  1 1     ( | ) ( | ) ( | )   1 F a y P X a Y y f x y dx 12     3 2 x x y x ( 2 x y ) dx x ( 2 x y ) dx 2   | | x X Y X Y 5 3 2   0 0 0  Note: Even though P(Y = a ) = 0, can condition on Y = a     x ( 2 x y ) 6 x ( 2 x y )     a / 2           2 y  o Really considering: P ( a Y a ) f ( y ) dy f ( a )  4 3 y 2 2 Y 3 2   a / 2 2

Recommend


More recommend