Chapter 3 Continuous Random Variables 3.2 – Definitions Definition 3.2.1 A random variable X is said to be continuous if there exists a function f called the probability density function (p.d.f ) which is continuous at all but a finite number of points and satisfies the following three properties: 1. f ( x) 0 for all x 2. f ( x) dx 1 b 3. P(a X b) f ( x) dx a The c.d.f. • The cumulative distribution function (c.d.f.) of a continuous random variable X is F ( x) P( X x) x f (t ) dt • An important relationship: d x F ( x) f (t ) dt f ( x) dx Example 3.2.1 Suppose that X is a continuous random variable with range [1, 2] and p.d.f 2 x 2 1 x 2 f ( x) elsewhere 0 Verify Property 2: 2 f ( x) dx 2 x 2 dx x 2 x (4 4) (1 2) 1 1 2 2 1 Example 3.2.1 • Calculate 𝑃(1 < 𝑋 ≤ 1.25): P(1 X 1.25) 1.25 1 2 x 2 dx x 2 x 2 1.25 1 (1.252 2(1.25)) (1 2) 0.0625 • Find the c.d.f.: F ( x) P( X x) x f (t ) dt x 1 0 x 2t 2 dt x 2 2 x 1 1 x 2 1 x2 1 Definition 3.2.2 Let X be a continuous random variable with p.d.f. f (x) Mean : E ( X ) x f ( x) dx Variance : Var ( X ) E ( X ) ( x ) 2 f ( x) dx 2 2 Standard Deviation : Var ( X ) Moment - generating function : M (t ) E e etx f ( x ) dx tX Expected value of u ( X ) : E[u ( X )] u ( x) f ( x) dx Example 3.2.2 2 x 2 1 x 2 f ( x) elsewhere 0 Mean : 2 1 2 2 3 5 2 x(2 x 2) dx x x 3 3 1 Variance : 2 2 1 1 ( x 5 / 3) (2 x 2) dx 18 2 x2 m.g.f.: M (t ) 2 1 x 1 1 e (2 x 2) dx 2e 2 t x 1 t tx tx 1 1 t 1 2e 2 2e 2 for t 0 t t t 2t Percentiles Definition 3.2.3 Let X be continuous random variable with p.d.f. f and c.d.f. F, and let p be a number between 0 and 1. The (100p)th percentile is a value of X, denoted πp, such that p p f ( x) dx F p • The 50th percentile is called the median and is denoted m. • The mode of X is the value x for which f is maximum. Special Percentiles • 25th – First Quartile – p1 = π0.25 • 50th – Second Quartile – p2 = π0.50 = m • 75th – Third Quartile – p3 = π0.75 Example 3.2.4 2 x 2 1 x 2 f ( x) F ( x) x 2 2 x 1 for 1 x 2 elsewhere 0 Find p1 0.25 : Solve the quadratic 0.25 F 0.25 0.25 2 0.25 1 0.25 1.5 2 3.3 – Uniform and Exponential Definition 3.3.1 A continuous random variable X has a uniform distribution if its p.d.f. is 1 f ( x) b a 0 a xb otherwise where a < b are any real numbers. The phrases “X is U(a, b)” and “X is uniformly distributed over [a, b]” mean that X has this type of distribution. Uniform Distribution Mean : b a b 1 1 x x dx ba ba 2 a 1 b2 a 2 ba 2 2 (b a )(b a ) 1 2 ba ab 2 (b a ) 2 2 Variance : 12 2 etb eta m.g.f.: M (t ) ,t 0 t (b a ) Example 3.3.2 The owner of a local gas station observes that customers typically purchase between five and 20 gallons of gasoline at each fill-up and that no amount is more frequent than any other. If gas costs $2.50 per gallon, find the probability that a randomly selected customer spends more than $30 on gas. Example 3.3.2 Let X = gallons of gas purchased by a customer – Assume X is U(5, 20) – 𝑓 𝑥 = 1/15 for 5 < 𝑥 ≤ 20 Let Y = amount of money spent by a customer – Y = 2.5X P(Y 30) P(2.5 X 30) P( X 12) 20 1 8 dx 0.533 12 20 5 15 Exponential Distribution Definition 3.3.2 A random variable X has an exponential distribution if its p.d.f. is e x f x 0 x0 otherwise where 𝜆 > 0 – Describes waiting time between events that are described by a Poisson distribution Exponential Distribution m.g.f.: M (t ) Mean : t 1 Variance : 2 1 2 c.d.f.: F ( x) P( X x) F x x x f t dt e t dt 1 e x for x 0 0 P( X x) 1 P ( X x) 1 1 e x e x for x 0 Example 3.3.6 Suppose a manufacturer of electrical wire observes a mean of 0.5 defects per 100 ft of wire. Find the mean distance between defects (in ft) and find the probability that the distance between one defect and the next is less than 125 ft. – Assume the number of defects per ft has a Poisson distribution 0.5 defects 0.005 defects/ft 100 ft Example 3.3.6 Let X = the distance in ft between defects – “Wait time” between defects – X is exponential with 𝜆 = 0.005 1 Mean : 200 0.005 P( X 125) F (125) 1 e 0.005(125) 0.465 3.4 – The Normal Distribution Definition 3.4.1 A continuous random variable Z has a standard normal distribution if its p.d.f. is 1 z 2 /2 f ( z) e for z 2 m.g.f.: M (t ) e Mean : 0 t 2 /2 Variance : 2 1 The c.d.f. ( z ) P( Z z ) z 1 t 2 /2 e dt 2 See Table C.1 – Two important properties 1. P( Z z ) 1 P( Z z ) 1 ( z ) 2. P(a Z b) (b) (a ) Example 3.4.1 P( Z 2.05) 0.9798 P( Z 1.23) 1 (1.23) 1 0.1093 0.8907 P(2.65 Z 0.23) (0.23) (2.65) 0.5910 0.0040 0.5870 The Normal Distribution Definition 3.4.2 A continuous random variable X has a normal distribution if its p.d.f. is ( x )2 / 2 2 1 f ( x) e for x 2 where μ is any real number and σ > 0 – The phrase “X is 𝑁 𝜇, 𝜎 2 ” means that X has a normal distribution with parameters μ and σ Mean : Variance : 2 2t 2 m.g.f. : M (t ) exp t 2 The Normal Distribution Empirical Rule P( X ) 0.68, P( 2 X 2 ) 0.95 and P( 3 X 3 ) 0.997 Relationship Theorem 3.4.1 If X is 𝑁 𝜇, 𝜎 2 then the random 𝑋−𝜇 variable 𝑍 = is 𝑁 0, 1 𝜎 Proof: We find the c.d.f. of Z: X F ( z ) P( Z z ) P z P ( X z ) z ( x )2 / 2 2 1 e dx 2 Let 𝑦 = (𝑥 − 𝜇)/𝜎 so that 𝑑𝑦 = 1/𝜎 𝑑𝑥, x y , and ( z ) x z y z Thus 1 y 2 /2 F ( z) e dy ( z ) 2 so Z has the same c.d.f. as that of a standard normal random variable. Therefore, it must have the same p.d.f., and we conclude that Z is N (0, 1). z Application X x P( X x) P The “z-score” of x is z x P( X x) P Z z ( z ) Example 3.4.2 Consider the random experiment of choosing a woman at random and measuring her height. Let the random variable X be the height in inches. Assuming that X is 𝑁 63.6, 2.52 , find the probability of selecting a woman who is between 60 and 62 inches tall. Example 3.4.2 We want 𝑃(60 < 𝑋 ≤ 62) – Calculate z-scores: 60 63.6 62 63.6 z1 1.44 and z2 0.64 2.5 2.5 P(60 X 62) P(1.44 Z 0.64) (0.64) (1.44) 0.2611 0.0749 0.1862 3.5 – Functions of Continuous Random Variables Goal: To find the p.d.f. of a variable defined in terms of another variable – An important relationship d x F ( x) f (t ) dt f ( x) dx – Second Fundamental Theorem of Calculus d u ( x) du f (t ) dt f (u ( x)) dx a dx Example 3.5.2 Consider the random variable X with range 0 < 𝑥 < 1 and p.d.f. 𝑓𝑥 𝑥 = 5𝑥 4 . Define the variable 𝑌 = 𝑋 2 . Find the p.d.f. of Y. – Find the c.d.f. FY ( y ) P(Y y ) P X y P X y 5 x 4 dx 2 y 0 – Find the p.d.f. d y 4 fY ( y ) 5 x dx 5 0 dy y 4 1 5 3/2 y , 0 y 1 2 y 2 Simulations Theorem 3.5.1 Let Y be a random variable that is 𝑈(0, 1) and let 𝐹(𝑥) satisfy the requirements of a c.d.f. of a continuous random variable with certain properties. – Let 𝐹 −1 denote the inverse of the function 𝐹 – Define the random variable 𝑋 = 𝐹 −1 (𝑌) – Then 𝑋 has the c.d.f. 𝐹(𝑥) Example 3.5.4 Generate values of a random variable X with an exponential distribution 1. Find the c.d.f.: 𝐹 𝑥 = 1 − 𝑒 −𝜆𝑥 2. Find 𝐹 −1 (𝑦) y 1 e x x 1 ln 1 y F 1 y 1 ln 1 y Example 3.5.4 3. Use software to generate values of a random variable Y that is 𝑈(0, 1) – Suppose 𝜆 = 2 – 𝑦𝑖 - Values of Y – 𝑥𝑖 - Values of X 3.6 – Joint Distributions Definition 3.6.2 Let X and Y be two continuous random variables. The joint probability density function, or joint p.d.f., is an integrable function f(x, y) that satisfies the following three properties: 1. 0 f ( x, y ) for all x and y 2. f ( x, y ) dy dx 1 3. if S is a subset of the two-dimensional plane, then P ( X ,Y ) S f ( x, y ) dy dx S Marginal Distributions The marginal probability density functions, or marginal p.d.f.’s, of X and Y are f X ( x) f ( x, y ) dy and fY ( y ) f ( x, y ) dx Definition 3.6.3 Two discrete or continuous random variables X and Y are said to be independent if f ( x, y ) f X ( x ) fY ( y ) Example 3.6.3 Suppose the joint p.d.f. of X and Y is 1/ 2 0 x 1, 0 y 2 f x, y otherwise 0 Note f ( x, y ) dy dx 1 2 0 0 1 1 1 1 dy dx 2 dx (2) 1 2 2 0 2 1 f X ( x) dy 1 for 0 x 1 and 0 2 11 1 fY ( y ) dx for 0 y 2 0 2 2 2 Marginal p.d.f.’s: Example 3.6.4 Suppose a man and a woman agree to meet at a restaurant sometime between 6:00 and 6:15 PM. Find the probability that the man has to wait longer than five minutes for the woman to arrive. – Let X and Y denote the number of minutes past 6:00 PM that the man and the woman arrive, respectively. Example 3.6.4 Assume 1. Both X and Y are U 0, 15 so that f X x f Y y 1/15 for 0 x 15, 0 x 15 2. X and Y are independent so that f ( x, y ) f X ( x) fY ( y ) (1/15) 2 Then P(Y X 5) 10 0 2 1 1 x5 15 dy dx 15 15 1 15 2 10 x 2 10 x . 2 0 9 2 2 15 ( x 5) dx 10 0 3.7 – Functions of Independent Random Variables Definition 3.7.1 The mean or expected value of a function of two random variables 𝑋 and 𝑌, 𝑢(𝑋, 𝑌) is E u ( X ,Y ) u ( x, y ) f ( x, y ) dy dx where 𝑓(𝑥, 𝑦) is the joint p.d.f. of 𝑋 and 𝑌 Example 3.7.1 Suppose the joint p.d.f. of X and Y is 1/ 2 0 x 1, 0 y 2 f x, y otherwise 0 E XY 3 X 2Y 2 2 xy 3x 2 y f ( x, y) dy dx 1 xy 2 3x 2 y dy dx 0 0 2 1 4x 25 3 x 2 dx 0 3 6 1 2 Properties Theorem 3.7.1 For any discrete or continuous random variables, E X Y E X E Y If X and Y are independent, then E XY E X E Y Theorem 3.7.2 If X and Y are independent, then Var ( X Y ) Var ( X ) Var (Y ) Properties Theorem 3.7.3 If 𝑋 and 𝑌 are independent random variables with respective m.g.f.’s 𝑀𝑋 (𝑡) and 𝑀𝑌 𝑡 , and a and b are constants, then the m.g.f. of 𝑊 = 𝑎𝑋 + 𝑏𝑌 is M W t M X at M Y bt Properties Theorem 3.7.4 If X is N X , X2 , Y is N Y , Y2 , X and Y are independent, and a and b are constants, then the variable W aX bY is N a X bY , a 2 X2 b 2 Y2 . Theorem 3.7.5 Let X and Y be independent discrete or continuous random variables and let g ( x) and h( x) be any functions. Then the random variables Z g ( X ) and W h( y ) are independent. Example 3.7.5 Let X and Y be independent and both 𝑁 220, 292 Define 𝑊 = 𝑋 + 𝑌. Then 𝑊 is N 220 220, 29 29 2 2 N 440,1682 So that 500 440 P(W 500) P Z P( Z 1.46) 0.0721 1682 3.8 – The Central Limit Theorem Definition 3.8.1 When a set of objects is selected from a larger set of objects, the larger set is called the population and the smaller set is called the sample. The number of objects in the sample is called the sample size. The Central Limit Theorem Theorem 3.8.2 If X1, X2,…, Xn are mutually independent random variables with a common distribution, mean μ, and variance σ2, then as 𝑛 → ∞ the distribution of the sample mean Xn X1 Xn n approaches 2 N , n Example 3.8.5 Suppose people at a certain movie theater wait a mean of 30 sec with a variance of 52 sec2 to buy tickets. Find the probability that the mean wait time of a group of 50 movie-goers is less than 28 sec. – We want to find P X 50 28 Example 3.8.5 By CLT: 1. X 50 is approximately normally distributed 2. X 50 has mean 30 3. X 50 Then 52 has variance 0.5 50 28 30 P X 50 28 P Z P ( Z 2.83) 0.0023 0.5 3.9 – The Gamma and Related Distributions The Gamma Function: (t ) y t 1 e y dy for 0 t 0 If n is an integer: (n) (n 1)! Definition 3.9.2 A random variable X has a gamma distribution with parameters r and λ where 𝑟 > 0 and 𝜆 > 0 if its p.d.f. is f ( x) r (r ) x r 1 e x for x 0 Chi-Square Distribution Theorem 3.9.1 Let 𝑌1 , 𝑌2 , … , 𝑌𝑛 be independent random variables each with a standard normal distribution. Define the random variable X Y12 Y22 Yn2 1 n /2 1 x /2 The p.d.f. of X is f ( x) x e n /2 (n / 2)2 for x 0 Definition 3.9.3 A random variable with this p.d.f. is said to have a chi-square distribution with n degrees of freedom. Chi-Square Distribution Definition 3.9.4 Let p be a number between 0 and 1 and let X be 2 (n). Define the critical value p2 (n) to be a positive number such that P X p2 (n) 1 p See Table C.3 Student-t Distribution Definition 3.9.5 Let 𝑍 and 𝐶 be independent random variables where 𝑍 is 𝑁(0, 1) and 𝐶 is 𝜒 2 (𝑛). The random variable Z T C/n is called the Student-t ratio with n degrees of freedom. Student-t Distribution Theorem 3.9.2 The p.d.f. for the Student-t ratio with n degrees of freedom is n 1 2 f (t ) , t ( n 1)/2 2 n t n 1 n 2 Definition A random variable with this p.d.f. is said to have a Student-t distribution with n degrees of freedom. Student-t Distribution Definition 3.9.6 Let 𝑝 be a number between 0 and 0.5 and let 𝑇 have a Student-t distribution with n degrees of freedom. A critical t-value is a number 𝑡𝑝 (𝑛) such that – See Table C.2 P T t p ( n) 1 p F-Distribution Theorem 3.9.3 Let 𝑈 and V be two independent chi-square random variables with n and d degrees of freedom, respectively. Define the random variable U /n F V /d n d n /2 d /2 ( n /2) 1 n d x 2 f ( x) , x0 n d (d nx)( n d )/2 2 2 The p.d.f. of 𝐹 is F-Distribution Definition 3.9.7 A random variable with this p.d.f. is said to have an F-distribution with n and d degrees of freedom. The number n is called the numerator degrees of freedom while d is called the denominator degrees of freedom. F-Distribution Definition 3.9.8 Let p be a number between 0 and 1 and let 𝐹 have an F-distribution with n and d degrees of freedom. A critical F-value is a number 𝑓𝑝 (𝑛, 𝑑) such that P F f p ( n, d ) 1 p – See Table C.4 3.10 – Approximating the Binomial Distribution Theorem 3.10.1 (Limit Theorem of De Moivre and Laplace) Let 𝑋 be 𝑏(𝑛, 𝑝). Then as 𝑛 → ∞ the distribution of 𝑋 approaches N np, np (1 p ) Application: Let 𝑌 be 𝑁 𝑛𝑝, 𝑛𝑝 1 − 𝑝 . Then P(a X b) P(a 0.5 Y b 0.5) Example 3.10.1 An airline has a policy of selling 375 tickets for a plane that seats only 365 people (called “overbooking”). Records indicate that about 95% of people who buy tickets for this flight actually show up. Find the probability that there are enough seats. Example 3.10.1 Let X = number of ticket-holders who show up – X is 𝑏(375, 0.95) – Let Y be N (375 0.95,375 0.95 0.05) N (356.25,17.81) Then 365.5 356.25 P( X 365) P(Y 365.5) P Z 17.81 P( Z 2.19) 0.9857 Bernoulli’s Law of Large Numbers Theorem 3.10.2 Let the random variable 𝑋 be the number of times a specified event 𝐴 is observed in n trials of a random experiment. Let 𝑝 = 𝑃(𝐴). Then for any small number 𝜀 > 0, X P p ò 1 as n n