Sie sind auf Seite 1von 26

Chapter

2: Random
Variables
Chap
2: Random
Variables

2.1. Random variables

Chap 2.1
2.1.: Random Variables
Let be sample space of a probability model, and X a function that maps every , to a
unique point x R, the set of real numbers. Since the outcome is not certain, so is the
value X() = x. Thus if B is some subset of R, we may want to determine the probability of
X() B. To determine this probability, we can look at the set A = X 1 (B) . A
contains all that maps into B under the function X.

Chapter
2: Random
Variables
Chap
2: Random
Variables

2.1. Random variables

Obviously, if the set A = X 1 (B) is an event, the probability of A is well dened; in this
case we can say
probability of the event X() B = P (X 1 (B)) = P (A)
However, X 1 (B) may not always belong to for all B, thus creating difculties. The
notion of random variable (RV) makes sure that the inverse mapping always results in an
event so that we are able to determine the probability for any B R.
Random Variable (RV): A nite single valued function X() that maps the set of all
experimental outcomes into the set of real numbers R is said to be a RV, if the set
{|X()
x} is
event for every x in R.
It is important
toan
identify

the random variable X by the function X() that maps the sample outcome to the
The
corresponding value of the random variable X. That is
{X = x} = { |X() = x}
Since all events have well dened probability. Thus the probability of the event
{|X() x} must depend on x. Denote
P {|X() x} = FX (x) 0

(1)
2

Chapter
2: Random
Variables
Chap 2: Random
Variables

2.1. Random variables

The role of the subscript X is only to identify the actual RV. FX (x) is said to be the
Cumulative Distribution Function (CDF) associated with the RV X.

Chapter
2: Random
Variables
Chap
2: Random
Variables

2.2. Cumulative distribution function (CDF)

2.2. Cumulative
Distribution
Function (CDF)
Properties
of CDF

FX (+) = 1, FX () = 0

FX (+) = P {|X() +} = P () = 1
FX () = P {|X() } = P () = 0

If x1 < x2 , then FX (x1 ) FX (x2 )


If x1 < x2 , then the subset (, x1 ) (, x2 ). Consequently the event
{|X() x1 } {|X() x2 }, since X() x1 , implies X() x2 . As a result
FX (x1 ) = P (X() x1 ) P (X() x2 ) = FX (x2 )
implying that the probability distribution function is nonnegative and monotone
nondecreasing.

For all b > a, FX (b) FX (a) = P (a < X b)

To prove this theorem, express the event Eab = {a < X b} as a part of union of
4

Chapter
2: Random
Variables
Chap
2: Random
Variables

2.2. Cumulative distribution function (CDF)

disjoint events. Starting with the event Eb = {X b} . Note that Eb can be written as
the union
Eb = {X b} = {X a} {a < X b} = Ea Eab
Note also that Ea and Eab are disjoint so that P (Eb ) = P (Ea ) + P (Eab ). Since
P (Eb ) = FX (b) and P (Ea ) = FX (a), we can write FX (b) = FX (a) + P (a < X b),
which completes the proof.

Chapter
2: Random
Variables
Chap
2: Random
Variables
Example 1

2.2. Cumulative distribution function (CDF)

: X is a RV such that X() = c, . Find FX (x).

Solution: For x < c, {X() x} = , so that FX (x) = 0 and for x > c, {X() x} = ,
so that FX (x) = 1. (see gure below)

Figure 1: CDF for example 1.


Example 2

X(T)=0,
: Toss a coin. = {H, T }. Suppose the RV X is such that P
(T ) = q,X(H)=1.
We Pknow
P(T)=q
(H) =
1 q. Find FX (x).
Solution:
For x < 0, {X() x} = , so that FX (x) = 0.
8

2.3. Probability density function (PDF)

Chapter
2: Random
Variables
Chap
2: Random
Variables

2.3. Probability Density Function (pdf)


The rst derivative of the distribution function FX (x) is called the probability density
function fX (x) of the RV X. Thus
fX (x) =

d FX (x)
dx

and

FX (x + x) FX (x)
d FX (x)
= lim
0
x0
dx
x
it follows that fX (x) 0 for all x.
fX (x) =

Discrete RV:if X is a discrete type RV, then its density function has the general form
fX (x) =

pi (x xi )

where xi represent the jump-discontinuity points in FX (x). As Fig. 24 shows, fX (x)


