Math 8A Lecture 6 Friday May 7 th Epectation Recall the three main probability density functions so far () Uniform () Eponential (3) Power Law e, ( ),
Math 8A Lecture 6 Friday May 7 th Epectation Eample : Determine the epectation of a random variable with each of the three density functions listed above. Solution : For X ~ unif[ a, b] E( X) b d a b a ) ( b a b a a b
Math 8A Lecture 6 Friday May 7 th Epectation Solution continued For parts integration by e d e d e e d e E(X) ep() ~ X
Math 8A Lecture 6 Friday May 7 th Epectation Solution continued For X ~ ep() that was to be epected: if the rate of arrival of particles is in one unit of time, then the epected length of time between arrivals is. This is reminiscent of the geometric distribution: it is a continuous version of the geometric distribution.
Math 8A Lecture 6 Friday May 7 th Epectation Solution continued The final case is E( X) ( ) ( ) d d X ~ power( ) The evaluation of this integral depends on the value of
Math 8A Lecture 6 Friday May 7 th Epectation Solution continued Case. If we get infinite epectation: E( X) ( ) lim ( )
Math 8A Lecture 6 Friday May 7 th Epectation Solution continued Case. If epectation: similarly we get infinite E( X) ( ) ln
Math 8A Lecture 6 Friday May 7 th Epectation Solution continued Case 3. If then we get finite epectation: E( X) ( )
Math 8A Lecture 6 Friday May 7 th Epectation Eample : We consider a different density function. Let X be the distance to the origin from a randomly uniformly chosen point in the unit quarter circle. Determine the epected distance from the origin to the random point. Solution : To find the epectation, we need the probability density function of X.
Math 8A Lecture 6 Friday May 7 th Epectation Solution continued We compute the cdf to be F ( ) P( X ) Area( Area( ) ) and therefore the pdf of X is f ( ) F ( )
Math 8A Lecture 6 Friday May 7 th Epectation Solution continued Now the epectation is E( X ) f ( ) d 3 d
Math 8A Lecture 6 Friday May 7 th Moments and variance For a general function h(x) we define E( h ( X)) h( ) f ( ) d and in particular the variance of X is var( X) E( X ) E( X)
Math 8A Lecture 6 Friday May 7 th Epectation Eample : Compute the variance of the distance to a random point in the unit quarter circle from the origin. Solution : The probability density function is f ( )
Math 8A Lecture 6 Friday May 7 th Continuous distributions Solution continued For the variance we need the second moment E( X ) f 3 ( ) d d
Math 8A Lecture 6 Friday May 7 th Variance Solution continued and finally var( X) E( X ) E( X) 3 8
Math 8A Lecture 6 Friday May 7 th Variance Eample : Compute the variance of the eponential distribution function. Solution : The second moment is E( X ) e e d e d E( X)
Math 8A Lecture 6 Friday May 7 th Variance Solution continued Therefore we obtain var( X) E( X)
Math 8A Lecture 6 Friday May 7 th Medians Another important concept in statistics is a median of a random variable. A median of a random variable X is defined as a point m such that P( X m) and P( X m) A random variable has many medians in general.
Math 8A Lecture 6 Friday May 7 th Medians Eample : Determine a median of for a random variable X ~ ep( ) Solution : We have to solve for a number m such that P( X m) and P( X m)
Math 8A Lecture 6 Friday May 7 th Medians Solution continued Let s first find the cdf, F() : F( ) e f ( t) dt e t dt
Math 8A Lecture 6 Friday May 7 th Medians Solution continued Now we want to find m with m m e and e Putting both equal we get e which implies m log m
Math 8A Lecture 6 Friday May 7 th Medians Eample : Suppose that X has a geometric distribution with success probability p. Determine a median for X. Solution : We have to solve for a positive integer m such that m p( p) and m p( p)
Math 8A Lecture 6 Friday May 7 th Medians Solution continued The sums are geometric and can be computed. So we require ( p) m m and solving for m we get and ( p) log log m m log log and p p
Math 8A Lecture 6 Friday May 7 th Medians Solution continued We conclude that any number in the interval [ c, c] is a median where c log log p