Professional Documents
Culture Documents
Stat IM CH3
Stat IM CH3
RANDOM VARIABLES
<def> A random variable X is a function that associates a real number with each
map
element in sample space S. X : S R
• A random variable is a numerical description of the outcome of an experiment.
• A random variable can be classified as being either discrete or continuous
depending on the numerical values it assumes.
• A discrete random variable (離散隨機變數)may assume either a finite
number of values or an infinite sequence of values.
• A continuous random variable (連續隨機變數) may assume any numerical
value in an interval or collection of intervals.
Example: X = the sum of two fair dice
X
S R
(1,1) 2
(1,2)(2,1) 3
... ...
(6,6) 12
Ch 3-1
Statistics Ch 3: Random Variables and Probability Distributions Page 3-2
Ch 3-2
Statistics Ch 3: Random Variables and Probability Distributions Page 3-3
i 1
i 2,3,,7
Example: X = the sum of two fair dice => P{ X i} 36
13 i
i 8,9,,12
36
Example: X = the # of flips required to have the first head (p = the prob. of a coin
coming up head)
Ch 3-3
Statistics Ch 3: Random Variables and Probability Distributions Page 3-4
m
P{ X n} P{at least one outcome has not occurred in the first n trials} P Ai
i 1
P{ X n 1} P{at least one outcome has not occurred in the first n - 1 trials}
m
P Bi
i 1
m m
P{ X n} P{ X n 1} P{ X n} P Bi P Ai
i 1 i 1
m
pi (1 pi ) n 1 ( pi p j )(1 pi p j ) n 1
i 1 i j
Graphic form
Bar Chart Probability Histogram
9 Frequency
8
7
6
5
4
3
2
1
CDF
Cumulative Frequency
Ch 3-4
Statistics Ch 3: Random Variables and Probability Distributions Page 3-5
• A continuous random variable can assume any value in an interval on the real
line or in a collection of intervals.
• It is not possible to talk about the probability of the random variable assuming a
particular value. That is, P{X=x}=0.
• Given a particular value, we only know the probability density(機率密度).
• We talk about the probability of the random variable assuming a value within a
given interval.
• The probability of the random variable assuming a value within some given
interval from x1 to x2 is defined to be the area under the graph of the probability
Ch 3-5
Statistics Ch 3: Random Variables and Probability Distributions Page 3-6
Graphic form
f(x)
x1 x2 x
x2
1 x 2
Example: f ( x ) 3
0 elsewhere
2
2 x2 x3 8 1
f ( x )dx dx 1
1 3 9
1
9 9
1
1 x2 x3 1
P( 0 x 1) dx
0 3 9
0
9
x
x t2
x t3
F ( x ) f (t )dt dt
1 3 9
1
3
x 1 x 1 3
9 9 9
0 x 1
x 1
3
F ( x) 1 x 2
9
1 x2
Ch 3-6
Statistics Ch 3: Random Variables and Probability Distributions Page 3-7
NOTES:
Discrete case:
1. P( X x) f ( x) P( x 1 X x) P( x 1 X x 1).
2. P( X x) P( X x) P( X x 1) F( x) F( x 1).
Continuous case:
1. P( X x) 0 f ( x).
2. f ( x ) is density, not probability
3. P( a X b) P( a X b) P( a X b) P( a X b).
dF ( x )
4. f ( x ) for all x at which F(x) is differentiable.
dx
Both Cases:
1. F( ) 0 or lim F ( x) 0
x
2. F() 1 or lim F ( x) 1
x
EMPIRICAL DISTRIBUTIONS
Sometimes, we cannot generate sufficient information or experimental data to
characterize a distribution totally. Usually, the function f ( x ) is unknown and its
form is assumed. We need good judgement based on all available information to
select a valid f ( x ) .
Example: Car Battery Life (n=40)
2.2 4.1 3.5 4.5 3.2 3.7 3.0 2.6 3.4 1.6 3.1 3.3 3.8 3.1 4.7
3.7 2.5 4.3 3.4 3.6 2.9 3.3 3.9 3.1 3.3 3.1 3.7 4.4 3.2 4.1
1.9 3.4 4.7 3.8 3.2 2.6 3.9 3.0 4.2 3.5
Ch 3-7
Statistics Ch 3: Random Variables and Probability Distributions Page 3-8
Frequency Distribution
Class Interval Class Midpoint Frequency, f Relative Frequency
1.5-1.9 1.7 2 0.05
2.0-2.4 2.2 1 0.025
2.5-2.9 2.7 4 0.1
3.0-3.4 3.2 15 0.375
3.5-3.9 3.7 10 0.25
4.0-4.4 4.2 5 0.125
4.5-4.9 4.7 3 0.075
Ch 3-8
Statistics Ch 3: Random Variables and Probability Distributions Page 3-9
Skewness:
3. P( X x, Y y) f ( x, y)
For any region A in the xy-plane, P[( X , Y ) A] f ( x, y) .
A
Ch 3-9
Statistics Ch 3: Random Variables and Probability Distributions Page 3-10
or P{ X A,Y B} f ( x, y)dxdy
B A
<def> The joint cumulative probability function of the random variables X and Y :
F ( x, y) P{ X x,Y y}
<def> The marginal distributions of the discrete random variables X and Y :
g ( x ) P{ X x , Y } f ( x , y )
y
h( y ) P{ X , Y y} f ( x , y )
x
Ch 3-10
Statistics Ch 3: Random Variables and Probability Distributions Page 3-11
f ( x, y)
f ( x| y )
( a ,b) x ( a ,b) h( y )
P( a X b| Y y ) x
b b f ( x, y)
f ( x| y ) dx
a
dx
a h ( y )
Example: 3 blue, 2 red, and 3 green balls are in a bag. Two balls are selected at
random. Let X be the number of blue and Y be the number of red balls
selected.
Sol:
3 2 3
x y 2 x y
f ( x, y) for x, y=0, 1, 2 and 0 x y 2 .
8
2
5 15 3 2
g ( x ) f ( x , y ) g (0) , g (1) , g (2) g( x) 1
y 2 x 14 28 28 x 0
15 3 1 2
h( y ) f ( x , y ) h(0) , h(1) , g (2) h( y) 1
x 2 y 28 7 28 y0
f ( x,1) 7 1 1
f ( x|1) f ( x,1) f ( 01
| ) , f (11
| ) , f ( 21
|)0
h(1) 3 2 2
2
(2 x 3 y ) 0 x , y 1
Example: f ( x , y ) 5
0 elsewhere
1
11
2 1 2 6
2 3 2
f ( x , y ) dxdy ( 2 x 3 y ) dxdy ( y)dy y y 1
00 5 0 5 5 5 5 0
1
1 2 4 3 4 3
g( x ) (2 x 3 y )dy xy y 2 x , 0 x 1
0 5 5 5 y 0 5 5
1
21
2 6 2 6
h( y) (2 x 3 y)dx x 2 xy y, 0 y 1
0 5 5 5 x 0 5 5
Ch 3-11
Statistics Ch 3: Random Variables and Probability Distributions Page 3-12
2
(2 x 3 y )
f ( x, y) 5 2 x 3y
f ( x| y )
h( y ) 2 6 1 3y
y
5 5
Statistical Independence:
We know that f ( x, y) f ( x| y)h( y) f ( y| x) g ( x) .
The random variables X and Y are said to be statistically independent if and only
if f (x, y) g (x)h( y) for all (x, y) within their range.
That is, f ( x| y ) g ( x ) and f ( y| x ) h( y )
MULTI-VARIATE DISTRIBUTIONS
The function f ( x1 , x 2 , , x n ) is a joint probability function of the random
variables X 1 , X 2 , , X n .
Marginal Distributions:
f ( x1 , x 2 , , x n )
x2 x3 xn
g ( x1 )
f ( x1 , x 2 , , x n ) dx 2 dx 3 dx n
Ch 3-12