1 CHAPTER: CONTINUOUS RANDOM VARIABLES Contents 0 Introduction 1 Probability Density Function, f(x) 2 Expectation, E(X), and Variance, Var(X) 3 Cumulative Distribution Function, F(X) 4 Mode and Median, Upper and Lower Quartiles 5 Obtaining the probability density function from the cumulative distribution, f(x) = F’(x) 6 Obtaining the probability density function or cumulative distribution function of Y = f(X) 7 The Rectangular or Uniform Distribution 8 Miscellaneous Examples 0 Introduction If a sample space contains an infinite and uncountable number of possibilities equal to the number of points on a line segment, it is called a continuous sample space. A random variable defined in this sample space is called a continuous random variable. 1 Probability Density Function, f(x) A continuous random variable is specified by its probability density function written as f(x). If X is a continuous random variable with probability density function f(x) valid over the range a x b, then a) all x f(x) dx = 1 y b i..e. f(x)dx = 1 since a x b y = f(x) a or the area under the curve y = f(x) between a and b is 1. 0 a b x x2 b) If a x1 x2 b then P(x1 X x2) = f(x)dx x1 P(x1 X x2) is given by the area under the curve y = f(x) between x1 and x2. y y = f(x) 0 a x1 x2 b x Note: The area under the curve y = f(x) represents probability. f(x) 0 for all x P(a x b) = P(a x < b) = P(a < x b) = P(a < x < b) since P(X = x ) is very small and negligible. Example 1.1 A continuous random variable has probability density function f(x) where f(x) = kx, 0 x 4. a) Find the value of the constant k, b) Sketch y = f(x). 1 c) Find P(1 X 2.5). [ , 0.328] 8 Solution 2 Example 1.2 The continuous random variable X has probability density function f(x) where f(x) = kx 2, 0 x 2. a) Find the value of the constant k. b) Sketch y = f(x) c) Find P(X 1) 3 7 13 d) Find P(0.5 X 1.5). [ , ] 8 8 32 Solution Example 1.3 0x<2 kx A continuous random variable X has probability density function f(x) where f(x) = k(4-x) 2 x 4 0 otherwise a) Find the value of the constant k. b) Sketch the curve y = f(x) 1 1 1 11 c) Find P( X 2 ). [ , ] 4 16 2 2 Solution 3 2 Expectation, E(X), and Variance,Var(X). If X is a continuous random variable with probability density function f(x), then the expectation of X is E(X) where E(X) =all x xf(x) dx. E(X) is often denoted by and referred to as the mean of X. If g(x) is any function of the continuous random variable X having probability density function f(x), then E[g(X)] = all x g(x)f(x) dx. In particular E(X2) = all x x2f(x) dx Note: E(a) E(aX) E(aX + b) E(X1 + X2) E[f1(X) + f2(X)] E[f1(X) - f2(X)] =a = a E(X) = a E(X) + b = E(X1) + E(X2) = E[f1(X)] + E[f2(X)] = E[f1(X)] - E[f2(X)] where a is a constant for a, b constants for any X1 , X2 random variables for any 2 functions f1 and f2 of X If X is a continuous random variable with probability density function f(x) then variance of X, Var(X) = E[(X -)2] = E(X2) - 2 = all x x2f(x) dx - 2 where = E(X) = all x xf(x) dx. The standard deviation of X , = Var(X) Note: Var(a) = 0 Var(aX) = a2Var(X) Var(aX + b) = a2Var(X) Var(X1 + X2) = Var(X1) + Var(X2) where a and b are constants. if X1 and X2 are independent random variables. Example 2.1 If continuous random variable X has probability density function f(x) = find E(X). Solution [4] 3 (3 - x)(x - 5), 3 x 5, 4 4 Example 2.2 c x 0 x < 3 3 A continuous random variable X has probability density function defined by f(x) = c 3 x 4 0 otherwise where c is a positive constant. Find a) c b) the mean of X c) a, for there to be a probability of 0.85 that a randomly observed value of X will exceed a. [ 2 , 2.6, 1.5] 5 Solution Example 2.3 7 x The continuous random variable X has probability density function f(x) where f(x) = 6 x (2 - x) 70 6 Find a) E(X) b) E(X2) Solution [ 15 93 , ] 14 70 0x1 1x2 otherwise 5 Example 2.4 27 x The continuous random variable X has probability density function given by f(x) = 1 30 1 a) Sketch y = f(x) b) Find E(X) c) Find E(X2) d) Find the standard deviation of X . Solution [ 41 571 , , 1.008] 12 45 2 0x<3 3x5 otherwise 6 Example 2.5 The continuous random variable X has probability density function f(x) = If E(X) = and Var(X) = 2 , find P( | X - | < ). Solution [ 0.583] 3 (1 + x2), 0 x 1. 4 7 3 Cumulative Distribution Function, F(X) If X is a continuous random variable with probability density function f(x) defined for a x b, a, b , then the cumulative distribution function is given by F(t) where y t F(t) = P(X t) = y=f(x) f(x) dx a Note: F(x) is a monotone increasing function. b F(b) = f(x) dx = 1 where a < x < b F(t) 0 a t b x a t If f(x) is valid for - < x < , then F(t) = f(x) dx , where the interval is taken for x t. - F(-) = 0 and F() = 1. x2 x2 x1 P(x1 X x2) = f(x) dx = f(x) dx - f(x) dx = F(x2) - F(x1) x1 - P(X b) = 1 - P(X < b) = 1 - F(b) - Example 3.1 4 x A continuous random variable X had probability density function f(x) where f(x) = 1 (4 - x) 40 1 Find the cumulative distribution function of X and sketch F(x). Solution [F(x) = 0 1 2 x 8 1 (8x - x2 -8) 8 1 0x<2 2x<4 otherwise x<0 0x<2 2x<4 x4 ] 8 Example 3.2 k -1 x 1 A continuous random variable X had probability density function f(x) where f(x) = 1 + x2 0 otherwise Find a) k b) F(x) and sketch the graph of y = F(x) x < -1 0 1 2 -1 1 2 1 c) P(0 < x < ) [ , F(x) = 2 + tan x -1 x 1 , ] 3 3 1 x>1 Solution 9 4 Mode and Median, Upper and Lower Quartiles The mode is the value of X for which f(x) is greatest, in the given range of X. It is usually necessary to draw a sketch of y = f(x). For some probability density function it is possible to determine the mode by finding the maximum point on the df(x) curve y = f(x) from the relationship =0 dx The median splits the area under the curve y = f(x) into two halves. So, if the value of the median is m, m b then f(x) dx = 0.5 or f(x) dx = 0.5 i.e. a P(X m) or F(m) = 0.5 or y y=f(x) m P(X m) = 0.5 Area =0.5 0 a Area = 0.5 m b QU 3 The Upper Quartile QU is defined by F(QU ) = f(x) dx = 4 - QL 1 The Lower Quartile QL is defined by F(QL) = f(x) dx = 4 - Example 4.1 The continuous random variable X has probability density function f(x) = a) Sketch y = f(x) b) Find the mode. Solution 3 (2 + x)(4 - x), 0 x 4. 80 [1] Example 4.2 If X is a continuous random variable with probability density function f(x) = 1 x, 0 x 4, 8 a) find the cumulative distribution function F(x) and sketch the curve y = F(x), b) find the median m, t2 c) find P(0.3 X 1.8) [ , 2.83, 0.197] 16 Solution x 10 5 Obtaining the probability density function from the cumulative distribution, f(x) = F’(x) The probability density function can be obtained from the cumulative distribution as follows: t Since F(t) = f(x) dx a t b So, a d f(x) = F(x) = F’(x) dx Example 5.1 0 x< -2 1 (2+x) -2 x < 0 12 1 The continuous random variable X has cumulative distribution function F(x) = 6 (1+x) 0 x < 4 1 (6+x) 4 x < 6 12 1 x 6 1 -2 x < 0 12 1 0x<4 6 Find the probability density function of X, f(x), and sketch y = f(x). [ f(x) = ] 1 4x<6 12 0 otherwise Solution 11 Example 5.2 The continuous random variable X has cumulative distribution function F(x) = 0 1 1 x - x2 2 8 1 a+ x 4 1 1 b + x2 - x 8 4 1 x<0 0x<1 1x<2 2x3 x3 a) Find a and b and sketch F(x) b) Find and sketch the probability density function f(x) c) Find the mean and the standard deviation . Solution [a= 1 5 , b = , = 1.5, = 0.957] 8 8 12 6 Obtaining the probability density function or cumulative distribution function of Y = f(X) To find the probability density function or the cumulative distribution function of Y = f(X), we can use the definition f(x) dx = 1 or F(x) = P(X < x) and perform the necessary substitution or manipulation. all x Example 6.1 (NYJC 00/2/7v modified) x<0 0 1 a) Given that the cumulative distribution function of X is F(x) = 1 - 25(x - 5)2 0 x 5 , 1 x>5 1 . X+1 - 2 (x - 5) 0 x 5 b) Given that the probability density function of X is f(x) = 25 , 0 otherwise 1 find the probability density function of Y where Y = . X+1 1 0 y< 6 1 - 2 2 (1 - 6) y1 25y y 6 1 [Ans: a) F(y) = 1 1 b) f(y) = ( - 6)2 y1 25 y 6 0 otherwise 1 y>1 Solution find the cumulative distribution function of Y where Y = ] 13 7 The Rectangular or Uniform Distribution A continuous random variable X having probability density function f(x) where f(x) = 1 b-a for a x b where a and b are constants, is said to follow a rectangular (or uniform) distribution. If X is distributed in this way, we write X R(a, b) y where a and b are the parameters of the distribution. 1 The graph of y = f(x) is shown. b-a The shaded region is P(x1 X x2). X is a random variable, since 0 a x1 x2 P(X=x) = all x f(x) dx all x b 1 = dx b-a a 1 = [x] ab y b-a b-a 1 = b-a b-a = 1 For a rectangular distribution, the probability of the variable 1 lying in one particular range of length L is L( ). a L b-a Note: For a rectangular distribution, a+b (b-a)2 E(X) = and Var(X) = 2 12 0 x < a x-a F(x) = b-a a x b 1 x > b x2 - x1 P(x1 X x2) = where x1, x2 [a,b] b-a a+b The median, m = 2 Example 7.1 If X R(a, b), find Solution a) E(X) b) Var(X). [ 1 1 (a + b), (b - a)2] 2 12 f(x) = b x f(x) = b 1 b-a x 1 b-a 14 Example 7.2 The random variable X has a rectangular distribution over the interval [0,8]. 1 3 Find the probability density function of Y where Y = X3 . [ y2] 8 Solution Example 7.3 A rectangle, with one side of length x cm and perimeter 12 cm, has area A cm2. If X is uniformly distributed 1 between 0 and 2, find the probability density function of A. [ for 0 a 8] 4 9-a Solution 15 8 Miscellaneous Examples Example 8.1 (ACJC 96/2/7) A continuous random variable X takes values in the interval 1 x 4. The cumulative distribution function, F(x), of X is a different linear function in each of the intervals 1 x < 3 and 3 x 4, and takes values 0, 0.5 and 1 corresponding to 1 x = 1, 3 and 4, as shown in the diagram. a) Write down the cumulative distribution function of X. 0.5 b) State the median of X. c) Find the probability density function of X and sketch its graph. 11 d) Show that the expectation, , of X is equal to . 0 1 4 e) Determine the probability that |X - | exceeds 1. 5 [ b) 3 e) ] 16 Solution 2 3 4 16 Example 8.2 (NJC 96/2/7 first part) A circular target of radius 30 cm consists of a “bull” of radius 10 cm, surrounded by two concentric bands each of width 10 cm. Shots landing in the “bull’ score 10 points, those in the inner band, 4 points, and those in the outer band, 1 point. For a particular marksman, the distance in cm from the centre of the target of these shots are denoted by X. Every shot on the target is independent of all other previous shots with a probability of A P(X x) = x (60 – x) for 0 x 30, where A is a constant. Every shot lands on the target. 2 1 a) Show that A is and find the median giving three significant figures to your answer. 450 b) Find the probability density function f(x) of X c) Show that the expected score is 7 d) Calculate the probability that three shots score 24 or more points, giving your answer to 3 sig. fig. [median = 8.79cm, 0.480] Solution 17 SUMMARY A continuous random variable is specified by its probability density function written as f(x). Properties: a) all x f(x) dx = 1 x2 b) P(x1 X x2) = f(x)dx x1 The area under the curve y = f(x) represents probability. d) f(x) 0 for all x e) P(a x b) = P(a x < b) = P(a < x b) = P(a < x < b) c) Expectation: (a and b are constants) E(X) = all x xf(x) dx. E[g(x)] = all x g(x)f(x) dx E(a) =a E(aX) = aE(X) E(aX + b) = aE(X) + b E(X1 + X2) = E(X1) + E(X2) E[f1(x) + f2(x)] = E[f1(x)] + E[f2(x)] E[f1(x) - f2(x)] = E[f1(x)] - E[f2(x)] Variance: (a and b are constants) Var(X) = E[(X -)2] = E(X2) - 2 Var(a) =0 Var(aX) = a2Var(X) Var(aX + b) = a2Var(X) Var(X1 + X2) = Var(X1) + Var(X2) if X1 and X2 are independent random variables. The standard deviation of X, = Var(X) For a rectangular distribution a+b (b-a)2 a) E(X) = and Var(X) = 2 12 0 x<a x-a b) F(x) = { b-a a x b 1 x>b x2 - x1 c) P(x1 X x2) = where x1, x2 [a,b] b-a a+b d) The median, m = 2 ============== Cumulative distribution function of X a) t F(t)= P(X t) = f(x) dx a b) F(x) is a monotone increasing function. b c) F(b) = f(x) dx = 1 where a < x < b a d) If f(x) is valid for - x , t then F(t) = f(x) dx where the interval is taken e) - over all values of x t. Note that F(-) = 0 and F() = 1. Suppose P(X x1) = F(x1) and P(X x2) = F(x2). x2 Then P(x1 X x2) = f(x) dx x1 x2 x1 = f(x) dx f(x) dx f) - - = F(x2) - F(x1) P(X b) = 1 - P(X < b) = 1 - F(b) Median If the value of the median is m, m b then f(x) dx = 0.5 or f(x) dx = 0.5 a i.e. P(X m) = 0.5 or f(x) = m P(X m) = 0.5 d F(x) = F’(x) dx The Upper Quartile QU is defined by QU 3 F(QU ) = f(x) dx = 4 - The Lower Quartile QL is defined by QL 1 F(QL) = f(x) dx = 4 - ===================