Eec 161 ch04
Eec 161 ch04
Continuous Random
Variables
Example
FX (x) = P [X ≤ x] .
Example
1
x > 110.
Theorem 4.1
(b) P[Y ≤ 1]
0.5 0 y < 0,
F Y (y ) = y/4 0 ≤ y ≤ 4, (1)
0
1 y > 4.
0 2 4
y
From the CDF FY (y), we can calculate the probabilities:
(a) P[Y ≤ −1] = FY (−1) = 0
(b) P[Y ≤ 1] = FY (1) = 1/4
(c) P [2 < Y ≤ 3] = FY (3) − FY (2)
= 3/4 − 2/4 = 1/4.
(d) P [Y > 1.5] = 1 − P [Y ≤ 1.5]
= 1 − FY (1.5)
= 1 − (1.5)/4 = 5/8.
Section 4.3
p2
p1
∆ ∆ x
x1 x2
Figure 4.3 depicts the PDF of a random variable X that describes the
voltage at the receiver in a modem. What are probable values of X?
Figure 4.3
fX (x)
x
−5 5
Note that there are two places where the PDF has high values and that
it is low elsewhere. The PDF indicates that the random variable is likely
to be near −5 V (corresponding to the symbol 0 transmitted) and near
+5 V (corresponding to a 1 transmitted). Values far from ±5 V (due to
strong distortion) are possible but much less likely.
Theorem 4.2
Z x
(b) FX(x) = fX(u) du,
−∞
Z ∞
(c) fX(x) dx = 1.
−∞
Proof: Theorem 4.2
Z x
2
P [x1 < X ≤ x2] = fX (x) dx.
x1
Proof: Theorem 4.3
fX (x)
FX (x2 ) − FX (x1 )
x
x1 x2
1
FY (y) 0
y < 0,
0.5
FY (y ) = y 3 0 ≤ y ≤ 1, (1)
1 y > 1.
0
0 0.5 1 y
Find the PDF of Y and the probability that Y is between 1/4 and 3/4.
Example 4.5 Solution
We apply Definition 4.3 to the CDF FY (y). When FY (y) is piecewise differentiable, we
take the derivative of each piece:
3
fY (y) 2
3y 2
dFY (y) 0 < y ≤ 1,
fY (y) = = (1)
1 dy 0 otherwise.
0
0 0.5 1 y
Note that the PDF has values between 0 and 3. Its integral between any pair of
numbers is less than or equal to 1. The graph of fY (y) shows that there is a higher
probability of finding Y at the right side of the range of possible values than at the left side.
Either Theorem 4.1 or Theorem 4.3 can be used to calculate the probability of observing Y
between 1/4 and 3/4:
0.1
(x/4)e−x/2 x ≥ 0,
fX (x) =
0 otherwise.
0
0 5 10 15
x
(b) To find the CDF FX(x), we first note X is a nonnegative random variable so that
FX(x) = 0 for all x < 0. For x ≥ 0, [Continued]
Quiz 4.3 Solution (Continued 2)
Z x Z x
y −y/2
FX (x) = e dy
fX (y) dy =
0 0 4
Z x
y −y/2 x 1 −y/2
=− e + e dy
2 0 0 2
x −x/2
=1− e − e−x/2 . (3)
2
The complete expression for the CDF is
1
FX(x)
0.5 x
+ 1 e−x/2
1− 2
x ≥ 0,
FX (x) =
0 ow.
0
0 5 10 15
x
(c) From the CDF FX(x),
P [0 ≤ X ≤ 4] = FX (4) − FX (0)
= 1 − 3e−2 . (4)
(d) Similarly,
P [−2 ≤ X ≤ 2] = FX (2) − FX (−2)
= 1 − 3e−1 . (5)
Section 4.4
Expected Values
Definition 4.4 Expected Value
Z ∞ Z 1
E [X ] = xfX (x) dx = x dx = 1/2 (1)
−∞ 0
Example 4.7
Z ∞ Z 1
E [Y ] = yfY (y ) dy = y(3y 2) dy = 3/4 (1)
−∞ 0
Theorem 4.4
(a) E[X − µX ] = 0,
2
3y /2 −1 ≤ y ≤ 1,
1 fY (y) = (1)
0 otherwise.
0
−2 0 2
y
(a) The expected value of Y is
Z ∞ Z 1
3 1
(3/8)y 4 −1
E [Y ] = yfY (y) dy = (3/2)y dy = = 0. (2)
−∞ −1
Note that the above calculation wasn’t really necessary because E[Y ] = 0 whenever
the PDF fY (y) is an even function, i.e., fY (y) = fY (−y).
(b) The second moment of Y is
Z ∞ Z 1
5 1
2 2 4
E Y = y fY (y) dy = (3/2)y dy = (3/10)y −1 = 3/5. (3)
−∞ −1
The probability that a telephone call lasts no more than t minutes is often
modeled as an exponential CDF.
1
FT(t)
0.5 1 − e−t/3 t ≥ 0,
F T ( t) =
0 otherwise.
0
−5 0 5 t
What is the PDF of the duration in minutes of a telephone conversation?
What is the probability that a conversation will last between 2 and 4
minutes?
Example 4.12 Solution
Using the PDF fT(t) in Example 4.12, we calculate the expected duration
of a call:
Z ∞ Z ∞
1
E [T ] = tfT (t) dt = t e−t/3 dt. (1)
−∞ 0 3
Integration by parts (Appendix B, Math Fact B.10) yields
∞ Z ∞
E [T ] = −te−t/3 + e−t/3 dt = 3 minutes. (2)
0 0
To calculate the variance, we begin with the second moment of T :
Z ∞ Z ∞
1
t2 e−t/3 dt.
h i
E T2 = t2fT (t) dt = (3)
−∞ 0 3
[Continued]
Example 4.13 Solution (Continued 2)
Let Kα denote a Poisson (α) random variable. For any x > 0, the CDF
of an Erlang (n, λ) random variable X satisfies
Pn−1 (λx)k e−λx
1 − k=0 . x ≥ 0,
FX (x) = 1 − FKλx (n − 1) = k!
0 otherwise.
Quiz 4.5
(1/3)e−x/3 x ≥ 0,
fX (x) = (1)
0 otherwise.
(b) We know X is a uniform (a, b) random variable. To find a and b, we apply Theo-
rem 4.6 to write
a+b
E [X] = =3 (2)
2
(b − a)2
Var[X] = = 9. (3)
12
This implies
√
a + b = 6, b − a = ±6 3. (4)
The only valid solution with a < b is
√ √
a = 3 − 3 3, b = 3 + 3 3. (5)
[Continued]
Quiz 4.5 Solution (Continued 2)
The complete expression for the PDF of X is
√ √ √
1/(6 3) 3 − 3 3 < x < 3 + 3 3,
fX (x) = (6)
0 otherwise.
(c) We know that the Erlang (n, λ) random variable has PDF
( n n−1 −λx
λ x e
(n−1)!
x ≥ 0,
fX (x) = (7)
0 otherwise.
The expected value and variance are E[X] = n/λ and Var[X] = n/λ2 . This implies
n n
= 3, = 9. (8)
λ λ2
It follows that
n = 3λ = 9λ2 . (9)
Thus λ = 1/3 and n = 1. As a result, the Erlang (n, λ) random variable must be
the exponential (λ = 1/3) random variable with PDF
(1/3)e−x/3 x ≥ 0,
fX (x) = (10)
0 otherwise.
Section 4.6
0.8 0.8
0.6 0.6
fX(x) fX(x)
0.4 0.4
0.2 0.2
0 0
−2 0 2 4 6 −2 0 2 4 6
x x
(a) µ = 2, σ = 1/2 (b) µ = 2, σ = 2
E [X ] = µ Var [X ] = σ 2.
Theorem 4.13
Φ(−z) = 1 − Φ(z).
Figure 4.6
0.5 0.5
0.4 0.4
0.3 0.3
fX(x)
fX(x)
0.2 ←Φ(z) 0.2 Φ(−z) → ← 1−Φ(z)
0.1 0.1
0 0
−4 −2 0 z 2 4 −4 −2 −z 0 z 2 4
x x
(a) (b)
Symmetry properties of the Gaussian (0, 1) PDF.
Example 4.16 Problem
Applying Theorem 4.14, Theorem 4.15, and the result of Example 4.15,
we have
In q
an optical fiber transmission system, the probability of a bit error is
Q( γ/2), where γ is the signal-to-noise ratio. What is the minimum value
of γ that produces a bit error rate not exceeding 10−6?
Example 4.18 Solution
fY(y)
← fX(x)
0.2
fX(x)
← fY(y)
0
−5 0 5
x y
The fact that Y has twice the standard deviation of X is reflected in the
greater spread of fY (y). However, it is important to remember that as
the standard deviation increases, the peak value of the Gaussian PDF
goes down.
Each of the requested probabilities can be calculated using Φ(z) function
and Table 4.2 or Q(z) and Table 4.3. [Continued]
Quiz 4.6 Solution (Continued 2)
(a) Since X is Gaussian (0, 1),
Matlab
4.8 Comment: The Gaussian CDF in Matlab
For the Gaussian CDF, we use the built-in Matlab error function
2 xZ
2
erf(x) = √ e−u du. (1)
π 0
It is related to the Gaussian CDF by
!
1 1 x
Φ(x) = + erf √ , (2)
2 2 2
which is how we implement the Matlab function phi(x).
Matlab rand
• y=rand(m,n) is Matlab’s approximation to a uniform (0, 1) random variable.
• First, rand produces pseudorandom numbers; the numbers seem random but are
actually the output of a deterministic algorithm.
• Thus Matlab distinguishes no more than 264 unique double precision floating point
numbers.
• Even though rand is not random and does not have a continuous range, we can
for all practical purposes use it as a source of independent sample values of the
uniform (0, 1) random variable.
Quiz 4.8
function t=t2rv(m)
i=0;lambda=1/3;
t=zeros(m,1);
while (i<m),
x=exponentialrv(lambda,1);
if (x>2)
t(i+1)=x;
i=i+1;
end
end
A second method exploits the fact that if T is an exponential (λ) random variable, then
T 0 = T + 2 has PDF fT 0(t) = fT |T >2(t). In this case the command
t=2.0+exponentialrv(1/3,m)