0% found this document useful (0 votes)
64 views

Chapter III Random Variables

This document defines random variables and discusses discrete and continuous random variables. It provides examples of each type of random variable and explains that a random variable assigns a numerical value to each outcome of an experiment. The document also introduces the concept of a probability distribution and how it describes the possible values and probabilities of a random variable.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Chapter III Random Variables

This document defines random variables and discusses discrete and continuous random variables. It provides examples of each type of random variable and explains that a random variable assigns a numerical value to each outcome of an experiment. The document also introduces the concept of a probability distribution and how it describes the possible values and probabilities of a random variable.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 99

Chapter 3: Random Variables

[email protected]
Outline
• Definition of random variables
• Discrete Random Variables
• Continuous Random Variables
• The Expectation of a Random Variable
• The Variance of a Random Variable
• Jointly Distributed Random Variables
• Combinations and Functions of Random
Variables
Definition of random variables

• A random variable is a variable that assumes


numerical values associated with the random
outcome of an experiment, where one (and
only one) numerical value is assigned to each
sample point.
Definition of a Random Variable
• Random variable
– A numerical value to each outcome of a
particular experiment
S

-3 -2 -1 0 1 2 3
Definition of a Random Variable
• Example 1 : Machine Breakdowns
– Sample space : S  {electrical , mechanical , misuse}
– Each of these failures may be associated with a
repair cost
– State space : {50, 200,350}
– Cost is a random variable : 50, 200, and 350
Concept of Random Variables
• In a statistical experiment, it is often very important to
allocate numerical values to the outcomes.
Example:
Experiment: testing two components. (D=defective,
N=non-defective)
– Sample space: S={DD,DN,ND,NN}
– Let X = number of defective components when two
components are tested.
– Assigned numerical values to the outcomes are:

6
 Notice that, the set of all possible values of the
random variable X is {0, 1, 2}.

7
Random Variables
• A function that maps outcomes of random experiments
to numbers.

• E.g. a random variable can describe the process of rolling


a die and the possible outcomes
{ 1, 2, 3, 4, 5, 6 }.

• A random variable does not describe the outcome of an


experiment, but describes the possible outcomes in
terms of real numbers.
8
Random Variables
• Random variables are customarily denoted by
uppercase letters, such as X and Y.
• In contrast to our previous use of a lowercase letter,
such as x, to denote a variable, we will now use
lowercase letters to represent some particular value of
the corresponding random variable.
• The notation X(s) x means that x is the value
associated with the outcomes by the rv X. 9
Two Types of Random Variables
1. Discrete Random Variable
Random variables that can assume a countable
number (finite or infinite) of values are called discrete.
Or
A discrete variable is a variable that can only take on a
certain number of values. In other words, they don't
have an infinite number of values. If you can count a
set of items, then it's a discrete variable. The opposite
of a discrete variable is a continuous variable.
Examples
• Discrete random variables
–Number of sales
–Number of calls
–Shares of stock
–People in line
–Mistakes per page
Example
Experiment Random variable Possible value
Make 100 Sales # of sales 0, 1, 2, ..., 100
Calls
Crashes occurred # of crashes 0, 1, 2, ...,
an intersection
Answer 33 # of correct 0, 1,2….33
Questions

Car count # of car arriving 0,1,2,3. ….


2. Continuous Random Variable

• Random variables that can assume values


corresponding to any of the points contained
in one or more intervals (i.e., values that are
infinite and uncountable) are called
continuous.
Examples
• Continuous random variables
–Length
–Depth
–Volume
–Time
–Weight
Continuous Random Variable
Examples

Experiment Random Possible


Variable Values
Weigh 100 People Weight 45.1, 78, ...
Measure Part Life Hours 900, 875.9, ...
Amount spent on food $ amount 54.12, 42, ...
Measure Time Inter-Arrival 0, 1.3, 2.78, ...
Between Arrivals Time
Example – Sum of face of Dice

16
X denotes the random variable defined as the sum of two fair dice
P{X=2} = P{(1,1)} = 1/36
P{X=3} = P{(1,2), (2,1)}= 2/36
P{X=4} = P{(1,3), (2,2) ,(3,1)}= 3/36
P{X=5} = P{(1,4), (2,3) ,(3,2), (4,1)}= 4/36
P{X=6} = P{(1,5), (2,4) ,(3,3), (4,2),(5,1)}= 5/36
P{X=7} = P{(1,6), (2,5) ,(3,4), (4,3), (5,2),(6,1)} = 6/36
P{X=8} = P{(2,6), (3,5) ,(4,4), (5,3), (6,2)} = 5/36
P{X=9} = P{(3,6), (4,5) ,(5,4), (6,3)} = 4/36
P{X=10} = P{(4,6), (5,5) ,(6,4)} = 3/36
P{X=11} = P{(5,6), (6,5) } = 2/36
P{X=12} = P{(6,6)} = 1/36

17
• In other words, the random variable X can take on
any integral value between 2 and 12. The sum of the
probabilities is 1.
• Suppose that X can only assume the values x1,
x2, ... xn. Then

 P( X  x )  1
i 1
i

18
Example

A shipment of 8 similar microcomputers to a


retail outlet contains 3 that are defective and 5
are non-defective. If a school makes a random
purchase of 2 of these computers, find the
probability distribution of the number of
defectives.

19
Solution:
• We need to find the probability distribution of
the random variable:

• X = the number of defective computers


purchased.

• Experiment: selecting 2 computers at random out


of 8.
8

 3

• n(S) =  equally likely outcomes
20
• The possible values of X are: x=0, 1, 2.
• Consider the events:

3 5
(X  0)  {0D and 2N}  n(X  0)      
0  2
 3  5 
(X  1)  {1D and 1N}  n(X  1)      
1  1 

3  5
(X  2)  {2D and 0N}  n(X  2)      
 2 0
21
3 5
    
n (X  0)  0   2  10
f ( 0)  P ( X  0)   
n (S) 8  28
 
 2

 3  5 
    
n (X  1) 1  1  15
f (1)  P(X  1)   
n (S) 8  28
 
 2
22
3  5
    
n (X  2)  2   0  3
f (2)  P(X  2)   
n (S) 8  28
 
 2

In general, for x=0,1, 2, we have:

3  5 
    
n (X  x )  x   2  x 
f ( x )  P( X  x )  
n (S) 8 
 
 2 23
• The probability distribution of X is:

x 0 1 2 Total
10 15 3
f(x)= P(X=x) 1.00
28 28 28

 3   5 
     
 x
   2  x  ; x  0, 1, 2

f ( x)  P( X  x)   8 
  
  2

0 ; otherwise
24
Data Types

Data

Num erical Qualitative

Discrete Continuous
25
Types of Random Variables
• Discrete Random Variable
– x  {x1, x2, …, xn} or x  {x1, x2, …}
– Whole Number (0, 1, 2, 3 etc.)
– Countable, Finite Number of Values or infinite number
• Jump from one value to the next and cannot take any
values in between.

• Continuous Random Variables


– x  {x: a < x < b; a, b R}
– Whole or Fractional Number
– Obtained by Measuring
– Infinite Number of Values in Interval
• Too Many to List Like Discrete Variable
26
Probability Distribution
• “ The probability distribution of X says how the total
probability of 1 is distributed among (allocated to)
the various possible X values.”

• Probability Distribution: Table, Graph, or Formula that


describes values a random variable can take on, and its
corresponding probability (discrete RV) or density (continuous
RV)

27
Probability Distribution

• Discrete Probability Distribution: Assigns probabilities


(masses) to the individual outcomes
• Continuous Probability Distribution: Assigns density
at individual points, probability of ranges can be
obtained by integrating density function
• Discrete Probabilities denoted by: p(y) = P(Y=y)
• Continuous Densities denoted by: f(y)
• Cumulative Distribution Function: F(y) = P(Y≤y)
28
Discrete Probability Distribution
1.List of All possible [x, p(x)] pairs
– x = Value of Random Variable (Outcome)
– p(x) = Probability Associated with Value

2. Mutually Exclusive (No Overlap)

3. Collectively Exhaustive (Nothing Left Out)

4. 0  p(x)  1
P(X  A )   f ( x )   P(X  x )
all xA all xA

5.  p(x) = 1

29
Probability Mass Function
• Probability Mass Function (p.m.f.)
– A set of probability value p assigned to each of
i

the values taken by the discrete random variable xi

– 0  pi  1 and  i pi  1
– Probability : P ( X  xi )  pi
Probability Mass Function
• Example 1 : Machine Breakdowns
– P (cost=50)=0.3, P (cost=200)=0.2,
P (cost=350)=0.5
xi 50 200 350
– 0.3 + 0.2 + 0.5 =1
f ( x) pi 0.3 0.2 0.5
0.5

0.3
0.2

50 200 350 Cost($)


Cumulative Distribution Function (1/2)

• Cumulative Distribution Function


– Function : F ( x)  P( X  x) F ( x)  
y: y  x
P( X  y)

– Abbreviation : c.d.f

F ( x)
1.0

0.5

0.3

0 50 200 350 x($cost)


Cumulative Distribution Function
• Example 1 : Machine Breakdowns

  x  50  F ( x)  P(cost  x)  0
50  x  200  F ( x)  P(cost  x)  0.3
200  x  350  F ( x)  P(cost  x)  0.3  0.2  0.5
350  x    F ( x)  P(cost  x)  0.3  0.2  0.5  1.0
Exercise
A basketball player shoots three free throws. He
typically makes a basket exactly 60% of the time. The
random variable X is the number of baskets successfully
made.
What is the probability that the player

successfully makes at least* two baskets?


Value of X 0 1 2 3
Probability 0.064 0.288 0.432 0.216
Answer
• Through careful reading of the question,
we see that the event we are interested in
is “2 or more free throws”. The possible
values of X making up this event are {2,
3}. Answer:
P(X≥2) = P(X=2 or X=3)
= (0.432+0.216) = 0.648

• Key Point: The sample space discussed


in this example contains discrete data.
Continuous Random Variables
Example of Continuous Random Variables
• Example : Metal Cylinder Production
– Suppose that the random variable X is the
diameter of a randomly chosen cylinder
manufactured by the company. Since this
random variable can take any value between
49.5 and 50.5, it is a continuous random
variable.
Probability Density Function
• Probability Density Function (p.d.f.)
– Probabilistic properties of a continuous random
variable f ( x )  0
statespace
f ( x)dx  1
Probability Density Function
• Example
– Suppose that the diameter of a metal cylinder has a
p.d.f
f ( x)  1.5  6( x  50.2) 2 for 49.5  x  50.5
f ( x)  0, elsewhere
f ( x)

49.5 50.5 x
Probability Density Function
• This is a valid p.d.f.
50.5
 (1.5  6( x  50.0) )dx  [1.5 x  2( x  50.0) ]
2 3 50.5
49.5
49.5

 [1.5  50.5  2(50.5  50.0)3 ]


[1.5  49.5  2(49.5  50.0) 3 ]
 75.5  74.5  1.0
Probability Density Function
• The probability that a metal cylinder has a diameter
between 49.8 and 50.1 mm can be calculated to be
50.1
49.8
(1.5  6( x  50.0) 2 ) dx  [1.5 x  2( x  50.0) 3 ]50.1
49.8

 [1.5  50.1  2(50.1  50.0) 3 ]


[1.5  49.8  2(49.8  50.0) 3 ]
 75.148  74.716  0.432
f ( x)

49.5 49.8 50.1 50.5 x


Cumulative Distribution Function
• Cumulative Distribution Function
x
 F ( x)  P( X  x)   f ( y )dy


dF ( x)
 f ( x) 
dx

 P ( a  X  b)  P ( X  b)  P ( X  a )
 F (b)  F (a)

 P ( a  X  b)  P ( a  X  b )
Probability Density Function
• Example
x
F ( x)  P( X  x)   (1.5  6( y  50.0) 2 ) dy
49.5

 [1.5 y  2( y  50.0)3 ]49.5


x

 [1.5 x  2( x  50.0)3 ]  [1.5  49.5  2(49.5  50.0) 3 ]


1.5 x  2( x  50.0)3  74.5
P (49.7  X  50.0)  F (50.0)  F (49.7)
 (1.5  50.0  2(50.0  50.0)3  74.5)
(1.5  49.7  2(49.7  50.0)3  74.5)
 0.5  0.104  0.396
Probability Density Function

P(49.7  X  50.0)  0.396


1

P( X  50.0)  0.5
F ( x)

P( X  49.7)  0.104

49.5 49.7 50.0 50.5 x


The Expectation of a Random Variable
Expectations of Discrete Random Variables (1/2)
• Expectation of a discrete random variable with p.m.f
P( X  xi )  pi

E( X )  px
i
i i

• Expectation of a continuous random variable with p.d.f f(x)


E( X )   state space
xf ( x )dx

• The expected value of a random variable is also called the mean of the
random variable
Expectations of Discrete Random Variables

• Example 1 (discrete random variable)


– The expected repair cost is

E (cost)  ($50  0.3)  ($200  0.2)  ($350  0.5)  $230


Expectations of Continuous Random Variables
• Example 14 (continuous random variable)
– The expected diameter of a metal cylinder is
50.5
E( X )   x(1.5  6( x  50.0) 2 )dx
49.5
– Change of variable: y=x-50
0.5
E ( x)   ( y  50)(1.5  6 y 2 )dy
0.5
0.5
 (6 y 3  300 y 2  1.5 y  75) dy
0.5

 [3 y 4 / 2  100 y 3  0.75 y 2  75 y ]0.5


0.5

 [25.09375]  [24.90625]  50.0


Expectations of Continuous Random Variables

• Symmetric Random f ( x) E( X )  
Variables
– If x has a p.d.f f ( x)that is
symmetric about a point
so that 

f (   x)  f (   x)
 x
– Then, (why?)
E( X )  
– Then, E( X )   (why?)

– So that the expectation of the random variable is


equal to the point of symmetry
E( X )   xf ( x)dx
 
 
- 
xf ( x) dx +  xf ( x ) dx

 y  2  x
 
 
- 
xf ( x ) dx +  
- 
yf ( y ) dy


Medians of Random Variables
• Median
– Information about the “middle” value of the
random variable F ( x)  0.5

• Symmetric Random Variable


– If a continuous random variable is symmetric
about a point  , then both the median and the

expectation of the random variable are equal to
Medians of Random Variables (2/2)

• Example 14
F ( x)  1.5 x  2( x  50.0)3  74.5  0.5

x  50.0
The variance of a Random Variable
1 Definition and Interpretation of Variance (1/2)
2
• Variance(  )
– A positive quantity that measures the spread of the distribution
of the random variable about its mean value
– Larger values of the variance indicate that the distribution is
more spread out
Var( X )  E (( X  E ( X )) 2 )
– Definition:  E ( X 2 )  ( E ( X )) 2

• Standard Deviation
– The positive square root of the variance
Definition and Interpretation of Variance
(2/2)
Var( X )  E (( X  E ( X )) 2 )
 E ( X 2  2 XE ( X )  ( E ( X )) 2 )
 E ( X 2 )  2 E ( X ) E ( X )  ( E ( X )) 2
 E ( X 2 )  ( E ( X )) 2

f ( x)
Two distribution with
identical mean values
but different variances

x
Examples of Variance Calculations (1/1)

• Example 1
Var( X )  E (( X  E ( X )) 2 )   pi ( xi  E ( X )) 2
i

 0.3(50  230) 2  0.2(200  230) 2  0.5(350  230) 2


 17,100   2

  17,100  130.77
Exercise
• A basketball player shoots three free throws. The
random variable X is the number of baskets
successfully made. Calculate mean, variance &
standard deviation

Value of 0 1 2 3
x
Probabili 0.064 0.288 0.432 0.216
ty
Answer
• µX = 1.8.
• The variance σ2 of X is
• σ2 = 0.064*(0−1.8)2 + 0.288*(1−1.8)2 + 0.432*(2−1.8)2 +
0.216*(3−1.8)2
• = 0.20736 + 0.18432 + 0.01728 + 0.31104
• = 0.72  Take the square root to get SD:
• SD = 0.85
Example
• Linda is a sales associate at a large auto dealership. At her
commission rate of 25% of gross profit on each vehicle she sells,
Linda expects to earn $350 for each car sold and $400 for each truck
or SUV sold. Linda motivates herself by using probability estimates of
her sales. For a sunny Saturday in April, she estimates her car sales as
follows:
Cars Sold 0 1 2 3

Prob 0.3 0.4 0.2 0.1

Trucks Sold 0 1 2 3
Prob 0.4 0.5 0.1 0

 What is Linda’s expected income?


 Linda is given the option of switching to a truck-only department. Should she
take that job?
Cars Sold 0 1 2 3
What is Linda’s expected income? Prob 0.3 0.4 0.2 0.1

Trucks Sold 0 1 2 3
Prob 0.4 0.5 0.1 0

Recall how with certain probability questions you have to ask yourself “disjoint or non-disjoint” or “independent or non-
indepndent”. Similarly, when calculating an expected value, the very first question you must ask yourself is “discrete or
non-discrete” since the method of determining the mean is completely different for each.

Because the type of variable we are discussing (# cars/trucks sold) is discrete, we will use the formula for
calculating the mean of discrete data that was described earlier:

μcars sold = 0*0.3 + 1*0.4 + 2+0.2 + 3*0.1 = 1.1 cars


μtrucks sold = 0*0.4 + 1*0.5 + 2*0.1 + 3*0 = 0.7 trucks

If she gets $350 per car, and $400 per truck, Linda would expect to make: $350*1.1 + $400*0.7 = $665
3. Chebyshev’s Inequality (1/1)
(theorem )
 Assume that mean and variance are
given.
 Better estimate of probability of
events of interest using Chebyshev
inequality:
Uses of Chebyshev’s Formula:
• Chebyshev’s inequality can be used to obtain
upper bounds on the variance of a random
variable.
• The inequality can also be used to prove the
weak law of large numbers. The weak law of
large numbers tells us that if we draw samples
of increasing size from a population then the
sample mean tends towards the population
mean.
• As seen above the Chebyshev Formula gives us
results similar to the empirical rule. It tells us what
percentage of the data lies within certain distance
from the mean.
• The difference is that the empirical rule is only
applicable to normal distributions whereas the
Chebyshev formula is applicable for every
distribution. Since the empirical rule applies only to
a specific case it is much more sharper and
accurate when compared to Chebyshevs inequality.
Chebyshev’s Inequality (2/1)
• Proof: Apply Markov inequality to
non-negative r.v. (X- )2 and
number t2 to obtain
I(X )  0 
P( X  t )  t0
E[ X ]   t
Theorem  Chebyshev's Inequality
Alternate form

E[ X ]   X
2
V[X ]   X
2

P  X  X  t   X
2
t
63
I(X )  0 
P( X  t )  t0
E[ X ]   t
Theorem  Chebyshev's Inequality

2

P  X  X  t   X
2
t
Because

E  X  X  
2

P  X  X  t   P  X  X 
  t2    
2
  t 2

64
2

P  X  X  t   X
2
t
Chebyshev inequality: Alternate forms

 Yet two other forms of Chebyshev’s ineqaulity:

Says something about the probability of


being “k standard deviations from the mean”.

65
Theorem  Chebyshev's Inequality
2

P  X  X  t   X
2
1 t
P  X   X  k X   2
k
1
P  X  X  k X   1  2
k
 0.934
 0.889
 0.75
0
X X X X X X X X

X 66
2

X ~ N (  , P ) X   X  t  
2 X
Theorem  Chebyshev's Inequality t 2

1
Facts: P  X   X  k X   2
k
1
P  X   X  k X   1  2
k
 0.934
 0.889
 0.75
0
X X X X X X X X

X 67
Example

68
1
P  X  X  k X   2
Aside “just” Markov:

P( X  t )  k
t
70
P ( X  84)   0.8
84

  60 X  84 P  X   X  4 X   1/16
 6 X    24  4 1000  161  62.5  70

       
 69
Jointly Distributed Random Variables
Jointly Distributed Random Variables (1/4)
• Joint Probability Distributions
– Discrete
P ( X  xi , Y  y j )  pij  0
satisfying  p
i j
ij 1

– Continuous
f ( x, y )  0 satisfying 
state space
f ( x, y ) dxdx  1
Jointly Distributed Random Variables (2/4)

• Joint Cumulative Distribution Function


F ( x, y )  P ( X  xi , Y  y j )

– DiscreteF ( x, y ) 
 
i: xi  x j: y j  y
pij

– Continuous x y
F ( x, y )    f ( w, z )dzdw
w  z 
Jointly Distributed Random Variables (3/4)

• Example 19 : Air Conditioner Maintenance


– A company that services air conditioner units in
residences and office blocks is interested in how
to schedule its technicians in the most efficient
manner
– The random variable X, taking the values 1,2,3 and
4, is the service time in hours
– The random variable Y, taking the values 1,2 and 3,
is the number of air conditioner units
Jointly Distributed Random Variables (4/4)

Y=
X=service time • Joint p.m.f
number  p 0.12  0.18
ij
of units i j
1 2 3 4
   0.07  1.00

1 0.12 0.08 0.07 0.05 F (2, 2)  p11  p12  p21  p22


 0.12  0.18  0.08  0.15
 0.43
2 0.08 0.15 0.21 0.13

• Joint cumulative
3 0.01 0.01 0.02 0.07
distribution
function
Examples
• The joint distribution of p(x, y) of X (number of
cars) and Y (the number of buses) per signal
cycle at a traffic signal is given by
Y
0 1 2
0 0.025 0.015 0.010
X 1 0.050 0.030 0.020
2 0.125 0.075 0.050
3 0.15 0.090 0.060
4 0.1 0.060 0.04
5 0.05 0.030 0.02
Examples
• (a) Find P(X = Y).
• (b) Find the marginal distribution of X and Y.
• (c) Suppose a bus occupies three vehicle spaces and
a car occupies just one. What is the mean number of
vehicle spaces occupied during a signal cycles? That
is, find the mean or expected value of h(X, Y) = X +
3Y
• Solution: (
a) The number of cars equals the number of buses if X
= Y. Hence, P(X = Y) = p(0, 0) + p(1, 1) + p(2, 2) = .025
+ .030 + .050 = .105. That is, about 10.5% of the time.
• (b) Adding the row values yields the marginal
distribution of the x values:
x 0 1 2 3 4 5
P(X) 0.05 0.1 0.25 0.3 0.2 0.1

• So, the mean number of cars is µx = E(X) is µx


= 0(0.05) + 1(.10) + 2(.25) + 3(.30) + 4(.20) +
5(.10) = 2.8.
• Similarly, adding the column values yields the
marginal distribution of the y as:
Example
y 0 1 2
P(y) 0.50 0.30 0.2

= 0.5*0+ 0.3*1+0.2*2=0.7
(c) Let X and Y denote the number of cars and
buses at a signal cycle. Then the number of vehicle
spaces occupied is h(X, Y) = X + 3Y. Hence, the
mean number of spaces occupied is then E(h(X, Y))
= E(X + 3Y) is

µh(x,y) = ΣΣ (x + 3y)p(x, y)
= [0 + 3(0)](.025) + [0 + 3(1)](.015) + ... + [5 +
3(2)](.020) = 4.90.
Example

• Note that E(h(X, Y)) = E(X + 3Y) can also be


computed from the result E(X + 3Y) = E(X) +
3E(Y), using the marginal distributions of X and
Y
Marginal Probability Distributions (1/2)

• Marginal probability distribution


– Obtained by summing or integrating the joint
probability distribution over the values of the
other random variable
– Discrete

P ( X  i )  pi    pij
j

– Continuous

f X ( x)   f ( x, y )dy

Marginal Probability Distributions (2/2)

• Example 19
– Marginal p.m.f of X
3
P ( X  1)   p1 j  0.12  0.08  0.01  0.21
j 1

– Marginal p.m.f of Y

4
P (Y  1)   pi1  0.12  0.08  0.07  0.05  0.32
i 1
• Example 20: (a jointly continuous case)

• Joint pdf:
f ( x, y )
• Marginal pdf’s of X and Y:

f X ( x)   f ( x, y )dy

fY ( y )   f ( x, y )dx
Conditional Probability Distributions (1/2)
• Conditional probability distributions
– The probabilistic properties of the random variable X under the
knowledge provided by the value of Y
– Discrete
P( X  i, Y  j ) pij
pi| j  P ( X  i | Y  j )  
P(Y  j ) p j
– Continuous
f ( x, y )
f X |Y  y ( x ) 
fY ( y )

– The conditional probability distribution is a probability distribution.


Conditional Probability Distributions (2/2)

• Example 19
– Marginal probability distribution of Y
P (Y  3)  p3  0.01  0.01  0.02  0.07  0.11

p13 0.01
p1|Y 3  P ( X  1| Y  3)    0.091
p3 0.11
– Conditional distribution of X
Independence and Covariance (1/5)
• Two random variables X and Y are said to be independent if
– Discrete

pij  pi  p j for all values iof  X and jof Y


– Continuous

f ( x, y )  f X ( x) fY ( y ) for all x and y

– How is this independency different from the independence


among events?
Independence and Covariance (2/5)
• Covariance
Cov( X , Y )  E (( X  E ( X ))(Y  E (Y )))
 E ( XY )  E ( X ) E (Y )

Cov( X , Y )  E (( X  E ( X ))(Y  E (Y )))


 E ( XY  XE (Y )  E ( X )Y  E ( X ) E (Y ))
 E ( XY )  E ( X ) E (Y )  E ( X ) E (Y )  E ( X ) E (Y )
 E ( XY )  E ( X ) E (Y )

– May take any positive or negative numbers.


– Independent random variables have a covariance of zero
– What if the covariance is zero?
Independence and Covariance (3/5)

• Example 19 (Air conditioner maintenance)


E ( X )  2.59, E (Y )  1.79
4 3
E ( XY )   ijpij
i 1 j 1

 (11 0.12)  (1 2  0.08)


   (4  3  0.07)  4.86
Cov( X , Y )  E ( XY )  E ( X ) E (Y )
 4.86  (2.59 1.79)  0.224
Independence and Covariance (4/5)

• Correlation:
Cov( X , Y )
Corr( X , Y ) 
Var( X )Var(Y )

– Values between -1 and 1, and independent


random variables have a correlation of zero
Independence and Covariance (5/5)

• Example 19: (Air conditioner maintenance)


Var( X )  1.162, Var(Y )  0.384

Cov( X , Y )
Corr( X , Y ) 
Var( X )Var(Y )
0.224
  0.34
1.162  0.384
• What if random variable X and Y have linear relationship, that is,
Y  aX  b
where a0
Cov( X , Y )  E[ XY ]  E[ X ]E[Y ]
 E[ X (aX  b)]  E[ X ]E[aX  b]
 aE[ X 2 ]  bE[ X ]  aE 2 [ X ]  bE[ X ]
 a ( E[ X 2 ]  E 2 [ X ])  aVar ( X )
Cov( X , Y ) aVar ( X )
Corr ( X , Y )  
Var ( X )Var (Y ) Var ( X )a 2Var ( X )
That is, Corr(X,Y)=1 if a>0; -1 if a<0.
Combinations and Functions of Random Variables

Linear Functions of Random Variables (1/4)


• Linear Functions of a Random Variable
– If X is a random variable and Y  aX  b
for some numbers athen
,b R E (Y )  aE ( X )  b
and Var(Y )  a 2 Var( X )

• Standardization
-If a random variable has an
X expectation of 
and a variance of ,
 2 Y  X    1 X     
   
has an expectation of zero and a variance of one.
Linear Functions of Random Variables (2/4)

• Example 21:Test Score Standardization


– Suppose that the raw score X from a particular
testing procedure are distributed between -5 and
20 with an expected value
Y  4of
X 1020and a variance 7.
In order to standardize the scores so that they lie
between 0 and 100, the linear transformation
is applied to the scores.
Linear Functions of Random Variables (3/4)

– For example, x=12 corresponds to a standardized


score of y=(4ⅹ12)+20=68
E (Y )  4 E ( X )  20  (4 10)  20  60

Var(Y )  42 Var( X )  4 2  7  112

 Y  112  10.58
Linear Functions of Random Variables (4/4)

• Sums of Random Variables


X1 X2
– If and are two random variables, then
E ( X 1  X 2 )  E ( X 1 )  E ( X 2 )  ( why ?)

Var( X
and
1  X 2 )  Var( X 1 )  Var( X 2 )  2Cov( X 1 , X 2 )
X1 X2 Cov( X 1 , X 2 )  0
– If and are independent, so that
thenVar( X 1  X 2 )  Var( X 1 )  Var( X 2 )
• Properties of Cov( X 1 , X 2 )
Cov( X 1 , X 2 )  E[ X 1 X 2 ]  E[ X 1 ]E[ X 2 ]

 Cov( X 1 , X 2 )  Cov( X 2 , X 1 )
Cov( X 1 , X 1 )  Var ( X 1 ) Cov( X 2 , X 2 )  Var ( X 2 )
Cov( X 1  X 2 , X 1 )  Cov( X 1 , X 1 )  Cov( X 2 , X 1 )
Cov( X 1  X 2 , X 1  X 2 )  Cov( X 1 , X 1 )  Cov ( X 1 , X 2 ) 
Cov( X 2 , X 1 )  Cov( X 2 , X 2 )

 Var ( X 1  X 2 )  Var ( X 1 )  Var ( X 2 )  2Cov( X 1, X 2 )


Linear Combinations of Random Variables
(1/5)
• Linear Combinations of Random VariablesX ,  , X 1 n

– If is a sequence of random variables and


a1 ,  , an

b and are constants, then


E (a1 X 1    an X n  b)  a1 E ( X 1 )    an E ( X n )  b

– If, in addition, the random variables are


independent, then
2 2
Var(a1 X 1    an X n  b)  a1 Var( X 1 )    an Var( X n )
Linear Combinations of Random Variables (2/5)
• Averaging Independent Random Variables
– Suppose that X 1 ,is , Xn
a sequence of independent random variables with
an expectation and a variance .  2

– Let X1    X n
X
n
– Then E( X )  

and 2
Var( X ) 
n

– What happened to the variance?


Linear Combinations of Random Variables
(3/5)
1 1  1 1
E ( X )  E  X1   X n   E ( X1 )    E ( X n )
n n  n n
1 1
     
n n

2 2
1 1  1 1
Var( X )  Var  X 1    X n     Var( X 1 )     Var( X n )
n n  n n
2 2
2
1 2 1 2 
        
n n n
Linear Combinations of Random Variables
(4/5)
• Example 21
– The standardized scores of the two tests are
10 5 50
Y1  X1 and Y2  X2 
3 3 3

– The final score is


2 1 20 5 50
Z  Y1  Y2  X1  X 2 
3 3 9 9 9
Linear Combinations of Random Variables
(5/5)
– The expected value of the final score is
20 5 50
E (Z )  E( X1)  E( X 2 ) 
9 9 9
 20  5  50
  18     30  
 9  9  9
 62.22

– The variance of the 20final score


5 50is
Var( Z )  Var  X1  X 2  
 9 9 9 
2 2
 20  5
    Var( X 1 )     Var( X 2 )
 9  9
2 2
 20  5
    24     60  137.04
 9  9

You might also like