Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
4. Continuous Random Variables and Probability Distributions Li Jie 4.1 Continuous random variables and probability density functions Continuous random variables DEFINTION: A random variable X is said to be continuous if its set of possible values is an entire interval of numbers--that is, if for some A<B, any number X between A and B is possible. Li Jie Example 4.1: If in the study of the ecology of a lake ,we make depth measurements at randomly chosen location, then X=the depth at such a location is a continuous rv. Here A is the minimum depth in the region being sampled, and B is the maximum depth. If the measurement scale of X can be subdivided to any extent desired, then variable is continuous ; if it cannot, the variable is discrete. Li Jie Probability Distributions for Continuous Variables Suppose the variable X of interest is depth of a lake at a randomly chosen point on the surface, let M=the maximum depth, so that any number in the interval [0,M] is a possible value of X. If we “discretize” X by measuring depth to the nearest meter ,then possible value are nonnegative less than or equal to M. the resulting discrete distribution of depth can be pictured using a probability histogram , Li Jie if we draw the histogram so that the area of the rectangle above any possible integer k is the proportion of lake whose depth is k, then the total area of all rectangles is 1. A possible histogram appears in Figure 4.1(a). 4.1(a) Li Jie If depth is measured to the nearest centimeter and the same measurement axis as in Figure 4.1(a) is used ,each rectangle in the resulting probability histogram is much narrower ,though the total area of all rectangles is still 1. A possible histogram is pictured in Figure 4.1(b); 4.1(b) Li Jie if we continue in this way to measure depth more and more finely ,the resulting sequence of histograms approaches a smooth curve, such as pictured in Figure 4.1(c). 4.1(c) Li Jie Between a and b is just the area under the smooth curve between a and b . It is exactly a smooth curve of type pictured in Figure 4.1(c)that specifies a continuous probability distribution. Li Jie DEFINITION: let X be a continuous rv. Then a probability distribution or probability density function of X is f(x) such that for any two numbers a and b with a b , b P(a X b) f ( x)dx a That is ,the probability that X take on a value in the interval [a,b] is the area under the graph of the density function, as illustrated in Figure 4.2. The graph of f(x) is often referred to as the density f(x) curve. a b Figure 4.2 x Li Jie f(x) a b x Figure 4.2 • For f(x) to be a legitimate pdf, it must satisfy the following two conditions: 1. f ( x) ≥0 for all x 2. - f ( x)dx area under the entire graph of f ( x) 1 Li Jie Example 4.3 Suppose take a bus to work , and that every 5 minutes a bus arrives at my stop. Because of variation in the time that I leave my house , I don’t always arrive at the bus stop at the same time, so my waiting time X for the next bus is a continuous rv. The set of possible values of X is the interval [0,5]. One possible pdf for X is 15 0 x 5 f ( x) 0 otherwise the probability that I wait between 1 and 3 minutes is 3 P(1 X 3) f ( x)dx 1 3 1 1 5 x x3 2 dx 5 x 1 5 Li Jie f(x) f(x) P( 1 ≤ X ≤3 ) 0.2 0 Similarly , 0.2 5 x 3 0 1 Figure 4.3 the pdf of Example 4.3 x 2 P(2 X 4) 5 The probability that I wait at least 4 minutes is P(4 X ) f ( x)dx 4 5 1 4 5 x x5 1 dx 5 x4 5 Li Jie Because whenever in Example 4.3 0ab5 P ( a X b) depends only on the length b-a of the interval , X is said to have a uniform distribution. Li Jie DEFINITION:A continuous rv X is said to have a uniform distribution on the interval [A,B] if the pdf of X is 1 AxB f ( x; A, B ) B - A otherwise 0 PROPOSITION: If X is a continuous rv, then for any number c, P( X c) 0 .furthermore, for any two numbers a and b with a<b, P ( a X b) P ( a X b) P ( a X b) P ( a X b) Li Jie EXAMPLE 4.4: “Time headway” in traffic flow is the elapsed time between the time that one car finishes passing a fixed point and the instant that the next car begins to pass that point. Let X=the time headway for two randomly chosen consecutive cars on a freeway during a period of heavy flow. The following pdf of X is essentially the one suggested in “The Statistical Properties of Freeway Traffic” .15e-.15(x-.5) x .5 f ( x) 0 otherwise f(x) .15 2 Figure.54.4 P( X 5) 4 6 8 10 Li Jie x The graph of f(x) is given in figure 4.4; there is no density associated with headway time less than .5, and headway density decreases rapidly (exponentially fast) as x increases from .5.Clearly , f ( x) 0 ;to show that , f ( x)dx 1 we use the calculus result a Then e kx dx ( 1 )e k a k f ( x)dx .15e .15( x 5 ) .5 .15e .075 dx .15e 1 (.15)(.5 ) .15 e .075 .5 e .15 x dx 1 Li Jie The probability that headwawy time is at most 5 sec is 5 5 .5 P( X 5) f ( x)dx .15e .15e.075 .151 e .15x x 5 x .5 .15( x 5) dx .15e .075 5 .5 e.15x dx .491 P( X 5) Li Jie 4.2 Cumulative Distribution Functions and Expected Values The Cumulative Distribution Function DEFINITION: The cumulative distribution function F(x) for a continuous rv X is defined for every number x by x F ( x) P( X x) f ( y)dy for each x, F(x) is the area under the density curve to the left of x. This is illustrated in Figure 4.5 ,where F(x) increases smoothly as x increases . Li Jie f(x) F(x) F(8) F(8) .5 5 10 8 x 5 10 x 8 Figure 4.5 A pdf and associated cdf Li Jie Example 4.5 : Let X have a uniform distribution on [A,B] . The density function is show in Figure 4.6 . For x<A , F(x)=0 , since there is no area under the graph of the density function to the left of such an x . f(x) f(x) 1 BA 1 BA A B x A x B Figure 4.6 The pdf for a uniform distribution Finally , for A x B , 1 1 x A yx F ( x) f ( y )dy dy y y A A B A B A B A x x Li Jie The entire cdf is 0 x A x A F ( x) A x B B A x B 1 the graph of this cdf appears in Figure 4.7. F(x) 1 A B x Figure 4.7 The cdf for a uniform distribution Li Jie Example 4 If the density function of continuous x variable X is f ( x) Ae (a) Determine parameter A (b) Determine the probability of P(0≤X≤1) (c) Determine the distribution function F(x) Solution: (a) x f ( x)dx Ae dx 1 A 1/ 2 (b) 1 P(0 X 1) 0 1 x 1 1 f ( x)dx e dx 1 0 2 2 e 1 Li Jie (c) F ( x) x f (t )dt 1 x t 1 x when x 0, F ( x) e dt e 2 2 1 0 t 1 x t 1 x when x 0, F ( x) e dt e dt 1 e 2 2 0 2 So, the probability distribution function is 1 x 2 e , x 0 F ( x) 1 1 e x , x 0 2 Li Jie • Using F(x) to Compute Probabilities PROPOSITION: Let X be a continuous rv with cdf F(x) . Then for any number a , P( X a) 1 F (a) and for any two numbers a and b with a<b , P(a X b) F (b) F (a) Figure 4.8 illustrates the second part of this proposition; f(x) - = a b b a Figure 4.8 Li Jie Obtaining f(x) from F(x) PROPOSITION: if X is a continuous rv with pdf f(x) and cdf F(x) ,then at every x at which the derivative F’(x) exists , F’(x)=f(x) . Li Jie Percentiles of a Continuous Distribution DEFINITION : Let p be a number between 0 and 1 . The (100p)th percentile of the distribution of a continuous rv X , denoted by ( p) , is defined by ( p) p F ( ( p)) f(x) f ( y)dy F(x) 1 p F ( ( p)) ( p) ( p) Li Jie Example : The distribution of the amount of gravel (in tons ) sold by a particular supply company in a given week is a continuous rv X with pdf 3 (1 x 2 ) 0 x 1 f ( x) 2 otherwise 0 • The cdf of sales is then , for 0<x<1 F ( x) x 0 3 3 y x 3 3 y 3 x 2 (1 y )dy y x 2 2 3 y 0 2 3 Li Jie The graphs of both f(x) and F(x) appear in figure 4.11. The (100p)th percentile of the distribution satisfies the equation 3 ( ( p)) 3 p F ( ( p)) ( p) 2 3 that is ( ( p)) 3 ( p) 2 p 0 3 f(x) F(x) 2 1 .5 0 1 x 0 .347 1 x Li Jie DEFINITION: The median of a continuous distribution , denoted by ~ , is the 50th percentile , so ~ satisfies .5 F (~) . That is ,half the area under ~ the density curve is to the left of and half is to the right of . Li Jie Expected values for Continuous Random Variables DEFINTION : The expected or mean value of continuous rv X with pdf f(x) is X E( X ) x f x dx PROPOSITION: If X is a continuous rv with pdf f(x) and h(X) is any function of X , then Eh( X ) h( X ) h( x) f x dx Li Jie Example 4.10 Two species are competing in a region for control of a limited amount of a certain resource . Let X=the proportion of the resource controlled by species 1 and suppose X has pdf 1 0 x 1 f ( x) 0 otherwise which is a uniform distribution on [0,1]. Then the species that controls the controls the majority of this resource controls the amount 1 X if 0 X 12 h( X ) max( X ,1 X ) 1 X if 2 X 1 Li Jie The expected amount controlled by the species having majority control is then E h( X ) max( x, x 1) f x dx max( x,1 x) 1dx 1 0 1 0 2 3 (1 x) 1dx 1 x 1dx 2 4 1 Li Jie Example : In a bus station, there is a bus starting off at 10th minute, 30th minute, 50th minute in every hour. One customer does not know the time of the bus starting off, so he arrived the station at any random time. Please calculate the expectation of his waiting time. Solution: let X denote the arriving time, Y denote the waiting time. Then X has a uniform distribution in [0,60].Its density function is 1 , 0 x 60 f ( x) 60 0 , otherwise Li Jie Y is function of X, namely Y=g(X) 10 X , 0 X 10 30 X , 10 X 30 Y g( X ) 50 X , 30 X 50 60 X 10, 50 X 60 30 1 10 EY Eg ( X ) [ (10 x )dx (30 x )dx 10 60 0 50 60 30 50 (50 x )dx (70 x )dx ] 10 Other method: let Y denote the waiting time ,then Y has a uniform distribution in [0,20].Then EY 0 20 2 10 Li Jie The Variance Of Continuous Random Variables Definition: the variance of a continuous random variable X with pdf f(x) and mean value is V ( X ) ( x ) 2 f ( x )dx 2 X E[( X ) 2 ] The standard deviation (SD) of X is X V (X ) Li Jie Proposition : V ( X ) E ( X 2 ) [ E ( X )]2 Example : P156 Li Jie 4.3 The Normal Distribution Li Jie DEFINITION:A continuous rv X is said to have a normal distribution with parameters and , where and 0 , if the pdf of X is 1 ( x ) 2 /(22 ) f ( x;, ) e 2 e 2.71828 x 3.14149 Li Jie where is the mean and is called the location paramter, is the standard deviation and is called the scale parameter. Hence denote X ~ N ( , ). Symmetric The left portion of the curve is the mirror image of the right portion Bell-shaped The density in two ends of the distribution function is low. It increases towards the middle of the distribution function and reaches the peak at the median. Li Jie The standard normal distribution DEFINITION: The normal distribution with parameter values 0 and 1 is called a standard normal distribution . A random variable that has a standard normal distribution is called a standard normal random variable and will be denoted by Z. The pdf of Z is 1 z2 / 2 f ( z; 0,1) e z 2 The cdf of Z is P Z z f y;0,1dy, which we will denote by (z ) . z Li Jie Shaded area= (z ) Standard normal (z) curve 0 z Li Jie • Example 4.12 Compute the follow probabilities : P ( Z 1.25) (a) P( Z 1.25) (b) (c) P ( Z 1.25), and (d) P (.38 Z 1.25) a. P(Z 1.25) (1.25) ,a probability that is tabulated in Appendix Table A.3 at the intersection of the row marked 1.2 and the column marked .05. The number there is .8994 ,so P( Z 1.25) .8944 .See Figure 4.15(a). Shaded area= (1.25) z curve 0 1.25 (a) z curve 0 1.25 (b) Figure 4.15 Normal curve areas for examples Li Jie • b. P( Z 1.25) 1 p( Z 1.25), See Figure 4.15(b) . • c. P( Z 1.25) (1.25) ,a lower-tail area . Appendix Table A.3, (1.25) .1056 ,By symmetry of the normal curve , this is the same answer as in part (b) . • d. P(.38 Z 1.25) Is the area under the standard normal curve above the interval whose left endpoint is -.38 and whose right endpoint is 1.25 . From section 4.2 , if X is a continuous rv with cdf F(x) , then P(a X b) F (b) F (a) . This gives P(.38 Z 1.25) 0..5424 - = -.38 0 1.25 0 1.25 -.38 0 Li Jie Percentiles of the Standard Normal Distribution Example 4.13 The 99th percentile of the standard normal distribution is that values is .9900 . The 99th percentile is (approximately) z=2.33. (see Figure 4.17.) By symmetry , the first percentile is the negative of 99th percentile , so equals -2.33(see Figure 4.18) Li Jie z curve Shaded area=.9900 z curve Shared area =.01 0 0 99th percentile Figure 4.17 finding the 99th percentile -2.33=1th percentile 2.33=99th percentile Figure 4.18 The relationship between the 1st and 99th percentiles Li Jie z Notation Notation: z will denote the values on the measurement axis for which of the area under the z curve lies to the right of z . (See Figure 4.19) z curve Shaded area = P ( Z z ) 0 z Figure 4.19 Li Jie • Table 4.1 lists the most useful standard normal percentiles and z values . Percentile (tail area) z 100(1 )th percentile 90 .1 1.28 95 .05 97.5 99 .025 .01 99.5 .005 99.9 .001 99.95 .0005 1.645 1.96 2.33 2.58 3.08 3.27 Li Jie Nonstandard normal distributions PROPOSITION: If X has a normal distribution with mean and standard deviation , then X Z has a standard normal distribution . Thus b a P ( a X b ) P Z b a a P X a b PX b 1 Li Jie Z X μ ~ N (0,1) σ P( Z x) P( X μ x ) P ( X μ σx ) σ μ σx 1 e 2π σ 1 2π x e u2 2 (t μ )2 2σ 2 dt tμ let u σ du Φ( x) Li Jie The key idea of the proposition is that by standardizing , any probability involving X can be expressed as a probability involving a standard normal rv Z , so that Appendix Table A.3 can be used. This is illustrated in Figure 4.21. The proposition can be proved by writing the cdf of Z X PZ z P X σz μ σz μ f x; μ, σ dx Li Jie N , 2 N 0,1 = x 0 Figure 4.21 x Li Jie • Example 4.15 The time that it take a drive to react to the brake lights on a decelerating vehicle is critical in helping to avoid rear-end collisions . The article “ Fast-Rise Brake Lamp as a Collision-Prevention Device” (Ergonomic , 1993:391-395) suggests that reaction time for an in-traffic response to a brake signal from standard brake lights can be modeled with a normal distribution having mean value 1.25 sec and standard deviation of .16 sec . What is the probability that reaction time is between 1.00 sec and 1.75 sec? If we let X denote reaction time , then standardizing gives 1.00 X 1.75 1.00 1.25 X 1.25 1.75 1.25 if and only if .46 .46 .46 Li Jie 1.75 1.25 1.00 1.25 P1.00 X 1.75 P Z .46 .46 P .54 Z 1.09 1.25 1.09 .8621 0.2946 .5675 Normal, 1.25, .46 P1.00 X 1.75 z curve 1.25 1.00 0 -.54 1.75 1.09 Figure 4.22 Li Jie If we view 2 sec as a critically long reaction time , the probability that actual reaction time will exceed this value is 2 1.25 P X 2 P Z PZ 1.63 1 1.63 0.0516 .46 Li Jie Example 4.16 The breakdown voltage of a randomly chosen diode(二极管) of a particular type is known to be normally distributed . What is the probability that a diode’s breakdown voltage is within 1 standard deviation of its mean value ? This question can be answered without knowing either or , as long as the distribution is known to be normal ; in other words , the answer is the same for any normal distribution : P X is within 1 standard deviation of its mean P X P Z P 1.00 Z 1.00 Φ1.00 Φ 1.00 .6826 P 2.00 Z 2.00 0.9544 P 3.00 Z 3.00 0.9974 Li Jie Percentiles Of An Arbitrary Normal Distribution PROPOSITION: 100 p th percentile for normal , 100 p th for standard normal Li Jie 蒸馏水 Example 4.17 The amount of distilled water dispensed by a certain machine is normally distributed with mean value 64 oz and standard deviation .78 oz . What container size c will ensure that overflow occurs only .5% of the time? If X denotes the amount dispensed , the desired condition is that P(X>c)=.005 , or , equivalently ,that P(X<=c)=.995. Thus c is the 99.5th percentile of the normal distribution with 64 and .78 . The 99.5th percentile of the standard normal distribution is 2.58 , so c .995 64 2.58.78 64 2.0 66 oz Li Jie Shaded area=.995 64 C=99.5th percentile=66.0 Figure 4.23 125 Figure 4.24 Li Jie The Exponential Distribution DEFINITION: X is said to have an exponential if the pdf of X is e x x0 f x; where 0 0 otherwise In particular, the cdf of X is 0 F x; x 1 e x0 x0 Li Jie f x; 2 1 .5 2 .5 1 x Figure 4.27 Li Jie The component has lasted a length of time s , and we wish to calculate the probability that it will last at least t more time units; this is ,we wish to find P(T>t+s|T >s): P (T t s and T s ) P (T t s | T s) P (T s ) P (T t s ) e ( t s ) s e t P (T s ) e We see that the probability that unit will last t more time units does not depend on s . The exponential distribution is consequently said to be memoryless. Li Jie Expected values for The Exponential Distribution e x x0 f x; where 0 0 otherwise 0 E ( X ) xf x; λ dx λx xe 0 0 x λe λx dx 1 λx λx e dx e λ Var ( X ) E ( X 2 ) ( E ( X )) 2 0 0 x d ( e λx ) 1 λ 2 1 1 λ2 λ2 λ2 Li Jie X~N(0,1) Example: Suppose X has standard normal distribution, determine the density function of Y, when Y is (1)Y=eX, (2)Y=2X2+1, (3)Y=|X| Solution: the density function of X is 1 x f ( x) e 2 2 /2 ,xR (1) The probability function is F ( y ) P(Y y ) P(e X y ) Li Jie So ,if y<0, then F(y)=0 if y 0, F ( y ) P (Y y ) P (e X y ) P ( X log y ) log y 1 x /2 e dx 2 2 Therefore, the density function of Y is 1 1 log y e 2 , y0 f ( y ) 2 y 0 ,y0 2 Li Jie Similarly (2) The density function is y 1 1 e 4 , y 1 f ( y ) 2 y 1 , y 1 0 (3) The density function is 2 e f ( y) 0 y2 2 , y0 ,y0 Li Jie Exercise 1: Let X has a uniform distribution on (0,1). Identify the distribution of Y X /(1 X ) Exercise 2: Let X has the exponential distribution with mean 1. Determine the density function of Y, when Y is (1)Y=eX (2)Y=X2 Li Jie R.V Function of R.V Cdf, D.R.V C.R.V F(x)=P(X x) Probability mass function (the probability mass function ,or the frequency function) Pi 0 p 1 X ~ Bern(p) X~Bin(n,p) X~P( ) X~Exp( ) XX~N( ~ N (, , ) ) 2 X~N(0,1) i i Probability density function X~U(a,b) f(x) 0 f ( x)dx 1 Non-discreasing right continuous Two limit Li Jie F ( x) P ( X x) x f ( x )dx F ( x ) f ( x ) Li Jie R.V Function of R.V Cdf, D.R.V C.R.V F(x)=P(X x) Probability mass function (the probability mass function ,or the frequency function) Pi 0 p 1 X ~ Bern(p) X~Bin(n,p) X~P( ) X~Exp( ) XX~N( ~ N (, , ) ) 2 X~N(0,1) i i Probability density function X~U(a,b) f(x) 0 f ( x)dx 1 Non-discreasing right continuous Two limit Li Jie Li Jie