represents a collection of positive discrete masses, and it is known as the probability
mass function (pmf) in the discrete case.
12

2.3. Probability density function (PDF)

Chapter
2: Random
Variables
Chap
2: Random
Variables

Figure 2:
4: Discrete pmf.
If X is a continuous type RV, fX (x) will be a continuous function,
We also obtain by integration
FX (x) =
Since FX (+) = 1, yields

x

fX (u) du

fX (u) du = 1

which justies its name as the density function.


13

Chapter
2: Random
Variables
Chap
2: Random
Variables

2.3. Probability density function (PDF)

we also get (Fig. 3b


5b)
P {x1 < X x2 } = FX (x2 ) FX (x1 ) =

 x2
x1

fX (x) dx

Thus the area under fX (x) in the interval (x1 , x2 ) represents the probability in the above
equation.

Figure 3:
5: Continuous pdf.
Often, RVs are referred by their specic density functions - both in the continuous and
discrete cases - and in what follows we shall list a number of RVs in each category.
14

Chapter
2: Random
Variables
Chap
2: Random
Variables

2.4. Continuous-type random variables

2.4. Continuous-type Random Variables


Normal (Gaussian): X is said to be normal or Gaussian RV, if


2
(x)
1
fX (x) = 2
exp 22
2

(2)

This is a bell shaped curve, symmetric around the parameter , and its distribution
function is given by




 x
x
1
(y )2

dy =
FX (x) =
exp
2
2
2

x
where (x) = 12 exp(y 2 /2)dy is called standard normal CDF, and is often
tabulated.


a
b

P (a < X < b) =


y
1
exp
Q(x) =
dy = 1 (x)
2
2
x
Q(x) is called Standard Normal complementary CDF, and Q(x) = 1 (x). Since
15

10

Chapter
Random
Variables
Chap 2:2:Random
Variables

2.4. Continuous-type random variables

Table of the Standard Normal Cumulative Distribution Function (z)

(-z)=1 - (z)
16 15a

11

2.4. Continuous-type random variables

Chapter
2: Random
Variables
Chap
2: Random
Variables

fX (x) depends on two parameters and 2 , the notation X N (, 2 ) is applied. If


Y =

N (0, 1)
(3)

Y is called normalized Gaussian RV. Furthermore,


aX + b N (a + b, a2 2 )
linear transform of a Gaussian RV is still Gaussian.
Uniform: X U (a, b), a < b, if
fX (x) =

1
ba

axb
o.w.
(4)

1617

12

2.4. Continuous-type random variables

Chapter
2: Random
Variables
Chap
2: Random
Variables

4: pdf of uniformly distributed and exponential distributed RVs.


Figure 6:
Exponential: X () if
fX (x) =

exp( x ) x 0
o.w.
(5)

1718

13

2.5. Discrete-type random variables

Chapter
2: Random
Variables
Chap
2: Random
Variables

2.5. Discrete-type Random Variables


Bernoulli: X takes the values of (0,1), and
P (X = 0) = q,
Binomial: X B(n, p)

P (X = k) =

P (X = 1) = p

pk q nk ,

k = 0, 1, 2, , n

Poisson: X P ()

P (X = k) = e

k!

k = 0, 1, 2, ,

20

14

2.5. Discrete-type random variables

Chapter
2: Random
Variables
Chap
2: Random
Variables

(a) Binomial

(b) Poisson

Figure 7:
5: pmf of Binomial and Poisson distributions.
Uniform: X takes the values from [1, , n], and
P (X = k) =

1
,
n

k = 1, , n

Geometric: (number of coin toss till rst head appear)


P (X = k) = (1 p)k1 p,

k = 1, ,

where the parameter p (0, 1) (probability for head appear on each one toss).

21

15

2.5. Discrete-type random variables

Chapter
2: Random
Variables
Chap
2: Random
Variables

Example of Poisson RV
Example of Poisson Distribution: the probability model of Poisson RV describes phenomena
that occur randomly in time. While the time of each occurrence is completely random, there
is a known average number of occurrences per unit time. For example, the arrival of
information requests at a WWW server, the initiation of telephone call, etc.
For example, calls arrive at random times at a telephone switching ofce with an average of
= 0.25 calls/second. The pmf of the number of calls that arrive in a T = 2 second interval
is

