probability and statistics
play

Probability and Statistics for Computer Science The - PowerPoint PPT Presentation

Probability and Statistics for Computer Science The weak law of large number gives us a very valuable way of thinking about


  1. Probability ¡and ¡Statistics ¡ ì ¡ for ¡Computer ¡Science ¡ ¡ “The ¡weak ¡law ¡of ¡large ¡ number ¡gives ¡us ¡a ¡very ¡ valuable ¡way ¡of ¡thinking ¡ about ¡expecta:ons.” ¡-­‑-­‑-­‑Prof. ¡ Forsythe ¡ ¡ ¡ Credit: ¡wikipedia ¡ Hongye ¡Liu, ¡Teaching ¡Assistant ¡Prof, ¡CS361, ¡UIUC, ¡9.24.2019 ¡

  2. Last ¡time ¡ ✺ Random ¡Variable ¡ ¡ ✺ Expected ¡value ¡ ✺ Variance ¡& ¡covariance ¡ ✺ Towards ¡the ¡weak ¡law ¡of ¡large ¡ numbers ¡

  3. Content ¡ ✺ Random ¡Variable ¡ ¡ ✺ Review ¡with ¡ques>ons ¡ ✺ The ¡weak ¡law ¡of ¡large ¡numbers ¡ ✺ Simula>on ¡& ¡example ¡of ¡airline ¡ overbooking ¡

  4. Content ¡ ✺ Random ¡Variable ¡ ¡ ✺ Review ¡with ¡ques,ons ¡ ✺ The ¡weak ¡law ¡of ¡large ¡numbers ¡ ✺ Simula>on ¡& ¡example ¡of ¡airline ¡ overbooking ¡

  5. Expected ¡value ¡ ✺ The ¡ expected ¡value ¡(or ¡ expecta,on ) ¡ of ¡a ¡random ¡variable ¡ X ¡is ¡ � E [ X ] = xP ( x ) x The ¡expected ¡value ¡is ¡a ¡weighted ¡sum ¡ of ¡the ¡values ¡ X ¡can ¡take ¡ ¡

  6. Linearity ¡of ¡Expectation ¡ ✺ For ¡random ¡variables ¡ X ¡and ¡ Y ¡ and ¡constants ¡k,c ¡ ✺ Scaling ¡property ¡ ¡ E [ kX ] = kE [ X ] ✺ Addi:vity ¡ E [ X + Y ] = E [ X ] + E [ Y ] ✺ And ¡ ¡ E [ kX + c ] = kE [ X ] + c

  7. Expected ¡value ¡of ¡a ¡function ¡of ¡ X ✺ If ¡ f ¡is ¡a ¡func:on ¡of ¡a ¡random ¡ variable ¡ X ¡, ¡then ¡ Y ¡= ¡ f ¡( X ) ¡is ¡a ¡ random ¡variable ¡too ¡ ✺ The ¡expected ¡value ¡of ¡ Y ¡= ¡ f ¡( X ) ¡is ¡ � E [ Y ] = E [ f ( X )] = f ( x ) P ( x ) ¡ x ¡

  8. Q: ¡ What ¡is ¡E[E[X]]? ¡ ¡ ¡ ¡ A. E[X] ¡ B. 0 ¡ C. Can’t ¡be ¡sure ¡

  9. Q: ¡ What ¡is ¡E[E[X]]? ¡ ¡ ¡ ¡ A. E[X] ¡ B. 0 ¡ C. Can’t ¡be ¡sure ¡

  10. Probability ¡distribution ¡ ✺ Given ¡the ¡random ¡variable ¡ X , ¡ what ¡is ¡ ¡ E[2| X | ¡+1]? ¡ A. ¡ ¡0 ¡ p ( x ) P ( X = x ) B. ¡ ¡1 ¡ C. ¡ ¡2 ¡ D. ¡ ¡3 ¡ 1/2 ¡ E. ¡ ¡5 ¡ 0 ¡ -­‑1 ¡ 1 ¡ X

  11. Probability ¡distribution ¡ ✺ Given ¡the ¡random ¡variable ¡ X , ¡ what ¡is ¡ ¡ E[2| X | ¡+1]? ¡ A. ¡ ¡0 ¡ p ( x ) P ( X = x ) B. ¡ ¡1 ¡ C. ¡ ¡2 ¡ D. ¡ ¡3 ¡ 1/2 ¡ E. ¡ ¡5 ¡ 0 ¡ -­‑1 ¡ 1 ¡ X

  12. Probability ¡distribution ¡and ¡ cumulative ¡distribution ¡ ✺ Given ¡the ¡random ¡variable ¡ X , ¡ what ¡is ¡ ¡ E[2| X | ¡+1]? ¡ E [ | X | ] = 1 × 1 2 + 1 × 1 2 = 1 E [ X 2 ] = 1 × 1 2 + 1 × 1 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ 2 = 1 E [2 | X | + 1] = 2 E [ | X | ] + 1 = 3

  13. A ¡neater ¡expression ¡for ¡variance ✺ Variance ¡of ¡Random ¡Variable ¡X ¡is ¡ defined ¡as: ¡ ¡ var [ X ] = E [( X − E [ X ]) 2 ] ¡ ¡ ✺ It’s ¡the ¡same ¡as: ¡ var [ X ] = E [ X 2 ] − E [ X ] 2

  14. Probability ¡distribution ¡and ¡ cumulative ¡distribution ¡ ✺ Given ¡the ¡random ¡variable ¡ X , ¡ what ¡is ¡ ¡ var[2| X | ¡+1]? ¡ A. ¡ ¡0 ¡ p ( x ) P ( X = x ) B. ¡ ¡1 ¡ C. ¡ ¡2 ¡ D. ¡ ¡3 ¡ 1/2 ¡ E. ¡ ¡-­‑1 ¡ 0 ¡ -­‑1 ¡ 1 ¡ X

  15. Probability ¡distribution ¡and ¡ cumulative ¡distribution ¡ ✺ Given ¡the ¡random ¡variable ¡ X , ¡ what ¡is ¡ ¡ var[2| X | ¡+1]? ¡ A. ¡ ¡0 ¡ p ( x ) P ( X = x ) B. ¡ ¡1 ¡ C. ¡ ¡2 ¡ D. ¡ ¡3 ¡ 1/2 ¡ E. ¡ ¡-­‑1 ¡ 0 ¡ -­‑1 ¡ 1 ¡ X

  16. Probability ¡distribution ¡and ¡ cumulative ¡distribution ¡ ✺ Given ¡the ¡random ¡variable ¡ X , ¡ what ¡is ¡ ¡ var[2| X | ¡+1]? ¡ E [ | X | ] = 1 × 1 2 + 1 × 1 2 = 1 E [ X 2 ] = 1 × 1 2 + 1 × 1 2 = 1 E [2 | X | + 1] = 2 E [ | X | ] + 1 = 3 var [2 | X | + 1] = E [(2 | X | + 1) 2 ] − ( E [2 | X | + 1]) 2 = E [4 X 2 + 4 | X | + 1] − 3 2 = 4 × 1 + 4 × 1 + 1 − 9 = 0

  17. Probability ¡distribution ¡ ✺ Given ¡the ¡random ¡variable ¡ X , ¡ what ¡is ¡ ¡ var[2| X | ¡+1]? ¡ ¡Let ¡ Y ¡= ¡2| X |+1 ¡ p ( y ) P ( Y = y ) 1 ¡ 0 ¡ 3 ¡ X

  18. A ¡neater ¡form ¡for ¡covariance ¡ ✺ A ¡neater ¡expression ¡for ¡ covariance ¡(similar ¡deriva:on ¡as ¡ for ¡variance) ¡ cov ( X, Y ) = E [ XY ] − E [ X ] E [ Y ]

  19. Correlation ¡coefficient ¡is ¡ normalized ¡ ¡covariance ¡ ✺ The ¡correla:on ¡coefficient ¡is ¡ corr ( X, Y ) = cov ( X, Y ) ¡ σ X σ Y ✺ When ¡ X, Y ¡takes ¡on ¡values ¡with ¡equal ¡ probability ¡to ¡generate ¡data ¡sets ¡ {( x,y )}, ¡the ¡correla:on ¡coefficient ¡will ¡ be ¡as ¡seen ¡in ¡Chapter ¡2. ¡

  20. Q: ¡ ✺ Which ¡of ¡the ¡following ¡is ¡NOT ¡generally ¡ true ¡about ¡two ¡independent ¡random ¡ variables ¡X ¡and ¡Y? ¡ ¡A. ¡E[X+Y] ¡= ¡E[X] ¡+E[Y] ¡ ¡B. ¡var[X+Y] ¡= ¡var[X]+V[Y] ¡ ¡C. ¡E[XY] ¡= ¡E[X]E[Y] ¡ ¡D. ¡corr(X,Y) ¡= ¡0 ¡ ¡E. ¡std[X+Y] ¡= ¡std[X]+std[Y] ¡

  21. Q: ¡ ✺ Which ¡of ¡the ¡following ¡is ¡NOT ¡generally ¡ true ¡about ¡two ¡independent ¡random ¡ variables ¡X ¡and ¡Y? ¡ ¡A. ¡E[X+Y] ¡= ¡E[X] ¡+E[Y] ¡ ¡B. ¡var[X+Y] ¡= ¡var[X]+V[Y] ¡ ¡C. ¡E[XY] ¡= ¡E[X]E[Y] ¡ ¡D. ¡corr(X,Y) ¡= ¡0 ¡ ¡E. ¡std[X+Y] ¡= ¡std[X]+std[Y] ¡

  22. Content ¡ ✺ Random ¡Variable ¡ ¡ ✺ Review ¡with ¡ques>ons ¡ ✺ The ¡weak ¡law ¡of ¡large ¡numbers ¡ ✺ Simula>on ¡& ¡example ¡of ¡airline ¡ overbooking ¡

  23. Towards ¡the ¡weak ¡law ¡of ¡large ¡ numbers ¡ ✺ The ¡weak ¡law ¡says ¡that ¡if ¡we ¡repeat ¡an ¡experiment ¡ many ¡:mes, ¡the ¡average ¡of ¡the ¡observa:ons ¡will ¡ “converge” ¡to ¡the ¡expected ¡value ¡ ✺ For ¡example, ¡if ¡you ¡repeat ¡the ¡profit ¡example, ¡the ¡ average ¡earning ¡will ¡“converge” ¡to ¡E[ X ]=20p-­‑10 ¡ ¡ ✺ The ¡weak ¡law ¡jus:fies ¡using ¡simula:ons ¡(instead ¡of ¡ calcula:on) ¡ ¡to ¡es:mate ¡the ¡expected ¡values ¡of ¡ random ¡variables ¡

  24. Indicator ¡functions ¡ ✺ An ¡indicator ¡func:on ¡for ¡an ¡event ¡ A ¡is ¡a ¡ func:on ¡of ¡ x ¡such ¡that ¡ � 1 event occurs for the value x ( x ) = [ A ] ¡ 0 otherwise ✺ The ¡expected ¡value ¡of ¡the ¡indicator ¡func:on ¡ is ¡the ¡probability ¡of ¡event ¡ A ¡ E[ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ( x ) ] ¡= ¡ 1×P( A )+0×(1-­‑P( A )) ¡= ¡P( A ) ¡ [ A ] ¡

  25. Markov’s ¡inequality ¡ ✺ For ¡any ¡random ¡variable ¡ X ¡and ¡constant ¡ a ¡ >0 ¡ P ( | X | ≥ a ) ≤ E [ | X | ] ¡ a ✺ So, ¡a ¡random ¡variable ¡is ¡unlikely ¡to ¡have ¡the ¡ absolute ¡value ¡much ¡larger ¡than ¡the ¡mean ¡of ¡ its ¡absolute ¡value ¡ ¡ ¡ ✺ For ¡example, ¡if ¡ a ¡= ¡10 ¡E[| X |] ¡ ¡ ¡ ¡ P ( | X | ≥ 10 E [ | X | ]) ≤ 0 . 1 ¡ ¡

  26. Proof ¡of ¡Markov’s ¡inequality ¡ � 1 if | X | ≥ a [ |X| ≥ a ] ¡ ( X ) = 0 otherwise

  27. Proof ¡of ¡Markov’s ¡inequality ¡ � 1 if | X | ≥ a [ |X| ≥ a ] ¡ ( X ) = 0 otherwise ≤ | X | a

  28. Proof ¡of ¡Markov’s ¡inequality ¡ � 1 if | X | ≥ a ( X ) = [ |X| ≥ a ] ¡ 0 otherwise ≤ | X | a ≤ E [ | X | ] E[ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ( X ) ] ¡ [ |X| ≥ a ] ¡ a

  29. Proof ¡of ¡Markov’s ¡inequality ¡ � 1 if | X | ≥ a ( X ) = [ |X| ≥ a ] ¡ 0 otherwise ≤ | X | a ≤ E [ | X | ] E[ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ( X ) ] ¡ [ |X| ≥ a ] ¡ a LHS ¡= ¡ ¡

  30. Proof ¡of ¡Markov’s ¡inequality ¡ � 1 if | X | ≥ a ( X ) = [ |X| ≥ a ] ¡ 0 otherwise ≤ | X | a ≤ E [ | X | ] E[ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ( X ) ] ¡ [ |X| ≥ a ] ¡ a LHS ¡= ¡ ¡ P ( | X | ≥ a )

  31. Proof ¡of ¡Markov’s ¡inequality ¡ � 1 if | X | ≥ a ( X ) = [ |X| ≥ a ] ¡ 0 otherwise ≤ | X | a ≤ E [ | X | ] E[ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ( X ) ] ¡ [ |X| ≥ a ] ¡ a P ( | X | ≥ a ) ≤ E [ | X | ] LHS ¡= ¡ ¡ a

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend