foundations of computer science lecture 19 expected value
play

Foundations of Computer Science Lecture 19 Expected Value The - PowerPoint PPT Presentation

Foundations of Computer Science Lecture 19 Expected Value The Average Over Many Runs of an Experiment Mathematical Expectation: A Number that Summarizes a PDF Conditional Expectation Law of Total Expectation Last Time 1 Random variables.


  1. Foundations of Computer Science Lecture 19 Expected Value The Average Over Many Runs of an Experiment Mathematical Expectation: A Number that Summarizes a PDF Conditional Expectation Law of Total Expectation

  2. Last Time 1 Random variables. ◮ PDF. ◮ CDF. ◮ Joint-PDF. ◮ Independent random variables. 2 Important random variables. ◮ Bernoulli (indicator). ◮ Uniform (equalizer in strategic games). ◮ Binomial (sum of Bernoullis, e.g. number of heads in n coin tosses). ◮ Exponential Waiting Time Distribution (repeated tries till success). Creator: Malik Magdon-Ismail Expected Value: 2 / 15 Today →

  3. Today: Expected Value Expected value approximates the sample average. 1 Mathematical Expectation 2 Examples 3 Sum of dice. Bernoulli. Uniform. Binomial. Waiting time. Conditional Expectaton 4 Law of Total Expectation 5 Creator: Malik Magdon-Ismail Expected Value: 3 / 15 Sample Average →

  4. Sample Average: Toss Two Coins Many Times Sample Space Ω x ∈ X (Ω) ω HH HT TH TT x 0 1 2 → 1 1 1 1 P ( ω ) 4 4 4 4 1 1 1 P X ( x ) 4 2 4 X ( ω ) 2 1 1 0 ← number of heads Creator: Malik Magdon-Ismail Expected Value: 4 / 15 Mathematical Expectation →

  5. Sample Average: Toss Two Coins Many Times Sample Space Ω x ∈ X (Ω) ω HH HT TH TT x 0 1 2 → 1 1 1 1 P ( ω ) 4 4 4 4 1 1 1 P X ( x ) 4 2 4 X ( ω ) 2 1 1 0 ← number of heads Toss two coins and repeat the experiment n = 24 times: HH TH HT HH HH TH TT TT HH TT HT HT HH HT TT HT TT HT HT TH HH TH TT TH 2 1 1 2 2 1 0 0 2 0 1 1 2 1 0 1 0 1 1 1 2 1 0 1 Creator: Malik Magdon-Ismail Expected Value: 4 / 15 Mathematical Expectation →

  6. Sample Average: Toss Two Coins Many Times Sample Space Ω x ∈ X (Ω) ω HH HT TH TT x 0 1 2 → 1 1 1 1 P ( ω ) 4 4 4 4 1 1 1 P X ( x ) 4 2 4 X ( ω ) 2 1 1 0 ← number of heads Toss two coins and repeat the experiment n = 24 times: HH TH HT HH HH TH TT TT HH TT HT HT HH HT TT HT TT HT HT TH HH TH TT TH 2 1 1 2 2 1 0 0 2 0 1 1 2 1 0 1 0 1 1 1 2 1 0 1 Average value of X : 2 + 1 + 1 + 2 + 2 + 1 + 0 + 0 + 2 + 0 + 1 + 1 + 2 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 2 + 1 + 0 + 1 = 24 24 = 1 . 24 Creator: Malik Magdon-Ismail Expected Value: 4 / 15 Mathematical Expectation →

  7. Sample Average: Toss Two Coins Many Times Sample Space Ω x ∈ X (Ω) ω HH HT TH TT x 0 1 2 → 1 1 1 1 P ( ω ) 4 4 4 4 1 1 1 P X ( x ) 4 2 4 X ( ω ) 2 1 1 0 ← number of heads Toss two coins and repeat the experiment n = 24 times: HH TH HT HH HH TH TT TT HH TT HT HT HH HT TT HT TT HT HT TH HH TH TT TH 2 1 1 2 2 1 0 0 2 0 1 1 2 1 0 1 0 1 1 1 2 1 0 1 Average value of X : 2 + 1 + 1 + 2 + 2 + 1 + 0 + 0 + 2 + 0 + 1 + 1 + 2 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 2 + 1 + 0 + 1 = 24 24 = 1 . 24 Re-order outcomes: TT TT TT TT TT TT HT HT HT HT HT HT HT TH TH TH TH TH HH HH HH HH HH HH n 0 = 6 n 1 = 12 n 2 = 6 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 Creator: Malik Magdon-Ismail Expected Value: 4 / 15 Mathematical Expectation →

  8. Sample Average: Toss Two Coins Many Times Sample Space Ω x ∈ X (Ω) ω HH HT TH TT x 0 1 2 → 1 1 1 1 P ( ω ) 4 4 4 4 1 1 1 P X ( x ) 4 2 4 X ( ω ) 2 1 1 0 ← number of heads Toss two coins and repeat the experiment n = 24 times: HH TH HT HH HH TH TT TT HH TT HT HT HH HT TT HT TT HT HT TH HH TH TT TH 2 1 1 2 2 1 0 0 2 0 1 1 2 1 0 1 0 1 1 1 2 1 0 1 Average value of X : 2 + 1 + 1 + 2 + 2 + 1 + 0 + 0 + 2 + 0 + 1 + 1 + 2 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 2 + 1 + 0 + 1 = 24 24 = 1 . 24 Re-order outcomes: TT TT TT TT TT TT HT HT HT HT HT HT HT TH TH TH TH TH HH HH HH HH HH HH n 0 = 6 n 1 = 12 n 2 = 6 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 Average value of X : 6 × 0 + 12 × 1 + 6 × 2 = 24 n 24 Creator: Malik Magdon-Ismail Expected Value: 4 / 15 Mathematical Expectation →

  9. Mathematical Expectation of a Random Variable X TT TT TT TT TT TT HT HT HT HT HT HT HT TH TH TH TH TH HH HH HH HH HH HH n 0 = 6 n 1 = 12 n 2 = 6 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 Creator: Malik Magdon-Ismail Expected Value: 5 / 15 Expected Number of Heads →

  10. Mathematical Expectation of a Random Variable X TT TT TT TT TT TT HT HT HT HT HT HT HT TH TH TH TH TH HH HH HH HH HH HH n 0 = 6 n 1 = 12 n 2 = 6 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 Average value of X : n 0 × 0 + n 1 × 1 + n 2 × 2 + n 3 × 3 n Creator: Malik Magdon-Ismail Expected Value: 5 / 15 Expected Number of Heads →

  11. Mathematical Expectation of a Random Variable X TT TT TT TT TT TT HT HT HT HT HT HT HT TH TH TH TH TH HH HH HH HH HH HH n 0 = 6 n 1 = 12 n 2 = 6 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 Average value of X : n 0 × 0 + n 1 × 1 + n 2 × 2 + n 3 × 3 n 0 × 0 + n 1 × 1 + n 2 = × 2 n n n n ↑ ↑ ↑ ≈ P X (0) ≈ P X (1) ≈ P X (2) Creator: Malik Magdon-Ismail Expected Value: 5 / 15 Expected Number of Heads →

  12. Mathematical Expectation of a Random Variable X TT TT TT TT TT TT HT HT HT HT HT HT HT TH TH TH TH TH HH HH HH HH HH HH n 0 = 6 n 1 = 12 n 2 = 6 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 Average value of X : n 0 × 0 + n 1 × 1 + n 2 × 2 + n 3 × 3 n 0 × 0 + n 1 × 1 + n 2 = × 2 n n n n ↑ ↑ ↑ ≈ P X (0) ≈ P X (1) ≈ P X (2) ≈ P X (0) × 0 + P X (1) × 1 + P X (2) × 2 Creator: Malik Magdon-Ismail Expected Value: 5 / 15 Expected Number of Heads →

  13. Mathematical Expectation of a Random Variable X TT TT TT TT TT TT HT HT HT HT HT HT HT TH TH TH TH TH HH HH HH HH HH HH n 0 = 6 n 1 = 12 n 2 = 6 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 Average value of X : n 0 × 0 + n 1 × 1 + n 2 × 2 + n 3 × 3 n 0 × 0 + n 1 × 1 + n 2 = × 2 n n n n ↑ ↑ ↑ ≈ P X (0) ≈ P X (1) ≈ P X (2) ≈ P X (0) × 0 + P X (1) × 1 + P X (2) × 2 = x ∈ X (Ω) x · P X ( x ) � For two coins the expected value is 0 × 1 4 + 1 × 1 2 + 2 × 1 4 = 1. Add the possible values x weighted by their probabilities P X ( x ) , E [ X ] = x ∈ X (Ω) x · P X ( x ) . � Synonyms: Expectation; Expected Value; Mean; Average. � Important Exercise. Show that E [ X ] = X ( ω ) P ( ω ). ω ∈ Ω Creator: Malik Magdon-Ismail Expected Value: 5 / 15 Expected Number of Heads →

  14. Expected Number of Heads from 3 Coin Tosses is 1 1 2 ! E [ X ] = x ∈ X (Ω) x · P X ( x ) . � Creator: Malik Magdon-Ismail Expected Value: 6 / 15 Expected Sum of Two Dice →

  15. Expected Number of Heads from 3 Coin Tosses is 1 1 2 ! E [ X ] = x ∈ X (Ω) x · P X ( x ) . � Sample Space Ω x ∈ X (Ω) ω HHH HHT HTH HTT THH THT TTH TTT x 0 1 2 3 → 1 1 1 1 1 1 1 1 P ( ω ) 1 3 3 1 8 8 8 8 8 8 8 8 P X ( x ) 8 8 8 8 X ( ω ) 3 2 2 1 2 1 1 0 Creator: Malik Magdon-Ismail Expected Value: 6 / 15 Expected Sum of Two Dice →

  16. Expected Number of Heads from 3 Coin Tosses is 1 1 2 ! E [ X ] = x ∈ X (Ω) x · P X ( x ) . � Sample Space Ω x ∈ X (Ω) ω HHH HHT HTH HTT THH THT TTH TTT x 0 1 2 3 → 1 1 1 1 1 1 1 1 P ( ω ) 1 3 3 1 8 8 8 8 8 8 8 8 P X ( x ) 8 8 8 8 X ( ω ) 3 2 2 1 2 1 1 0 E [ number heads ] = 0 × 1 8 + 1 × 3 8 + 2 × 3 8 + 3 × 18 12 = 8 = 1 1 2 . What does this mean?!? Exercise. Let X be the the value of a fair die roll. Show that E [ X ] = 3 1 2 . Creator: Malik Magdon-Ismail Expected Value: 6 / 15 Expected Sum of Two Dice →

  17. Expected Sum of Two Dice Probability Space X = sum 1 1 1 1 1 1 7 8 9 10 11 12 36 36 36 36 36 36 1 1 1 1 1 1 Die 2 Value 6 7 8 9 10 11 36 36 36 36 36 36 1 1 1 1 1 1 5 6 7 8 9 10 36 36 36 36 36 36 x 2 3 4 5 6 7 8 9 10 11 12 1 1 1 1 1 1 4 5 6 7 8 9 1 2 3 4 5 6 5 4 3 4 1 36 36 36 36 36 36 P X ( x ) 1 1 1 1 1 1 36 36 36 36 36 36 36 36 36 36 36 3 4 5 6 7 8 36 36 36 36 36 36 1 1 1 1 1 1 2 3 4 5 6 7 36 36 36 36 36 36 Die 1 Value Die 1 Value Creator: Malik Magdon-Ismail Expected Value: 7 / 15 Bernoulli →

  18. Expected Sum of Two Dice Probability Space X = sum 1 1 1 1 1 1 7 8 9 10 11 12 36 36 36 36 36 36 1 1 1 1 1 1 Die 2 Value 6 7 8 9 10 11 36 36 36 36 36 36 1 1 1 1 1 1 5 6 7 8 9 10 36 36 36 36 36 36 x 2 3 4 5 6 7 8 9 10 11 12 1 1 1 1 1 1 4 5 6 7 8 9 1 2 3 4 5 6 5 4 3 4 1 36 36 36 36 36 36 P X ( x ) 1 1 1 1 1 1 36 36 36 36 36 36 36 36 36 36 36 3 4 5 6 7 8 36 36 36 36 36 36 1 1 1 1 1 1 2 3 4 5 6 7 36 36 36 36 36 36 Die 1 Value Die 1 Value � E [ X ] = x x · P X ( x ) Creator: Malik Magdon-Ismail Expected Value: 7 / 15 Bernoulli →

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