Last Time... Product of RVs Let X be a RV with values in A . I Variance measures deviation from mean Let Y be a RV with values in B . Covariance and Correlation I Variance is additive for independent RVs What does the distribution of XY look like? " " ' III I Use linearity of expectation and indicator CS 70, Summer 2019 "*aia . Yawning variables xx - :# Today: Lecture 22, 7/31/19 I Proof that var. is additive for ind. RVs What if X , Y are independent ? - a) PEX Pff b) I Talk about covariance and correlation = a ,Y=bI=P[ X - BE B things like treat will VAEA I Some RV practice (if time) 2 7=1 , X vs - , 1,4=2 - f- cases separate 2 . as 1 / 27 2 / 27 3 / 27 For Independent RVs... Variance is Additive for Ind. RVs Can You Multiply? If X and Y are independent, we can show that: If X and Y are independent, we can show that: If X and Y are independent , then: ¢ Definition ECXTECY ] E [ XY ] = E [ X ] · E [ Y ] Var( X + Y ) = Var[ X ] + Var[ Y ] E [ XY ] = ⇐ :* ¥ :na÷ ÷÷÷÷ " " " EAT I RHI Efx I EH ] a ] ) ( ftp.b.PEF-bD Efx ] 2 ] A PC X all face , - CECXTYIJZ = Efcxty ) - Is the converse true? - DE -11147 . Etc Nd - ELY ] =o M2 . Tin - - ¥⇒ ELY ]=O Distribute ' . Cable " , ] E[X2t2XYtY2 ] . fifty - st.is/!-.miY- - TEE 410,17 # a - UE ]t2E¥tECY2 -2¥ - Mf .by?bybyinde#=?afcab7.lPCX=a,Y=b3=fECXY ] ECXZ - ECXJECY ] ECXYJ b/c - cancel when slide 0,4=0 ] # Paco ] pre v RVs multiple see PEX : , for ] tvarcy ) = t defined Var dist * Xy 's p[y=o ] ! ! induction . . 4 / 27 5 / 27 6 / 27
fit . Covariance Example: Coin Flips I Example: Coin Flips I Measures “how independent” two RVs are. Let I flip two fair coins. What is Cov( X , Y ) ? E [ X ] = µ 1 , and let E [ Y ] = µ 2 . Let X count the number of heads, and let Y be Efx ) EH ) EIXYI an indicator for the first coin being a head. - Cov( X , Y ) = - III. Wptz COVCX.yf-OEGX-u.KY-u.IT XY={ I IIF " ICE ) First, what is XY ? If , ECYI-M.tk - { & WPIFTT ¥ - Alternate Form: X - " ' ' ④ Hanzo I' €xyf÷J"¥M '¥*np¥¥¥ Cov( X , Y ) = 't ¥ ④ rain .ie Milk ] i. - up ] Max t - it IE EXT ECCX , Ky - = Mita ii. ¥ = IECXYI =3 . I : IPp¥t III. In - - → 4 Lin y . . ECXYIFECXIEED ECXY ] = Milk - I - IEEYI ind ! ! ⇒ not x ,y ( contrapositive ) 7 / 27 8 / 27 9 / 27 Properties of Covariance I Properties of Covariance II Properties of Covariance III If X and Y are independent, then: What happens when we take Cov( X , X ) ? Covariance is bilinear. ECX ] if O because Can use either definition of covariance! Cov( X , Y ) = Cov( a 1 X 1 + a 2 X 2 , Y ) = - ECXIEED ECXYI Cov Cx , x K EKX - UK X U ) ] , Y ) Az for ( Xz , Y ) - ① CoV C Xi t - A , Is the converse true? No = Efc X . u ) 2) Var CX ) = = " - " as counterexample Same - ECXIECXI E CX Cx ) ) Cov( X , b 1 Y 1 + b 2 Y 2 ) = covcx , X ) ÷ ② - - , Yi ) COV ( X tbz Var CX ) I X , Yz ) b. for = ex ) c Cove x. Cov ( CX , CX ) C CX ) ④ = var = Cov C X , X ) Cz = . 10 / 27 11 / 27 12 / 27
Practice: Bilinearity! Example: Coin Flips II Properties of Covariance IV Same setup: Two fair flips. X is number of Simplify Cov( 3 X + 4 Y , 5 X − 2 Y ) . For any two RVs X , Y : heads, and Y is indicator for the first coin heads. fist Cov ( x - 2X ) - 2 'D -14 COVEY , 5 X 1- Xty ) words Cov ( Xt Y SX Recall: Cov( X , Y ) = z Var( X + Y ) = = , 4 , Xt Y ) + COVEY 6 Cov CX , Y ) Xty ) Now, let Y 0 be an indicator for the first coin being Cov ( X , = 15 COV C xx ) , = - COV CY , X ) TCOVCY , 'D - 8 Cov C Xi ) C Y , X ) ANY , 'D a tail. How does the covariance change? ( X , x ) t Cov t 20 Cov 1- = ' I T var # - Y ) COVCX Cov C x. Y , I = vortex , = COV C X , Y ) - 8 -114 Var l Y ) - COVCX , 'D Eovcx Var Cx ) , 'D - t-Y.EE#fECxI.EGI-TT , 1) = 15 Y' TY I covcx -12 t Observe = : - . ' Y - = 13 / 27 14 / 27 15 / 27 Break Correlation Example: Coin Flips II µ so amnion o I flip two fair coins. For any two RVs X , Y that are not constant : Let X count the number of heads, and let Y be , Y ) ( X an indicator for the first coin being a head. Cov Corr( X , Y ) = ¥Y) Std der What is Corr( X , Y ) ? If you could eliminate one food so that no one ← Sanity Check! tarty ) ↳ would eat it ever again , what would you pick to = covcx.ygttxnBincz.EE#Y-ynBerCtzyvarCX7=npCi-pl varix =L destroy? What is Corr( X , X ) ? z ( Farc - p ) - pet vary ) - = 4 What is Corr( X , − X ) ? =L 1 - . Ez 9¥ 041=2 What is Corr( X , Y ) for X , Y independent? O corrcx.tt#zI.= E 16 / 27 17 / 27 18 / 27
Size of Correlation? Size of Correlation? RV Practice: Two Roads For any RVs X and Y that are not constants : (Continued:) There are two paths from Soda to VLSB. I usually choose a path uniformly at random. − 1 ≤ Corr( X , Y ) ≤ 1 # minutes spent on Path 1 is a Geometric( p 1 ) RV. # minutes spent on Path 2 is a Geometric( p 2 ) RV. Proof: Define new RVs using X and Y : Today, it took me 6 minutes to walk from Soda ˜ X = to VLSB. Given this, what is the probability that I ˜ Y = chose Path 1? path 1 time T , comin -_ n Geomlpi ) - 't path ¥ \ path 2 time Tz -_ ) rcaeomcpz comin - . path 's + event chose W I 2 -_ , path 't 19 / 27 20 / 27 21 / 27 RV Practice: Two Roads RV Practice: RandomSort RV Practice: RandomSort conditional prob "XM=# . Continued: d I have cards labeled 1 , 2 , . . . , n . They are shu ffl ed. What is the expected number of draws I need? min ] def God , Ipfw , 16 . = min ] IPC 6 I want them in order. I sort them in a naive way. non . I start with all cards in an “unsorted” pile. I draw -pp,→ from (E) ( I cards from the unsorted pile uniformly at random - pimp it = PICT . - H = until I get card 1. I place card 1 in a “sorted” .fi#EEtiIDdtftEuie What is the variance of the number of draws? pile, and continue, this time looking for card 2. - p , Isp Is ICI # 9 goaertd I , ,etard2 = I - p , 75pct - 17275 Pz T 2 , re a deists ? these What are 22 / 27 23 / 27 24 / 27
RV Practice: Packets RV Practice: Packets Summary Packets arrive from sources A and B . What is the probability that over this interval, I I Covariance and correlation measure how I fix a time interval. Over this interval, the number receive exactly 2 packets? independent two RVs are. of packets from A and B have Poisson( λ A ) and Poisson( λ B ) distributions, and are independent . I Variance can be expressed and manipulated in terms of covariance. What is the distribution of the total number of What is the expected number of packets I receive packets I receive in this time interval? I Independent RVs have zero covariance and over this interval? zero correlation . However, the converse is not true! What is the variance of this number? 25 / 27 26 / 27 27 / 27
Recommend
More recommend