alex psomas lecture 16 random variables questions about
play

Alex Psomas: Lecture 16. Random Variables Questions about outcomes - PowerPoint PPT Presentation

Alex Psomas: Lecture 16. Random Variables Questions about outcomes ... Experiment: roll two dice. Sample Space: { ( 1 , 1 ) , ( 1 , 2 ) ,..., ( 6 , 6 ) } = { 1 ,..., 6 } 2 How many dots? Random Variables Experiment: flip 100 coins. Sample


  1. Alex Psomas: Lecture 16. Random Variables Questions about outcomes ... Experiment: roll two dice. Sample Space: { ( 1 , 1 ) , ( 1 , 2 ) ,..., ( 6 , 6 ) } = { 1 ,..., 6 } 2 How many dots? Random Variables Experiment: flip 100 coins. Sample Space: { HHH ··· H , THH ··· H ,..., TTT ··· T } 1. Random Variables. How many heads in 100 coin tosses? 2. Distributions. I Regrade requests open. Experiment: choose a random student in cs70. I Quiz due tomorrow. 3. Combining random variables. Sample Space: { Peter , Phoebe ,..., } 4. Expectation I Quiz coming out today. What midterm score? I Non-technical office hours tomorrow 1-3pm. Experiment: hand back assignments to 3 students at random. I Anonymous questionnaire tonight or tomorrow. Sample Space: { 123 , 132 , 213 , 231 , 312 , 321 } How many students get back their own assignment? In each scenario, each outcome gives a number. The number is a (known) function of the outcome. Random Variables. Example 1 of Random Variable Example 2 of Random Variable A random variable, X , for an experiment with sample space Ω is a function X : Ω ! ℜ . Thus, X ( · ) assigns a real number X ( ω ) to each ω 2 Ω . Experiment: roll two dice. Sample Space: { ( 1 , 1 ) , ( 1 , 2 ) ,..., ( 6 , 6 ) } = { 1 ,..., 6 } 2 Experiment: flip three coins Random Variable X : number of pips. Sample Space: { HHH , THH , HTH , TTH , HHT , THT , HTT , TTT } X ( 1 , 1 ) = 2 Winnings: if win 1 on heads, lose 1 on tails: X X ( 1 , 2 ) = 3, X ( HHH ) = 3 X ( THH ) = 1 X ( HTH ) = 1 X ( TTH ) = � 1 . . X ( HHT ) = 1 X ( THT ) = � 1 X ( HTT ) = � 1 X ( TTT ) = � 3 . X ( 6 , 6 ) = 12, X ( a , b ) = a + b , ( a , b ) 2 Ω . The function X ( · ) is defined on the outcomes Ω . A random variable X is not random, not a variable! What varies at random (from experiment to experiment)? The outcome!

  2. Number of dots in two dice. Distribution Handing back assignments “What is the likelihood of seeing n dots?” The probability of X taking on a value a . Experiment: hand back assignments to 3 students at random. Definition: The distribution of a random variable X , is Sample Space: Ω = { 123 , 132 , 213 , 231 , 312 , 321 } { ( a , Pr [ X = a ]) : a 2 A } , where A is the range of X . How many students get back their own assignment? Random Variable: values of X ( ω ) : { 3 , 1 , 1 , 0 , 0 , 1 } Distribution: 8 0 , w.p. 1 / 3 < X = 1 , w.p. 1 / 2 0 . 4 3 , w.p. 1 / 6 : 0 . 2 Pr [ X = a ] := Pr [ X � 1 ( a )] where X � 1 ( a ) := { ω | X ( ω ) = a } . 0 0 1 2 3 Pr [ X = 10 ] = 3 / 36 = Pr [ X � 1 ( 10 )] = ∑ ω 2 X � 1 ( 10 ) Pr [ ω ] Pr [ X = 8 ] = 5 / 36 = Pr [ X � 1 ( 8 )] . Flip three coins Number of dots. The Bernoulli distribution Experiment: flip three coins Sample Space: { HHH , THH , HTH , TTH , HHT , THT , HTT , TTT } Experiment: roll two dice. Flip a coin, with heads probability p . Winnings: if win 1 on heads, lose 1 on tails. X Random variable X : 1 is heads, 0 if not heads. Random Variable: { 3 , 1 , 1 , � 1 , 1 , � 1 , � 1 , � 3 } X has the Bernoulli distribution. Distribution: We will also call this an indicator random variable . It indicates whether the event happened. 8 � 3 , w. p. 1 / 8 > > � 1 , w. p. 3 / 8 Distribution: < 0 . 4 X = 1 , w. p. 3 / 8 > 0 . 3 ( > 3 w. p. 1 / 8 1 w.p. p : X = 0 . 2 0 w.p. 1 � p 0 . 1 0 � 3 � 2 � 1 0 1 2 3

  3. The binomial distribution. The binomial distribution. Combining Random Variables. Let X and Y be two RV on the same probability space. Flip n coins with heads probability p . That is, X : Ω ! ℜ assigns the value X ( ω ) to ω . Also, Random variable: number of heads. Y : Ω ! ℜ assigns the value Y ( ω ) to ω . Binomial Distribution: Pr [ X = i ] , for each i . Then Z = X + Y is a random variable: It assigns the value How many sample points in event “ X = i ”? � n Z ( ω ) = X ( ω )+ Y ( ω ) i heads out of n coin flips = � ) i Sample space: Ω = { HHH ... HH , HHH ... HT ,... } to outcome ω . What is the probability of ω if ω has i heads? Experiment: Roll two dice. X = outcome of first die, Y = Probability of heads in any position is p . outcome of second die. Probability of tails in any position is ( 1 � p ) . So, we get Pr [ ω ] = p i ( 1 � p ) n � i . X ( a , b ) = a and Y ( a , b ) = b for ( a , b ) 2 Ω = { 1 ,..., 6 } 2 . Probability of “ X = i ” is sum of Pr [ ω ] , ω 2 “ X = i ”. Then Z = X + Y = sum of two dice is defined by ✓ n ◆ p i ( 1 � p ) n � i , i = 0 , 1 ,..., n : B ( n , p ) distribution Pr [ X = i ] = i Z ( a , b ) = X ( a , b )+ Y ( a , b ) = a + b . Combining Random Variables Expectation. Expectation - Intuition How did people do on the midterm? Flip a loaded coin with Pr [ H ] = p a large number N of times. Distribution. We expect heads to come up a fraction p of the times and tails a fraction 1 � p . Summary of distribution? Say that you get 5 for every H and 3 for every T . Average! Other random variables: If there are N H outcomes equal to H and N T outcomes equal to I X k : Ω ! ℜ is defined by X k ( ω ) = [ X ( ω )] k . T , you collect In the dice example, X 3 ( a , b ) = a 3 . 5 ⇥ N H + 3 ⇥ N T . I ( X � 2 ) 2 + 4 XY assigns the value Your average gain per experiment is ( X ( ω ) � 2 ) 2 + 4 X ( ω ) Y ( ω ) to ω . I g ( X , Y , Z ) assigned the value g ( X ( ω ) , Y ( ω ) , Z ( ω )) to ω . 5 N H + 3 N T . N Since N H N ⇡ p = Pr [ X = 5 ] and N T N ⇡ 1 � p = Pr [ X = 3 ] , we find that the average gain per outcome is approximately equal to 5 Pr [ X = 5 ]+ 3 Pr [ X = 3 ] . We use this frequentist interpretation as a definition.

  4. Expectation - Definition Expectation: A Useful Fact An Example Theorem: Definition: The expected value of a random variable X is Flip a fair coin three times. E [ X ] = ∑ E [ X ] = ∑ X ( ω ) ⇥ Pr [ ω ] . a ⇥ Pr [ X = a ] . Ω = { HHH , HHT , HTH , THH , HTT , THT , TTH , TTT } . ω 2 Ω a X = number of H ’s: { 3 , 2 , 2 , 2 , 1 , 1 , 1 , 0 } . a in the range of X . Proof: = ∑ The expected value is also called the mean. E [ X ] a ⇥ Pr [ X = a ] Thus, a According to our intuition, we expect that if we repeat an = ∑ X ( ω ) Pr [ ω ] = { 3 + 2 + 2 + 2 + 1 + 1 + 1 + 0 } ⇥ 1 ∑ Pr [ ω ] a ⇥ ∑ 8 . experiment a large number N of times and if X 1 ,..., X N are the a ω : X ( ω )= a successive values of the random variable, then ω = ∑ ∑ a ⇥ Pr [ ω ] Also, X 1 + ··· + X N a ω : X ( ω )= a ⇡ E [ X ] . = ∑ ∑ N X ( ω ) Pr [ ω ] a ⇥ Pr [ X = a ] = 3 ⇥ 1 8 + 2 ⇥ 3 8 + 1 ⇥ 3 8 + 0 ⇥ 1 ∑ 8 . a ω : X ( ω )= a That is indeed the case, in the same way that the fraction of a = ∑ X ( ω ) Pr [ ω ] times that X = x approaches Pr [ X = x ] . ω This (nontrivial) result is called the Law of Large Numbers. Expectation and Average. Handing back assignments Win or Lose. There are n students in the class; We give back assignments randomly to three students. What is the expected number of students that get their own X ( m ) = score of student m , for m = 1 , 2 ,..., n . assignment back? “Average score” of the n students: add scores and divide by n : Expected winnings for heads/tails games, with 3 flips? The expected number of fixed points in a random permutation. Every time it’s H ,I get 1,. Every time it’s T , I lose 1. Average = X ( 1 )+ X ( 1 )+ ··· + X ( n ) Expected value of a random variable: . n E [ X ] = 3 ⇥ 1 8 + 1 ⇥ 3 8 � 1 ⇥ 3 8 � 3 ⇥ 1 8 = 0 . E [ X ] = ∑ a ⇥ Pr [ X = a ] . Experiment: choose a student uniformly at random. a Uniform sample space: Ω = { 1 , 2 , ··· , n } , Pr [ ω ] = 1 / n , for all ω . Can you ever win 0? Random Variable: midterm score: X ( ω ) . For 3 students (permutations of 3 elements): Expectation: Apparently: expected value is not a common value, by any X ( ω ) 1 E ( X ) = ∑ X ( ω ) Pr [ ω ] = ∑ n . means. Pr [ X = 3 ] = 1 / 6 , Pr [ X = 1 ] = 3 / 6 , Pr [ X = 0 ] = 2 / 6 . ω ω Hence, E [ X ] = 3 ⇥ 1 6 + 1 ⇥ 3 6 + 0 ⇥ 2 6 = 1 . Average = E ( X ) . Our intuition matches the math.

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