The random variable 1
Contents 1. Definition 2. Distribution and density function 3. Specific random variables 4. Functions of one random variable 5. Mean and variance 2
The random variable A random variable (RV) represents a process of assigning to every outcome of an experiment Ω a number x = X( ω) 3
The random variable such that { } x, A = ω:x( ω) x Α r Thus a RV is a function with domain the set of experimental outcomes and range a set of numbers All RV will be written in capital letters. X: Ω 4
Events generated by RVs For a given random variable, we are able to answer the following question: What is the probability that the RV X is less than a given number? P( X x )? That is, what is the probability of all outcomes ω such that: ( ω ( ω) ) P :X x? What is the probability that the RV X is between the numbers x 1 and x 2? P x < X x? ({ 1 2} ) That is, what is the probability of all outcomes ω such that: P ω :x < X ω x? ( 1 ( ) 2) 5
Example: the sum of the outcomes in a two dice roll experiment x = X( ω) ω ( ω ( ω ) = ) P :X x X=2 (1,1) 1/36 X=3 (1,2);(2,1) 2/36 X=4 (1,3);(2,2);(3,1) 3/36 X=5 (1,4);(2,3);(3,2);(4,1) 4/36 X=6 (1,5);(2,4);(3,3);(4,2);(5,1) 5/36 X=7 (1,6);(2,5);(3,4);(4,3);(5,2);(6,1) 6/36 X=8 (2,6);(3,5);(4,4);(5,3);(6,2) 5/36 X=9 (3,6);(4,5);(5,4);(6,3) 4/36 X=10 (4,6);(5,5);(6,4) 3/36 X=11 (5,6);(6,5) 2/36 X=12 (6,6) 1/36 6
The distribution function Given a number x, we can form the event { ω :X( ω) x} This event depends on x; hence its probability is a function of x. This function is called cumulative distribution function. ( ) ( ) ( ) ( ) F x = P X x = P ω:x ω x x X 7
Properties of distributions 1.The function if x FX < ( ) 1 2 x, is monotonically increasing; that is, x then ( ) ( ) F x F x X 1 X 2 2. 3. 4. X ( ) + F x 1 x F ( x) 0 x P( X > x) = 1 F X ( x) ( ) ( ) ( ) P x < X x = F x F x x,x, x < x X 1 2 X 2 X 1 1 2 1 2 8
Properties of distributions 5. The function might be continuous or discontinuous. If the experiment Ω consists of finitely many outcomes, FX ( x) is a staircase function. This is also true if Ω consists of infinitely many outcomes but X takes finitely many values. 9
10 11 Properties of distributions Let s consider a discontinuous function, for example that of the sum of two dice roll: 1,2 1 0,8 0,6 0,4 0,2 0 1 2 3 4 5 6 7 8 9 12 10
Properties of distributions Let s examine its behavior at a discontinuous point, e.g. at the value x 0 = 3. We have: ( ) ( ) lim F x = P X < 3 = x 3 X ( ) ( ) limf x = P X 3 = x 3 X ( ) ( ) lim F x = P X 3 = x 3 + X 1 36 3 36 3 36 ( ) ( ) ( ) ( ) lim F x lim F x = P X 3 P X < 3 = P(x = 3) = X x 3 x 3 + X 1,2 1 0,8 0,6 0,4 0,2 0 1 2 3 4 5 6 7 8 9 10 2 36 This is true in general. 11 12 11
Continuous and Discrete RVs We shall say that a RV X is of continuous type if its distribution is continuous for every x. In this case ( ) = ( ) = ( ) lim F x F x lim F x X X 0 X x x x x + 0 0 Hence, P( X = x0 ) = 0 P( X x) = P( X< x) = F X ( x) ( < ) = ( < < ) = ( ) ( ) P x X x P x X x F x F x 1 2 1 2 X 2 X 1 12
Continuous and Discrete RVs We shall say that a RV X is of discrete type if its distribution is a staircase function. 13
The density function of continuous RVs We can use the distribution function to determine the probability that the RV X takes values in an arbitrary region R of the real axis. This result can be expressed in terms of the derivative f(x) of F(x), assuming that the derivative of F(x) exists nearly everywhere. 14
The density function of continuous RVs The derivative of the distribution function is called probability density function ( + ) ( ) ( < + ) FX x x FX x P x X x x f ( ) = X x FX( x) = lim = lim x 0 x x 0 x 15
Properties of density function 1. Since F increases as x increases, we conclude that f ( x) 0 X 2. Integrating the density function from x 1 to x 2 we obtain x 2 x 1 ( ) = ( ) ( ) = ( < < ) f x dx F x F x P x X x X X 2 X 1 1 2 Thus the area of f X (x) in an interval (x 1,x 2 ) equals the probability that X is in this interval. 16
Properties of density function 3. x FX( x) = fx( x) dx + X ( ) 4. Finally, f x dx = 1 which is referred to as the normalization condition. 17
The probability function of a discrete RVs Suppose now that F is a staircase function with discontinuities at the points x i. In this case, the RV takes the values x i with probability: ( = i) = i = X( i) X( i ) P X x p F x F x The numbers p i will be represented graphically by vertical segments at the points x i with height equal to p i. 18
The probability function of a discrete RVs Occasionally, we shall use the notation ( ) p = f x i X i The function f X so defined will be called point density. Note that its values are not the derivatives of F X, but they equal the discontinuity jumps of F X. 19
Specific random variables 20
We introduce various RVs with specified distribution. To do so it is not necessary to specify the underlying experiment. Given a distribution F, we can construct an experiment and a RV X such that its distribution equals F. In the study of a RV we can avoid the notion of an abstract space. We can assume that the underlining experiment is the real line and its outcomes the value x of X. 21
Discrete random variables 22
The bernoulli RV We shall say that a RV X has a Bernoulli distribution if it assumes the following two values with the corresponding probability X 0 1 = 1 p p f X 1-p p 0 1 x 23
The Bernoulli RV The corresponding distribution is 0 X< 0 FX ( x) = 1 p 0 X< 1 1 X 1 F X 1 1-p 0 1 x 24
The binomial RV We shall say that a RV X has a Binomial distribution of order n if takes the values 0,1, n with probabilities n k n k P( X = k) = p q k = 0,1,...,n; p + q = 1 k The Binomial distribution originates in the experiment of independently repeated trials, if we define X as the number of successes of an event A (P(A)=p) in n trials. Assume we toss n times a fair coin. A is the event head, whose probability is p=0.5. X is the number of heads in the n repetitions. 25
Continuous random variables 26
The Uniform RV We shall say that a RV X is uniform or uniformly distributed in the interval (a,b) if 1 a X b fx ( x) = b a 0 elsewhere f X b 1 a a b x 27
The Uniform RV The corresponding distribution is a ramp 0 X< a x a FX ( x) = a X b b a 1 X > b F X 1 a b x 28
The Exponential RV We shall say that a RV X has an exponential distribution if f X ( x) = 0 x < 0 cx ce x > 0,c > 0 f X c x 29
The Uniform RV The corresponding distribution is F X = 0 x < 0 cx 1 e x 0,c > 0 ( x) F X 1 x 30
The Normal RV We shall say that a RV X is standard normal or Gaussian if its density is the function 1 gx ( x) = e 2π 2 x 2 g X 1 x 31
The Normal RV The corresponding distribution is the function x ξ 2 1 GX ( x) = e dξ 2π 2 G X 1 From the evenness of g(x) it follows that G ( x) = 1 G ( x) X x X 32
The Normal RV Shifting and scaling g(x), we obtain the general normal curves: ( x µ ) 1 2 1 µ σ x 2 fx ( x) = e = g σ σ σ 2π 2 f X σ µ x 33
The Normal RV We shall use the notation X N µ, σ to indicate that the RV X is normal. [ ] Thus X N 0,1indicates that X is standard normal. [ ] If X is normal, X N µ, σ, then [ ] x2 µ x1 µ P( x1 < X< x2) = FX( x2) FX( x1) = GX GX σ σ 34
The Normal RV With x =µ k σ, x =µ+ kσ 1 2 one has ( ) ( ) ( ) ( ) P µ kσ< X<µ+ kσ = G k G k = 2G k 1 X X X ( ) This is the area of the normal curve in the interval µ k σ, µ+ kσ. The following special cases are of particular intrests: 35
The Normal RV The following special cases are of particular interests: P( µ σ< X<µ+σ) 0.683 P( µ 2σ< X<µ+ 2σ) 0.954 P( µ 3σ< X<µ+ 3σ) 0.997 We note further that: P( µ 1.96σ< X <µ+ 1.96σ ) = 0.95 P( µ 2.58σ< X <µ+ 2.58σ ) = 0.99 P( µ 3.29σ< X <µ+ 3.29σ ) = 0.999 36
Functions of one random variable 37
Functions of one random variable Given a function g(x), of the real variable x and a RV X with domain the space Ω, we form the composite function This function define a RV Y with domain the set Ω. ( ) For a specific ω Ω the value Y of the RV so formed is i ( ) ( ) ( ω ) = g X( ω) given by y = g x, where x = X ω. i i Y i x ω i ( ) i 38
Density of g(x) It is possible to determine the density f Y of the RV Y=g(X) in terms of the density f Y of the RV X. To do so we form the equation gx ( ) = Where y is a specified number, and we solve for x. y x 39
Density of g(x) The solutions of this equation are the abscissas x i of the intersections points of the horizontal line L Y with the curve g(x) y L y x 1 x 2 x 3 40
Density of g(x) Theorem: For a specific y, the density f Y (y) is given by: f Y ( y) = i ( = xi ) g ( x ) f x i where x i are the roots of g(x)=y, and g (x i ) are the derivatives of g(x) at x=x i. 41