Chapter 7. Functions of Random Variables Sections 7.2 -- 7.4: Functions of Discrete Random Variables, Method of Distribution Functions and Method of Transformations in One Dimension Jiaping Wang Department of Mathematical Science 04/10/2013, Wednesday
Outline Functions of Discrete Random Variables Methods of Distribution Functions Method of Transformations in One Dimension More Examples Homework #10
Part 1. Functions of Discrete Random Variables
Introduction For example, there is a sample X 1, X 2,, X n from same distribution, also there is a function denoted by Y=f(X 1, X 2,, X n )=1/n X i, which is a function of random variables {X 1, X 2,, X n }. Considering the discrete random variables, for example, X is a discrete random variables with space S={0, 1, 2, 3}, C is a function of X with C=150+50X, then we can have a mass probability table x 0 1 2 3 p(x) 0.5 0.3 0.15 0.05 c 150 200 250 300 p(c) 0.5 0.3 0.15 0.05
Cont. Considering X is a discrete random variables with space S={-1, 0, 1}, define Y=X 2, then we can have a mass probability table as follows x -1 0 1 p(x) 0.25 0.5 0.25 y 1 0 1 p(y) 0.25 0.5 0.25 y 0 1 p(y) 0.5 0.5
Example 7.1 A quality control manager samples from a lot of items, testing each item until r defectives have been found. Find the distribution of Y, the number of items that are tested to obtain r defectives. Answer: Assume that the probability p of obtaining a defective item is constant from trial To trial, the number of good items X sampled prior to the r-th defective one is a negative Binomial random variable. The mass function is x+r 1 r 1 P X = x = p x = p r q x, x = 0, 1, 2, The number of trials, Y, is equal to the sum of the number of good items and defective Ones, that is, Y=X+r thus X=Y-r, with Y=r, r+1, r+2, so the mass function for Y is P Y = y = p y = y 1 r 1 pr q y r, y = r, r + 1, r + 2,
Part 2. Method of Distribution Functions
Introduction If X has a probability density function f X (x), and Y is a function of X, we are interested in finding F Y (y) = P(Y y) or the density f Y (y) by using the distribution of X. For example, Y = X 2 with density f X (x). For y 0, F Y y = P Y y = P X 2 y = P y X y = P X y P X y = FF y FF y. Then we can have the density function for Y: f Y y = d F dd Y y = d F dd X y d F dd X y = 1 2 y f X y + 1 2 y f X y
Application in Normal Distribution X is standard normal random variable, what is the probability density function of Y=X 2? We know f X x = 1 2π exp x2 2, < x <, thus for y 0, f Y y = 1 [ 1 ( y)2 exp 2 y 2π 2 + 1 2π exp ( y)2 2 ] = 1 y 1 2 exp( y ) 2 π 2 Recall that Γ 1 = π, we can see Y follows a gamma distribution with 2 parameters α=1/2 and β=2.
Example 7.2 The proportion of time X that a lathe is in use during a typical 40-hour workweek is a random variable whose probability density function is given by f x = 3x2, 0 x 1 0, ooooooooo. The actual number of hours out of a 40-hour week that the lathe is not in use then is Y=40(1-X). Find the probability density function for Y. Answer: F Y (y) = P(Y y) = P(40(1 X) y) = P(X > 1 y 40 ) = 1 3x 2 dd = 1 1 x 40 1 y 40 3, 0 y 40. For density function, we can obtain it by differentiating the distribution function f Y y = 3 1 x 2, 0 y 40. 40 40
Example 7.5 Let X have the probability density function given by x + 1 f x =, 1 x 1 2 0, ooooooooo Find the density function for Y=X 2. Answer: In the earlier section, we found that f Y y = 1 2 y [f X y + f X y ] By substituting into this equation, we have f Y y = 1 y+1 + y+1, 0 y 1 = 2 y 2 y 2 2 0, ooooooooo As 1 x 1, y = x 2 0 y 1 1
Summary Summary of the Distribution Function Method Let Y be a function of the continuous random variables X 1, X 2,, X n. Then 1. Find the region Y=y in the (X 1, X 2,, X n ) space. 2. Find the region Y y. 3. Find F Y (y) = P(Y y) by integrating f(x 1, X 2,, X n ) over the region Y y. 4. Find the density function f Y (y) by differentiating F Y (y). That is, f Y y = d F dd Y y.
Part 3. Method of Transformation in One Dimension
Introduction The transformation method for finding the probability distribution of a function of a random variable is simply a generalization of the distribution function method. Consider a random variable X with the distribution function F X (x). Suppose that Y is a function of X, say, Y=g(X) which is an increasing function with the inverse X=g -1 (Y)=h(Y). Then We have F Y y = P Y y = P g X y = P X h y = FF[h y ] Then the density function is f Y y = d F dd Y y = d F dd X h y = ff h y h y. Similarly, we can have the same result for g(x) is a decreasing function.
Theorem 7.1 Transformation of Random Variable. Let X be an absolute continuous random variable with probability density function > 0, x A = (a, b) f X x = 0, x A Let Y = g(x) with inverse function X = h(y) such that h is a one-to-one, continuous function from B = (α, β) onto A. If h (y) exists and h (y) 0 for all y B. Then Y = g(x) determines a new random variable with density f Y y = f X h y h y, y B = (α, β) 0, y B
Example 7.6 Let X have the probability density function given by 2x, 0 x 1 f x = 0, ooooooooo Find the density function for Y=-2X+5. Answer: Here Y = g(x) = 2X + 5 the inverse function X = h Y = 5 Y 2 where h is a continuous and one-to-one function from B=(3,5) onto A=(0,1). So h (y) = 1/2 for any y B. Then we can have f Y y = ff h y h y = 2 5 y 2 1 2 = 5 y 2, 3 < y < 5.
Summary Summary of the Univariate Transformation Method Let Y be the function of the continuous random variables X, Y=g(X). Then 1. Write the probability density function of X. 2. Find the inverse function h such that X=h(Y). Verify that h is a continuous one-to-tone function from B=(α, β) onto A=(a, b) where for x A, f x > 0. 3. Verify d h y = h (y) exists, and is not zero for any y B. dd 4. Find f Y (y) by calculating f X h y h y
Part 4. Additional Examples
Additional Example 1 Let X be a random variable having a continuous c.d.f., F(x). Let Y=F(X). Show that Y has a uniform distribution on (0,1). Conversely, if U has a uniform distribution on (0,1), show that X = F -1 (U) has the c.d.f, F(x). Answer: F(X) is non-decreasing and has domain 0<F(X)<1, that is, 0<Y<1. Suppose F(x) has inverse function, ie., y=f(x) x=f -1 (y). Then F Y (y)=p(y y)=p[f(x) y]=p[x F -1 (y)]=f(f -1 (y))=y f Y (y)=1, for 0<y<1. F X (x)=p(x x)=p(f -1 (U) x)=p(u F(x))=F(x).
Additional Example 2 Show that if U is uniform on (0,1), then X=-log(U) has an exponential distribution Exp(1). Answer: The density function for U is f U (u)=1. X=-log(U) U=exp(-X), so h(x)=e -x, which is continuous and one-to-one function with B=(0, ) as A=(0, 1). The derivative of h(x) is h (x)=-e -x which is not zero in the domain. So we can have f X (x) =f U [h(x)] h (x) =(1)( -e -x )=e -x.
Homework #10 Page 275: 5.138, 5.140 Page 354: 7.3, 7.4 Page 362: 7.6, 7.8 Page 366: 7.18, 7.20 Due Monday, 04/22/2013