Chapter 2.
The Random Variable
0. Introduction
1. The Random Variable Concept
2. Distribution Function
3. Density Function
4. The Gaussian Variable
5. Other Distribution and Density Examples
6. Conditional Distribution and Density Functions
Chapter 2. The Random Variable 1
2.1 Random Variable Concept
Random variable: Real function of the
elements of a sample space S.
RV is represented
p byy a capital
p letter
such as W,X, or Y and any particular
value of the RV by a lowercase letter
such as w
w, xx, or yy.
Given an experiment defined by a
sample space S with elements s, we
assign to every s a real number X (s)
according to some rule
X : a function that maps all elements
of the sample space into points on
the real line or some part thereof
Chapter 2. The Random Variable 2
2.1 Random Variable Concept
‐ Example 2.1‐1
2.1 1
Rolling a die and flipping a coin
Sample space
Let the r.v. be a function X as follows
1. A coin head (H) outcome
‐> positive value shown up on the die
2. A coin tail (T) outcome
‐> negative and twice value shown up on the die
Chapter 2. The Random Variable 3
2.1 Random Variable Concept
‐ Example 2.1‐2
2.1 2
The pointer on a wheel of chance is spun
The possible outcomes are the numbers from 0
to 12 marked on the wheel
Sample
p space
p {{0 < s 12}}
Define a r.v. by the function
X X (s) s 2
Points in S map onto the real line as the set {0
< x 144}
Chapter 2. The Random Variable 4
2.1 Random Variable Concept
Conditions for a Function to be a RV
Every point in S must correspond to only one
value of the RV
The set { X x } shall be an event for any real
number
b x
The probability of this event, P{X x}, is equal to the sum
of the probabilities of all the elementary events
corresponding to {X x}
The probabilities of the events {X=} and {X=‐ }
be 0: P{ X } 0 P{ X } 0
Discrete and Continuous RVs
Discrete RV: Having only discrete
Example 2.1‐1 : discrete RV defined on a discrete sample
space
From Example 2.1‐2 : we could define a discrete RV as
having the value 1 for the set of outcomes {0 < s 6},
and ‐1 for {6 < s 12}. This discrete RV is defined on a
continuous sample space
Continuous RV : Having a continuous range of
values
Example 2.1‐2 : continuous RV defined on a continuous
sample
l space
Mixed r.v. : Some of its values are discrete and
some are continuous
Chapter 2. The Random Variable 5
2. 2 Distribution Function
Cumulative Probabilityy Distribution
Function (CDF) F X ( x ) P { X x }
The probability of the event {X x}
Depend on x
A function of x
We shall often call FX(x) just the
distribution function of X.
Find the CDF graph for Rolling a Die
Example of CDF
Chapter 2. The Random Variable 6
2. 2 Distribution Function
Properties of CDF
(1 ) F X ( )
(2) F X ( )
(3) ? FX ( x) ?
(4) if x1 x 2 ,
(5 ) P { x1 X x 2 }
(6 ) F X ( x or ) F X ( x )
The
h fourth
f h states that
h FX(x)
( ) is
i a non decreasing
d i ft.
f
of x
The fifth property is justified from the fact that
h events X x1 andd x1 X x2 are
the
mutually exclusive so the probability of the event
X x2 X x1 x1 X x2 is the sum fo the
probabilities PX x1 andd Px1 X x2
Properties 1,2,4, and 6 ay be used as tests to
determine if some function could be a valid
distribution function.
Chapter 2. The Random Variable 7
2. 2 Distribution Function
Discrete Random Variable
If X is discrete RV, FX (x) : stairstep form
A
Amplitude
li d off a step : probability
b bili off occurrence off the
h
value where the step occurs
If the values of X are denoted xi, we may write
N
FX (x) P{X xi }u(x xi )
i 1 1 x 0
where u(∙) is the unit‐step function u ( x)
0 x 0
Using P( xi ) P{ X xi }
N N
FX ( x) P{ X xi }u ( x xi ) P( xi )u ( x xi )
i 1 i 1
Chapter 2. The Random Variable 8
2. 2 Distribution Function
– Example 2.2
2.2‐1
1
Let X have the discrete values in the set {‐1, ‐0.5,
0.7, 1.5, 3}
The corresponding probabilities {0.1, 0.2, 0.1, 0.4,
0.2}
Chapter 2. The Random Variable 9
2. 2 Distribution Function
– Example 2.2
2.2‐2
2
Wheel‐of‐chance experiment
Chapter 2. The Random Variable 10
2.3 Density Function
Density function of RV, X dFX ( x)
f X ( x)
dx
Existence
If the derivative of FX(x) exists,
exists then fX(x) exists.
exists
However, there may be places where dFX(x)/dx
is not defined
eg Points of abrupt change in slope
eg.
Continuous RV
Have Continuous distribution FX(x)
FX(x) also have corners as in example 2.2‐2
fX(x) : a function with step‐type discontinuities
Discrete RV
Stairstep form distribution function
Unit‐impulse function, (t) is used for describing the
derivative of FX(x) at the stairstep points.
N
FX ( x) P( xi )u ( x xi )
i 1
N
f X ( x) P( xi ) ( x xi )
i 1
Chapter 2. The Random Variable 11
2.3 Density Function
Unit‐Impulse Function (t)
Definition by its integral property
( x0 ) ( x) ( x x0 )dx
• (x) : any continuous function at the point x = x0
• (t) ; Can be integrated as a “function” with infinite
amplitude, area of unity, and zero duration
• The relationship of unit‐impulse and unit‐step functions
du ( x) x
( x)
d
dx
or ( )d u ( x)
• The general impulse function
Shown symbolically
y y as a vertical arrow occurringg at
the point x=x0 and having an amplitude equal to
the amplitude of the step function for which it is
the derivative
[Link]
Chapter 2. The Random Variable 12
2.3 Density Function
A discrete
di t RV
The density function
N
for a discrete RV FX ( x) P( xi )u ( x xi )
exists i 1
N
Using impulse f X ( x) P( xi ) ( x xi )
functions to describe i 1
the
h d derivative off FX(x)
( )
at its stair step points
Properties of Density
Functions
(1) f X ( x) all x
( 2)
f X ( x)dx
(3) FX ( x)
(4) P{x1 X x2 }
Chapter 2. The Random Variable 13
2.3 Density Function
– Example 2.3‐1
2.3 1
Test the function gX(x) if it can be a valid
density function
Property 1 : nonnegative
Property 2: Its area a=1 ‐> a=1/
0 x0 x x 0
1
g X ( x ) 2 ( x x0 ) x0 x x0
1 1
( x x0 ) x 0 x x0
2
0 x0 x
x
1
x0
g X ( ) d ( x x 0 ) 2
x0 x x0
2 2
G X ( x)
1 x g ( )d 1 1 ( x x ) 1 ( x x ) 2 x x x
2 x0 X 2
0
2 2
0 0 0
1 x x0
Chapter 2. The Random Variable 14
2.3 Density Function
– Example 2.3‐2,
2.3 2, 2.3
2.3‐3
3
Example 2.3‐2
From example 2.3‐1, set x0= 8, = 5, and a = 1/ = 1/5.
Find the probability that X has values greater than 4.5
but not greater than 6.7.
0 x0 x x0 0 3 x 13
1 ( x 3)
f X ( x ) 2 ( x x0 ) x0 x x 0 3 x 8
25
1 1 ( x 8)
( x x0 ) x 0 x x0 0 . 2 8 x 13
2 25
6.7
6.7 x 3 1 x2
P{4.5 X 6.7} dx 3x 0.2288
4.5 25 25 2 4.5
x2
Example 2.3‐3 FX ( x) u ( x) 1 e b where b 0
Find its density function
x2
x2
dF ( x) du ( x) d
f X ( x) X 1 e b u ( x) 1 e b
dx dx dx
x2
x2
x2
2x 2x
1 e b ( x) u ( x) e b u ( x) e b
b b
Chapter 2. The Random Variable 15
2.4 Gaussian RV
A RV,, X is called Gaussian if its densityy
function has the form
( xax )2
1 2 X2
f X ( x) e
2 X2
( a x ) 2 No closed-
1 x 2 X2
FX ( x ) e d form solution
2 X2
where X 0 and
aX
Chapter 2. The Random Variable 16
2.4 Gaussian RV
Numerical or approximation methods for
Gaussian r.v.
Tables ‐> many tables according to variable X , a X
Only
O l one table
t bl according
di to li d X 1, a X 0
t normalized
Consider
( a x ) 2
1 x 2 X2
FX ( x ) e d
2 X2
2
1 x
F(X )
2
e 2 d
For a negative value of x ;
From FX(x), consider
F ( x) 1 F ( x)
aX d
u du , X u aX
X X
2
1 a X u2
xa X
1 x 2 X 1
FX ( x )
X 2
e d
2
X e 2 du
x aX
FX ( x) F
X
Chapter 2. The Random Variable 17
2.4 Gaussian RV
– Example 2.4‐1,
2.4 1, 2.4
2.4‐2
2
Example 2.4‐1
Find the probability of the event {X5.5} for Gaussian r.v.
having aX = 3 and X = 2
P{ X 5.5} FX (5.5)
x aX a X 5.5 3
FX ( x) F u 1.25
X X 2
P{ X 5.5} FX (5.5) F (1.25) 0.8944
Example 2.4‐2
Assume that the height of clouds at some location is
Gaussian r.v. X with aX = 1830m and X = 460m
Find the probability that clouds will be higher than
2750m
P{ X 2750} 1 P{ X 2750}
F ( x) 1 F ( x) 1 FX (2750)
2750 1830
1 F
460
1 F (2.0)
1.0 0.9772
0.0228
Chapter 2. The Random Variable 18
2.4 Gaussian RV
Evaluations of F(X) by approximation
2
1
F ( x) 1 Q( x) where Q( x)
2
x e 2 d
2
1
Q( x)
2
x e 2 d Qf
Q-function
i
x2
1 e 2
x0
(1 a ) x a x 2 b 2
a 0.339, b 5.510
Ex) 2.4‐3 Gaussian r.v. with aX = 7, X = 0.5
7.3 7
P{ X 7.3} FX (7.3) F F (0.6) 0.7257
0 .5
F (0.6) 1 Q(0.6)
( 0. 6 ) 2 / 2
1 e
1
0.661(0.6) 0.339 (0.6) 2 5.51 2
0.7264
Chapter 2. The Random Variable 19
2.5 Other CDF/PDF Examples
Binomial 0 p 1 and N 1,2,
Density function & distribution function
N
N k
f X ( x) p (1 p) N k ( x k )
k 0 k
N
N k
FX ( x) p (1 p) N k u ( x k )
k 0 k
For N=6
and p=0.25
Chapter 2. The Random Variable 20
2.5 Other CDF/PDF Examples
Poisson b 0 (real constant )
Density function & distribution function
bk
f X ( x ) e ( x k )
b
k 0 k!
bk
FX ( x) e u ( x k )
b
k 0 k!
Quite similar to those for the binomial r.v.
If N and p0 for the binomial case in such a way
that Np=b,
Np=b a constant,
constant the Poisson case results
Applications: Wide variety of counting‐type applications
1. The number of defective units in sample taken from a
production line
2. The number of telephone calls made during a period of
time
3. The number of electrons emitted from a small section of
cathode in a given time interval
If the time interval of interest has duration T, and the
events being counted are known to occur at an average
rate and have a Poisson distribution, then b = T.
Chapter 2. The Random Variable 21
2.5 Other CDF/PDF Examples
Uniform a and b a
1 0 xa
a xb xa
f X ( x) (b a ) FX ( x ) a xb
0 elsewhere b a
1 bx
The
quantization of
signal samples
prior to
encoding
di ini
digital
communication
systems
‐> The error
introduced in
the round‐off
process
‐> uniform
distributed
Chapter 2. The Random Variable 22
2.5 Other CDF/PDF Examples
Exponential a and b a
1 ( x b a ) 1 ( x b a )
xa
f X ( x) b e FX ( x) 1 b e xa
0 xa 0 xa
Describing
rainfrop sizes
when a large
number of
rainstorm
measurements
are made
Fluctuations in
signal strength
received
i d by
b
radar from
certain tyoes of
air craft
Chapter 2. The Random Variable 23
2.5 Other CDF/PDF Examples
Rayleigh a and b a
2 ( xa ) 2
( x a )e b xa
f X ( x) b
0 xa
( xa ) 2
FX ( x) 1 e xa
b
0 xa
Y=(X12+X22)1/2
X1 and X2 are
zero‐mean
statistically
independent
Gaussian RVs
( 0)
(a=0).
The envelope of
one type of
noise
i when
h
passed through
a bandpass filter
Chapter 2. The Random Variable 24
2.6 Conditional Distribution and Density
Functions
Conditional Probability
For two events A and B where P(B)( )0,, the
conditional probability of A given B
P( A B)
P( A | B)
P (B
( B)
Conditional Distribution
A : Identified as the event {X x} for the r.v. x
Conditional distribution function of X
P{ X x B}
P{ X x | B} FX ( x | B)
P( B)
{ X x B} = the joint event { X x} B
This joint event consists of all outcomes s such that
X ( s ) x and sB
The conditional distribution : discrete,
continuous, or mixed random variables
Chapter 2. The Random Variable 25
2.6 Conditional Distribution and Density
Functions
Properties of Conditional Distribution
(1) FX ( | B)
(2) FX ( | B )
(3) FX ( x | B)
(4) if x1 x2
(5) P{x1 X x2 | B}
(6) FX ( x / | B) FX ( x | B )
These characteristics have the same general
meanings as described earlier following eqs.
(2.2‐2) : Distribution function section
Chapter 2. The Random Variable 26
2.6 Conditional Distribution and Density
Functions
Conditional Density
Conditional density function of the r.v. x
The derivative of the conditional distribution
function
dFX ( x | B)
f X ( x | B)
dx
If FX(x|B) contains discontinuities, impulse
response are present in fX(x|B) to account for
the derivatives at the discontinuities
Properties of Conditional Density
(1) 0 f X ( x | B) all x
( 2)
f X ( x | B)dx 1
x
(3) FX ( x | B )
f X ( | B)d
x2
(4) P{x1 X x2 | B} x1
f X ( x | B)dx
Chapter 2. The Random Variable 27
2.6 Conditional Distribution and Density
Functions
Method of Defining Conditioning Event
Event B is defined in terms of the RV X
Event B may depend on some RV other than X
Example: B { X b} b , b is real no.
P{ X x B}
P{ X x | B} FX ( x | B)
P( B)
P{ X x X b}
FX ( x | X b) P{ X x | X b}
P ( X b)
1. bx인 경우 ( X x ) ( X b) ( X b)
P{ X x X b}
FX ( x | X b) P{ X x | X b}
P ( X b)
P ( X b)
1
P ( X b)
2. x<b인 경우
( X x ) ( X b) ( X x )
P{ X x X b}
FX ( x | X b) P{ X x | X b}
P ( X b)
P( X x)
P ( X b)
Chapter 2. The Random Variable 28
2.6 Conditional Distribution and Density
Functions
Method of Defining Conditioning Event(con’d)
FX ( x)
xb
FX ( x | X b) FX (b)
1 xb
f X ( x) f X ( x)
b
xb
f X ( x | X b) FX (b) f X ( x)dx
xb
0
• Conditional Event has
not zero Prob.
0 FX (b) 1
FX ( x | X b) FX ( x)
f X ( x | X b) f X ( x ) x b
Chapter 2. The Random Variable 29
Problems
2.1‐7, 9, 10, 11, 12, 13, 14
2.2‐5, 9, 10
2.3‐1, 2, 3, 4, 5, 6, 7, 8, 15
2.4‐1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 14
2.5
2 5‐1
1, 3,
3 4,
4 5,
5 6,
6 7
2.6‐1, 2, 3
Chapter 2. The Random Variable 30