(0.5)k e0.5 k = 0, 1, 2,
k!
PK (k) =
0
o.w.

22

16

Chapter
2: Random
Variables
Chap
2: Random
Variables

2.6. Statistics of random variables

2.6.: Statistics of RVs


Chap 2.2
For a RV X, its pdf fX (x) represents complete information about it. Note that fX (x)
represents very detailed information, and quite often it is desirable to characterize the r.v in
terms of its average behavior. In this context, we will introduce two parameters - mean and
variance - that are universally used to represent the overall properties of the RV and its pdf.
Mean (Expected Value) of a RV X is dened as

X = E(X) = xfX (x) dx

(15)

If X is a discrete-type RV, then we get



 

X = E(X) = x
pi (x xi ) dx =
xi pi (x xi ) dx
=


i

x i pi =

(16)

xi P (X = xi )

Mean represents the average (mean) value of the RV in a very large number of trials. For
example
32

17

2.6. Statistics of random variables

Chapter
2: Random
Variables
Chap
2: Random
Variables
X U (a, b) (uniform distribution), then,

E(X) =

x
b2 a2
1 x2 b
a+b
dx =
|a =
=
ba
ba 2
2(b a)
2

is the midpoint of the interval (a, b).


X is exponential with parameter , then


x x/
e
dx =
yey dy =
E(X) =

0
0

(17)

implying that the parameter represents the mean value of the exponential RV.
X is Poisson with parameter , we get
E(X) =

kP (X = k) =

k=0


k=0


k=1

ke

k!

=e


k
k
k!

(18)

k=1


k
i

= e
= e e =
(k 1)!
i!
i=0

Thus the parameter also represents the mean of the Poisson RV.
33

18

2.6. Statistics of random variables

Chapter
2: Random
Variables
Chap
2: Random
Variables

Variance of RV:

Variance of a RV

Mean alone cannot be able to truly represent the pdf of any RV. As an example to illustrate
this, considering two Gaussian RVs X1 N (0, 1) and X2 N (0, 10). Both of them have
the same mean. However, as Fig. 16 shows, their pdfs are quite different. One is more
concentrated around the mean, whereas the other one has a wider spread. Clearly, we need at
least an additional parameter to measure this spread around the mean!

Figure 6:
9: Two Gaussian RV with different variance.

37

19

2.6. Statistics of random variables

Chapter
2: Random
Variables
Chap
2: Random
Variables

For a RV X with mean , X represents the deviation of the RV from its mean. Since this
deviation can be either positive or negative, consider the quantity (X )2 , and its average
value E[(X )2 ] represents the average mean square deviation of X around its mean.
Dene
2
= E[(X )2 ] > 0
X

(25)

With g(X) = (X )2 and using (22) we get



2
X
=
(x )2 fX (x) dx > 0

2
X

(26)


is known as the variance of the RV X, and its square root X = E(X )2 is known
as the standard deviation of X. Note that the standard deviation represents the root mean
square spread of the RV X around its mean .

38

20

2.6. Statistics of random variables

Chapter
2: Random
Variables
Chap
2: Random
Variables

Expanding variance denition, and using the linearity of the integrals, we get

2
=
(x2 2x + 2 )fX (x) dx
V ar(X) = X



x2 fX (x)dx 2
xfX (x)dx + 2
=

(27)

= E(X 2 ) 2 = E(X 2 ) [E(X)]2 = X 2 X

For a Poisson RV, we can obtain that


2

2
X
= X 2 X = (2 + ) 2 =

Thus for a Poisson RV, mean and variance are both equal to its parameter .
The variance of the normal RV N (, 2 ) can be obtained as

2
2
1
V ar(X) = E[(X )2 ] =
(x )2
e(x) /2 dx
2 2

(28)

To simplify the above integral, we can make use of the identity




2
2
1

fX (x) dx =
e(x) /2 dx = 1
2 2

39

21

Thus with k = 3, we get the probability of X being outside


the 3 interval around its mean to be 0.111 for any r.v.
Obviously this cannot be a tight bound as it includes all r.vs.
For example, in the case of a Gaussian r.v, from Table 2.1
( = 0, = 1)

P ( | X | 3 ) = 0 .0027 .

(3-16)

which is much tighter than that given by (3-15). Chebychev


inequality always underestimates the exact probability.

23

Functions of a Random Variable


