Understanding Random Variables and PDFs
Understanding Random Variables and PDFs
4
Distribution Function: Note that a distribution function
g(x) is nondecreasing, right-continuous and satisfies
g ( ) 1, g ( ) 0, (2-5)
and F X ( ) P | X ( ) P ( ) 0 . (2-8)
(ii) If x 1 x 2 , then the subset ( , x1 ) ( , x2 ).
Consequently the event | X ( ) x 1 | X ( ) x 2 ,
since X ( ) x 1 implies X ( ) x 2 . As a result
F X ( x1 ) P X ( ) x1 P X ( ) x 2 F X ( x 2 ), (2-9)
FX ( x ) FX ( x ), (2-14)
or
P X ( ) x FX ( x ) FX ( x ). (2-20)
x
c
Fig. 2.2
FX(x)
1
q
x
1
Fig.2.3
•X is said to be a continuous-type r.v if its distribution
function FX (x ) is continuous. In that case F X ( x ) F X ( x ) for
all x, and from (2-21) we get P X x 0 .
•If F X ( x ) is constant except for a finite number of jump
discontinuities(piece-wise constant; step-type), then X is
said to be a discrete-type r.v. If xi is such a discontinuity
point, then from (2-21)
p i P X x i F X ( x i ) F X ( x i ). (2-22) 11
From Fig.2.2, at a point of discontinuity we get
P X c FX ( c ) FX ( c ) 1 0 1 .
and from Fig.2.3,
P X 0 FX ( 0 ) FX ( 0 ) q 0 q.
x
f X (x) p i ( x x i ) , (2-25) xi
i Fig. 2.5
where xi represent the jump-discontinuity points in FX ( x ).
As Fig. 2.5 shows f X ( x ) represents a collection of positive
discrete masses, and it is known as the probability mass
function (p.m.f ) in the discrete case. From (2-23), we
also obtain by integration
x
FX ( x) f x ( u ) du . (2-26)
x1 x2 x x1 x2 x
(a) (b)
Fig. 2.6
2
x
16
Fig. 3.7
2. Uniform: X U(a, b), a b, if (Fig. 2.8)
1
fX (x) b a
, a x b, (2.31)
0, otherwise.
f X (x) f X (x)
1
ba
x x
a b
Fig. 2.8 Fig. 2.9
17
4. Gamma: X G(, ) if ( 0, 0) (Fig. 2.10)
f X ( x)
1
x x/
e , x 0,
f X ( x ) ( ) (3-33)
0, otherwise. x
Fig. 2.10
If n an integer ( n ) ( n 1 )!. f X ( x)
18
6. Chi-Square: X 2 (n), if (Fig. 3.12)
fX ( x)
1
n/2 x n / 2 1e x / 2 , x 0 ,
f X ( x ) 2 (n / 2)
0, otherwise. (2-36) x
Fig. 2.12
x x 2 / 2 2
e , x 0,
f X ( x) 2
0, otherwise. (2-37) x
Fig. 2.13
8. Nakagami – m distribution:
2 m m 2 m 1 mx 2 /
x e , x0
f X ( x ) ( m )
(2-38)
0 otherwise
19
f X (x)
fX (x) fT ( t )
x t
Fig. 2.15 Fig. 2.16 20
Discrete-type random variables
1. Bernoulli: X takes the values (0,1), and
P ( X 0) q, P ( X 1) p . (2-43)
P(X k) P(X k)
k
12 n
21
Fig. 2.17 Fig. 2.18
4. Hypergeometric:
m N m
k n k
P( X k ) N
, max(0, m n N ) k min( m, n ) (2-46)
n
5. Geometric: X g ( p ) if
P ( X k ) pq k , k 0 ,1 , 2 , , , q 1 p. (2-47)
6. Negative Binomial: X ~ NB (r, p), if
k 1 r kr
P(X k) p q , k r , r 1, . (2-48)
r 1
7. Discrete-Uniform:
1
P(X k) , k 1, 2 , , N . (2-49)
N
We conclude this lecture with a general distribution due 22
23
24
The pdf of a continuous random variable is given by:
kx , 0 x 1
f X ( x)
0 , otherwise
where k is a constant.
25
1
a. f X ( x ) dx 1 kxdx 1
0
2
x 1
k 1
2 0
k
1
2
k 2
2 x , 0 x 1
f X ( x)
0, otherwise
26
b. The cdf of X is given by :
x
FX ( x) f X ( u ) du
Case 1 : for x 0
F X ( x ) 0 , since f X ( x ) 0 , for x 0
Case 2 : for 0 x 1
x x
2 x
FX ( x) f X ( u ) du 2 udu u x2
0 0 0
27
Case 3 : for x 1
1 1
2 1
FX ( x) f X ( u ) du 2 udu u 1
0 0 0
The cdf is given by
0, x 0
2
FX ( x) x , 0 x 1
1, x 1
28
c. P (1 / 4 X 1)
i . Using the pdf
1 1
P (1 / 4 X 1) f X ( x ) dx 2 x dx
1/ 4 1/ 4
2 1
P (1 / 4 X 1) x 15 / 16
1/ 4
P (1 / 4 X 1) 15 / 16
ii . Using the cdf
P (1 / 4 X 1) F X (1) F X (1 / 4 )
P (1 / 4 X 1) 1 (1 / 4 ) 2 15 / 16
P (1 / 4 X 1) 15 / 16
29
d. Mean and Variance
i . Mean
1 1
X E(X ) xf X ( x ) dx 2 x 2 dx
0 0
2x3 1
X 2/3
3 0
ii . Variance
2 2
X Var ( X ) E ( X ) [ E ( X )] 2
1 1
2 2
E(X ) x f X ( x ) dx 2 x 3 dx 1 / 2
0 0
2
X Var ( x ) 1 / 2 ( 2 / 3 ) 2 1 / 18
30
31
Example 1 Y aX b (2-50)
Solution: Suppose a 0 .
y b y b
FY ( y) PY ( ) y PaX ( ) b y P X ( ) FX . (2-51)
a a
and
1 y b (2-52)
fY ( y) f X .
a a
FY ( y ) P Y ( ) y P X 2 ( ) y . (2-57)
X
x1 x2 33
Hence
FY ( y ) P x1 X ( ) x 2 F X ( x 2 ) F X ( x1 )
FX ( y ) FX ( y ), y 0. (2-59)
X c, X c,
(2-62)
Y g ( X ) 0, c X c,
X c, X c.
35
In this case
P (Y 0) P ( c X ( ) c ) FX ( c ) FX ( c ). (2-63)
For y 0 , we have x c , and Y ( ) X ( ) c so that
FY ( y ) P Y ( ) y P ( X ( ) c y )
P X ( ) y c FX ( y c ), y 0 . (2-64)
Similarly y 0 , if x c , and Y ( ) X ( ) c so that
FY ( y ) P Y ( ) y P ( X ( ) c y )
P X ( ) y c FX ( y c ), y 0. (2-65)
Thus
f X ( y c ), y 0,
f Y ( y ) [ FX ( c ) FX ( c )] ( y ), (2-66)
f ( y c ), y 0.
X
g( X ) FX (x ) FY ( y )
c
c X
x y
(a) (b) (c) 36
Fig. 5.2
Example 5 : Half-wave rectifier
x, x 0,
Y g ( X ); g ( x) (2-67) Y
0, x 0.
In this case
X
P (Y 0) P ( X ( ) 0) FX ( 0). (2-68)
Thus
f X ( y ), y 0,
f Y ( y ) FX (0) ( y ) y 0, f X ( y )U ( y ) FX (0) ( y ). (2-70)
0, y 0,
37
Note: As a general approach, given Y g ( X ), first sketch
the graph y g ( x ), and determine the range space of y.
Suppose a y b is the range space of y g ( x ).
Then clearly for y a, FY ( y) 0, and for y b, FY ( y) 1, so
that FY ( y) can be nonzero only in a y b. Next, determine
whether there are discontinuities in the range space of y. If
so evaluate PY ( ) yi at these discontinuities. In the
continuous region of y, use the basic approach
FY ( y ) P g ( X ( )) y
x
x 1 x1 x1 x 3 x3 x3
x 2 x 2 x 2
dy dy y
2 x so that 2 y
dx dx x xi
X
and using (2-59) we get x1 x2
1
fY ( y ) 2 y
f X ( y ) f X ( y ) , y 0,
(2-78)
0, otherwise ,