Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
3 RANDOM VARIABLES
Random variable is a function that maps the sample space S into
the extended real line.
We denote the real line as
(- < x < +)
and the extended real line as + =
Formal definition:
S
{}
X : S +
P( S : X( ) = ) = 0
X( )
Stochastic Processes – Random Variables
3-1
+
Note: Random variable is not the variable in the usual
sense, but function.
Two sample points might be assigned to the same value
of X, i. e. X(1)
= X(2), but one sample point can not be
assigned to two different values of X.
S
2
1
X( )
Stochastic Processes – Random Variables
S
+
3-2
X1 ( )
X2 ( )
+
The sample space S is called the
domain of the random variable X.
Collection of all the values of X is called the
range of the random variable X.
Example 3-1: In the experiment of tossing a coin once we might
define the random variable as:
X(H) = 0, X(T) = 1
or
X(H) = 10, X(T) = 15
S
S
H
H
T
0
Stochastic Processes – Random Variables
1
+
3-3
10
T
15
+
Example 3-2: In the fair die experiment, we assign to the six
outcomes f1, f2, …, f6, the numbers X(fi) =10i. Thus, we have:
X(f1) = 10, X(f2) = 20, X(f3) = 30,…., X(f6) = 60,
S
f1
10
20
Stochastic Processes – Random Variables
f2
30
f3
f4
f5
40
3-4
f6
50
60
Events Defined by Random Variables
If X is a random variable, and x is a fixed real number, we can
define the event (X
= x) as:
X x : X x
Similarly, for fixed numbers x, x1, and x2, we can define the
following events:
X x : X x
X x : X x
x1 X x2 : x1 X x2
Stochastic Processes – Random Variables
3-5
We can ask ourselves what are the probability of these events.
Probabilities are defined by:
P X x P : X x
P X x P : X x
P X x P : X x
Px1 X x2 P : x1 X x2
Stochastic Processes – Random Variables
3-6
Example 3-3:
In the experiment of tossing a fair coin three times, the sample
space S consists of eight equally likely sample points:
S = {HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}
If X is a random variable giving the number of heads obtained,
find:
(a) P(X
= 2); (b) P(X < 2).
(a) Let A
S be the event defined by X = 2:
(b) Let B
S be the event defined by X < 2:
A X 2 : X 2 HHT , HTH ,THH
P X 2 P A 3 / 8
B X 2 : X 2 HTT ,THT ,TTH ,TTT
P X 2 PB 4 / 8 1/ 2
Stochastic Processes – Random Variables
3-7
Distribution function
The distribution function (or cumulative distribution function of X is
the function defined by:
FX x P X x x
Example 3-4: In the experiment of tossing a coin (not fair) once,
we defined the random variable as
probabilities of the of the events
X(H) = 0, X(T) = 1, with
P X 0 p; P X 1 q 1 p
Find the distribution function.
Stochastic Processes – Random Variables
3-8
x
( X x)
PX (x)
- < x <0
0
0 x <1
1
1 x < +
{H}
{H}
{H,P}
{H,P}
0
p
p
p+q=1
1
FX x
1
p
-1
Stochastic Processes – Random Variables
0
+1
3-9
x
Properties of the distribution function FX (x):
1.
0 FX ( x) 1
2.
FX ( x1 ) FX ( x2 )
3.
lim FX ( x) FX () 1
4.
lim FX ( x) FX () 0
5.
if x1 x2
x
x
lim FX ( x) FX (a ) FX (a)
x a
Stochastic Processes – Random Variables
3-10
Determination of the Probabilities from the Distribution function:
Pa X b FX b FX a
P X a 1 FX a
P X b FX b
P X x0 FX ( x0 ) FX x0
FX (x)
1
FX ( x0 )
x0
Stochastic Processes – Random Variables
3-11
x
For the continuous random variable:
P X x0 0
For the discrete random variable:
P X xi FX ( xi ) FX xi 1
P( X xi ) P( X xi 1 )
P X x pX (x) ,for discrete random variable,
is called the
probability mass function.
Stochastic Processes – Random Variables
3-12
Probability density function
The derivative
dFX ( x)
f X ( x)
dx
is called the probability density function of the continuous
random variable X.
If FX (x) has a jump discontinuity at the point x0, then the
probability density function contains the term:
F
(
x
)
F
(
x
)
(
x
x
)
F
(
x
)
F
(
x
X
0
X
0
0
X
0
X
0 ) ( x x0 )
*
*
*
*
x
FX ( x) P( X x) f X ( )d
Stochastic Processes – Random Variables
3-13
Properties of probability density function fX (x):
1.
f X ( x) 0
2.
f X ( x) 1
3.
fX (x) is piecewise continuous
b
4.
P(a X b) f X ( x)dx
a
Stochastic Processes – Random Variables
3-14
Mean value and Variance:
The mean (or expected) value of a random variable X,
denoted by X or E(X), is defined by:
xk p X ( xk ) X : discrete
k
X E ( X )
xf X ( x)dx X : continouos
The nth moment of a random variable X is defined by:
xkn p X ( xk )
k
n
mn E ( X )
x n f X ( x)dx
X : discrete
X : continouos
The nth moment about the mean is defined by
m E X X
Stochastic Processes – Random Variables
m
3-15
The Variance of a random variable X is defined by:
Var ( X ) E X X
2
X
2
xk X 2 p X ( xk ) X : discrete
k
2
X
2
x X f X ( x)dx X : continouos
E( X )
2
X
2
2
X
The standard deviation X of a random variable X is defined by:
X
Stochastic Processes – Random Variables
3-16
2
X
SOME SPECIAL DISTRIBUTIONS
Uniform distribution:
1
f X ( x) b a
0
fX (x)
a xb
otherwise
1
ba
a
0
x a
FX ( x)
b a
1
xa
a xb
xb
FX (x)
1
a
Stochastic Processes – Random Variables
3-17
b
x
b
x
Poisson Distribution
p X (k ) P( X k ) e
k
k!
pX (x)
x
FX ( x) e
n
k 0
X
Stochastic Processes – Random Variables
k
k!
n x n 1
2
X
3-18
Normal (or Gaussian) Distribution
1
f X ( x)
e
2
1
FX ( x)
2
X
By taking
X 0 and
x 2
2 2
x
2
e
2 2
d
2
X
2
X
2
1 we get the standard
normal distribution
.
You can se the diagram of the normal distribution by going to:
http://playfair.stanford.edu/~naras/jsm/NormalDensity/NormalDen
sity.html
Stochastic Processes – Random Variables
3-19
By introducing the change of variable
y ( X ) /
and the function (z)
1
( z )
2
z
e
y2
2
dy;
( z ) 1 ( z )
we can express the normal distribution as:
x X
1
FX ( x)
2
Error function is defined by:
Stochastic Processes – Random Variables
x X
e dy
2 z t 2
erf ( z )
e
y2
2
3-20
0
Conditional distributions:
The conditional distribution function FX
(x|B) of the random
variable X, under the condition that event B happens first, is
given by:
P( X x) B
FX ( x | B) P( X x | B)
P( B)
It has the same properties as FX
Also:
(x)
P( X xk ) B
p X ( xk | B) P( X xk | B)
P( B)
dFX ( x | B)
f X ( x | B)
dx
Stochastic Processes – Random Variables
3-21