cs70 jean walrand lecture 34 uniformly at random in 0 1
play

CS70: Jean Walrand: Lecture 34. Uniformly at Random in [ 0 , 1 ] . - PowerPoint PPT Presentation

CS70: Jean Walrand: Lecture 34. Uniformly at Random in [ 0 , 1 ] . Uniformly at Random in [ 0 , 1 ] . Let [ a , b ] denote the event that the point X is in the interval [ a , b ] . Choose a real number X , uniformly at random in [ 0 , 1 ] . Pr [[ a


  1. CS70: Jean Walrand: Lecture 34. Uniformly at Random in [ 0 , 1 ] . Uniformly at Random in [ 0 , 1 ] . Let [ a , b ] denote the event that the point X is in the interval [ a , b ] . Choose a real number X , uniformly at random in [ 0 , 1 ] . Pr [[ a , b ]] = length of [ a , b ] length of [ 0 , 1 ] = b − a What is the probability that X is exactly equal to 1 / 3? Well, ..., 0. = b − a . 1 Intervals like [ a , b ] ⊆ Ω = [ 0 , 1 ] are events. Continuous Probability 1 More generally, events in this space are unions of intervals. Example: the event A - “within 0 . 2 of 0 or 1” is A = [ 0 , 0 . 2 ] ∪ [ 0 . 8 , 1 ] . What is the probability that X is exactly equal to 0 . 6? Again, 0. Thus, 1. Examples In fact, for any x ∈ [ 0 , 1 ] , one has Pr [ X = x ] = 0. 2. Events Pr [ A ] = Pr [[ 0 , 0 . 2 ]]+ Pr [[ 0 . 8 , 1 ]] = 0 . 4 . How should we then describe ‘choosing uniformly at random in [ 0 , 1 ] ’? 3. Continuous Random Variables Here is the way to do it: More generally, if A n are pairwise disjoint intervals in [ 0 , 1 ] , then Pr [ X ∈ [ a , b ]] = b − a , ∀ 0 ≤ a ≤ b ≤ 1 . Pr [ ∪ n A n ] := ∑ Pr [ A n ] . n Makes sense: b − a is the fraction of [ 0 , 1 ] that [ a , b ] covers. Many subsets of [ 0 , 1 ] are of this form. Thus, the probability of those sets is well defined. We call such sets events. Uniformly at Random in [ 0 , 1 ] . Uniformly at Random in [ 0 , 1 ] . Uniformly at Random in [ 0 , 1 ] . Note: Pr [ X ≤ x ] = x for x ∈ [ 0 , 1 ] . Also, Pr [ X ≤ x ] = 0 for x < 0 and Pr [ X ≤ x ] = 1 for x > 1. Let us define F ( x ) = Pr [ X ≤ x ] . Note: A radical change in approach. For a finite probability space, Ω = { 1 , 2 ,..., N } , we started with Pr [ ω ] = p ω . We then defined Pr [ X ∈ ( a , b ]] = Pr [ X ≤ b ] − Pr [ X ≤ a ] = F ( b ) − F ( a ) . Pr [ A ] = ∑ ω ∈ A p ω for A ⊂ Ω . We used the same approach for countable Ω . An alternative view is to define f ( x ) = d dx F ( x ) = 1 { x ∈ [ 0 , 1 ] } . Then For a continuous space, e.g., Ω = [ 0 , 1 ] , we cannot start with Pr [ ω ] , � b because this will typically be 0. Instead, we start with Pr [ A ] for some F ( b ) − F ( a ) = a f ( x ) dx . events A . Here, we started with A = interval, or union of intervals. Then we have Pr [ X ∈ ( a , b ]] = Pr [ X ≤ b ] − Pr [ X ≤ a ] = F ( b ) − F ( a ) . Thus, the probability of an event is the integral of f ( x ) over the event: Thus, F ( · ) specifies the probability of all the events! � Pr [ X ∈ A ] = A f ( x ) dx .

  2. Uniformly at Random in [ 0 , 1 ] . Uniformly at Random in [ 0 , 1 ] . Nonuniformly at Random in [ 0 , 1 ] . Discrete Approximation: Fix N ≫ 1 and let ε = 1 / N . Think of f ( x ) as describing how Define Y = n ε if ( n − 1 ) ε < X ≤ n ε for n = 1 ,..., N . � ∞ one unit of probability is spread over [ 0 , 1 ] : uniformly! This figure shows a different choice of f ( x ) ≥ 0 with − ∞ f ( x ) dx = 1. Then | X − Y | ≤ ε and Y is discrete: Y ∈ { ε , 2 ε ,..., N ε } . Then Pr [ X ∈ A ] is the probability mass over A . It defines another way of choosing X at random in [ 0 , 1 ] . Also, Pr [ Y = n ε ] = 1 N for n = 1 ,..., N . Observe: Note that X is more likely to be closer to 1 than to 0. Thus, X is ‘almost discrete.’ � x − ∞ f ( u ) du = x 2 for x ∈ [ 0 , 1 ] . ◮ This makes the probability automatically additive. One has Pr [ X ≤ x ] = � x + ε � ∞ Also, Pr [ X ∈ ( x , x + ε )] = f ( u ) du ≈ f ( x ) ε . ◮ We need f ( x ) ≥ 0 and − ∞ f ( x ) dx = 1. x Another Nonuniform Choice at Random in [ 0 , 1 ] . General Random Choice in ℜ Pr [ X ∈ ( x , x + ε )] Let F ( x ) be a nondecreasing function with F ( − ∞ ) = 0 and F (+ ∞ ) = 1. An illustration of Pr [ X ∈ ( x , x + ε )] ≈ f X ( x ) ε : Define X by Pr [ X ∈ ( a , b ]] = F ( b ) − F ( a ) for a < b . Also, for a 1 < b 1 < a 2 < b 2 < ··· < b n , Pr [ X ∈ ( a 1 , b 1 ] ∪ ( a 2 , b 2 ] ∪ ( a n , b n ]] = Pr [ X ∈ ( a 1 , b 1 ]]+ ··· + Pr [ X ∈ ( a n , b n ]] = F ( b 1 ) − F ( a 1 )+ ··· + F ( b n ) − F ( a n ) . Let f ( x ) = d dx F ( x ) . Then, This figure shows yet a different choice of f ( x ) ≥ 0 with � ∞ − ∞ f ( x ) dx = 1. Pr [ X ∈ ( x , x + ε ]] = F ( x + ε ) − F ( x ) ≈ f ( x ) ε . It defines another way of choosing X at random in [ 0 , 1 ] . Note that X is more likely to be closer to 1 / 2 than to 0 or 1. Here, F ( x ) is called the cumulative distribution function (cdf) of X and � 1 / 3 x 2 � 1 / 3 = 2 For instance, Pr [ X ∈ [ 0 , 1 / 3 ]] = 4 xdx = 2 � 9 . f ( x ) is the probability density function (pdf) of X . 0 0 Thus, the pdf is the ‘local probability by unit length.’ Thus, Pr [ X ∈ [ 0 , 1 / 3 ]] = Pr [ X ∈ [ 2 / 3 , 1 ]] = 2 To indicate that F and f correspond to the RV X , we will write them 9 and It is the ‘probability density.’ F X ( x ) and f X ( x ) . Pr [ X ∈ [ 1 / 3 , 2 / 3 ]] = 5 9 .

  3. Discrete Approximation Example: CDF Calculation of event with dartboard.. Example: hitting random location on gas tank. Random location on circle. Probability between . 5 and . 6 of center? 1 Recall CDF. Fix ε ≪ 1 and let Y = n ε if X ∈ ( n ε , ( n + 1 ) ε ] . y Thus, Pr [ Y = n ε ] = F X (( n + 1 ) ε ) − F X ( n ε ) .  0 for y < 0  y 2 Note that | X − Y | ≤ ε and Y is a discrete random variable. F Y ( y ) = Pr [ Y ≤ y ] = for 0 ≤ y ≤ 1 Random Variable: Y distance from center. 1 for y > 1  Also, if f X ( x ) = d dx F X ( x ) , then F X ( x + ε ) − F X ( x ) ≈ f X ( x ) ε . Probability within y of center: area of small circle Hence, Pr [ Y = n ε ] ≈ f X ( n ε ) ε . Pr [ Y ≤ y ] = Pr [ 0 . 5 < Y ≤ 0 . 6 ] = Pr [ Y ≤ 0 . 6 ] − Pr [ Y ≤ 0 . 5 ] area of dartboard Thus, we can think of X of being almost discrete with = F Y ( 0 . 6 ) − F Y ( 0 . 5 ) π y 2 Pr [ X = n ε ] ≈ f X ( n ε ) ε . = y 2 . = = . 36 − . 25 π Hence, = . 11  for y < 0 0  y 2 F Y ( y ) = Pr [ Y ≤ y ] = for 0 ≤ y ≤ 1  1 for y > 1 PDF. Target U [ a , b ] Example: “Dart” board. Recall that  0 for y < 0  y 2 F Y ( y ) = Pr [ Y ≤ y ] = for 0 ≤ y ≤ 1  1 for y > 1  0 for y < 0  f Y ( y ) = F ′ Y ( y ) = 2 y for 0 ≤ y ≤ 1 0 for y > 1  The cumulative distribution function (cdf) and probability distribution function (pdf) give full information. Use whichever is convenient.

  4. Expo ( λ ) Random Variables A Picture The exponential distribution with parameter λ > 0 is defined by Continuous random variable X , specified by f X ( x ) = λ e − λ x 1 { x ≥ 0 } 1. F X ( x ) = Pr [ X ≤ x ] for all x . � 0 , Cumulative Distribution Function (cdf) . if x < 0 F X ( x ) = 1 − e − λ x , Pr [ a < X ≤ b ] = F X ( b ) − F X ( a ) if x ≥ 0 . 1.1 0 ≤ F X ( x ) ≤ 1 for all x ∈ ℜ . 1.2 F X ( x ) ≤ F X ( y ) if x ≤ y . � x − ∞ f X ( u ) du or f X ( x ) = d ( F X ( x )) 2. Or f X ( x ) , where F X ( x ) = . dx Probability Density Function (pdf). The pdf f X ( x ) is a nonnegative function that integrates to 1. � b Pr [ a < X ≤ b ] = a f X ( x ) dx = F X ( b ) − F X ( a ) The cdf F X ( x ) is the integral of f X . 2.1 f X ( x ) ≥ 0 for all x ∈ ℜ . � ∞ 2.2 − ∞ f X ( x ) dx = 1 . Recall that Pr [ X ∈ ( x , x + δ )] ≈ f X ( x ) δ . Think of X taking Pr [ x < X < x + δ ] ≈ f X ( x ) δ discrete values n δ for n = ..., − 2 , − 1 , 0 , 1 , 2 ,... with � x Pr [ X = n δ ] = f X ( n δ ) δ . Pr [ X ≤ x ] = F x ( x ) = − ∞ f X ( u ) du Note that Pr [ X > t ] = e − λ t for t > 0. Summary Continuous Probability 1 1. pdf: Pr [ X ∈ ( x , x + δ ]] = f X ( x ) δ . � x 2. CDF: Pr [ X ≤ x ] = F X ( x ) = − ∞ f X ( y ) dy . b − a 1 { a ≤ x ≤ b } ; F X ( x ) = x − a 1 3. U [ a , b ] : f X ( x ) = b − a for a ≤ x ≤ b . 4. Expo ( λ ) : f X ( x ) = λ exp {− λ x } 1 { x ≥ 0 } ; F X ( x ) = 1 − exp {− λ x } for x ≤ 0 . 5. Target: f X ( x ) = 2 x 1 { 0 ≤ x ≤ 1 } ; F X ( x ) = x 2 for 0 ≤ x ≤ 1.

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