Let X be a r.v defined on the model (, F , P ), and suppose
g(x) is a function of the variable x. Define
Y = g( X ).

Is Y necessarily a r.v? If so what is its CDF FY(y), pdf fY ( y ) ?


aX + b
sin X

1
X

Y = g(X )

|X |
X

log X

| X |U ( x)

24

12

Example 3b.1:Y = aX + b
Solution: Suppose a > 0 .
y b

y b
FY ( y) = P (Y y ) = P (aX + b y ) = P X
= FX
.
a

and
fY ( y) =

1 y b
fX
.
a a

On the other hand if a < 0 , then


yb

FY ( y ) = P(Y y ) = P (aX + b y ) = P X >

yb
= 1 FX
,
a

and hence
fY ( y ) =

1 y b
f
.
a X a
25

Therefore, we obtain (for all a)


fY ( y) =

1
y b
fX
.
|a| a

Example 3b.2:Y = X 2 .

(3-17)

FY ( y ) = P (Y y ) = P X 2 y .

(3-18)

If y < 0, then the event { X 2 y}= , and hence


FY ( y ) = 0, y < 0.

For y > 0, from Fig. 3.4, the event


is equivalent to { x1 < X x 2 }.

(3-19)
{Y y } = { X

y}

Y =X2
y

x1

Fig. 3.4

x2

26

13

Example 3b.1:Y = aX + b
Solution: Suppose a > 0 .
y b

y b
FY ( y) = P (Y y ) = P (aX + b y ) = P X
= FX
.
a

and
fY ( y) =

1 y b
fX
.
a a

On the other hand if a < 0 , then


yb

FY ( y ) = P(Y y ) = P (aX + b y ) = P X >

yb
= 1 FX
,
a

and hence
fY ( y ) =

1 y b
f
.
a X a
25

Therefore, we obtain (for all a)


fY ( y) =

1
y b
fX
.
|a| a

Example 3b.2:Y = X 2 .

(3-17)

FY ( y ) = P (Y y ) = P X 2 y .

(3-18)

If y < 0, then the event { X 2 y}= , and hence


FY ( y ) = 0, y < 0.

For y > 0, from Fig. 3.4, the event


is equivalent to { x1 < X x 2 }.

(3-19)
{Y y } = { X

y}

Y =X2
y

x1

Fig. 3.4

x2

26

13

Hence
FY ( y ) = P (x1 < X x 2 ) = F X ( x2 ) F X ( x1 )
= FX ( y ) F X ( y ),

(3-20)

y > 0.

By direct differentiation, we get

1
f ( y ) + f X (

fY ( y) = 2 y X

0,

y) ,

y > 0,

(3-21)

otherwise .

If fX(x) represents an even function, then (3-21) reduces to


fY ( y ) =

1
fX
y

( y ) U ( y ).

(3-22)
27

In particular if X N(0,1), so that


fX (x) =

2
1
e x /2 ,
2

(3-23)

and substituting this into (3-21) or (3-22), we obtain the


p.d.f of Y = X 2 to be
fY ( y ) =

1
e y / 2U ( y ).
2 y

(3-24)

we notice that (3-24) represents a Chi-square r.v with n = 1,


since (1 / 2) = . Thus, if X is a Gaussian r.v with = 0,
then Y = X2 represents a Chi-square r.v with one degree of
freedom (n = 1).
28

14

Hence
FY ( y ) = P (x1 < X x 2 ) = F X ( x2 ) F X ( x1 )
= FX ( y ) F X ( y ),

(3-20)

y > 0.

By direct differentiation, we get

1
f ( y ) + f X (

fY ( y) = 2 y X

0,

y) ,

y > 0,

(3-21)

otherwise .

If fX(x) represents an even function, then (3-21) reduces to


fY ( y ) =

1
fX
y

( y ) U ( y ).

(3-22)
27

In particular if X N(0,1), so that


fX (x) =

2
1
e x /2 ,
2

(3-23)

and substituting this into (3-21) or (3-22), we obtain the


p.d.f of Y = X 2 to be
fY ( y ) =

1
e y / 2U ( y ).
2 y

(3-24)

we notice that (3-24) represents a Chi-square r.v with n = 1,


since (1 / 2) = . Thus, if X is a Gaussian r.v with = 0,
then Y = X2 represents a Chi-square r.v with one degree of
freedom (n = 1).
28

14

Das könnte Ihnen auch gefallen