Table 3.3 Probability of rolling a die
X
i
1
2
3
4
5
6
p
i
1/6
1/6
1/6
1/6
1/6
1/6
The mean of outcomes can be computed as
m
x
6
i1
p
i
X
i
1
6
1 2 3 4 5 6 3:5:
The variance of x, which is a measure of the spread about the mean, is defined as
s
2
x
Ex À m
x
2
I
ÀI
X À m
x
2
f XdX, continuous-time case
i
p
i
X
i
À m
x
2
, discrete-time case,
3:3:10
where x À m
x
is the deviation of x from the mean value m
x
. The mean of the squared
deviation indicates the average dispersion of the distribution about the mean m
x
. The
positive square root s
x
of variance is called the standard deviation of x. The MATLAB
function std calculates standard deviation. The statement
s std(x);
computes the standard deviation of the elements in the vector x.
The variance defined in (3.3.10) can be expressed as
s
2
x
Ex À m
x
2
Ex
2
À 2xm
x
m
2
x
Ex
2
À 2m
x
Ex m
2
x
Ex
2
À m
2
x
:
3:3:11
We call Ex
2
the mean-square value of x. Thus the variance is the difference between
the mean-square value and the square of the mean value. That is, the variance is the
expected value of the square of the random variable after the mean has been removed.
The expected value of the square of a random variable is equivalent to the notation of
power. If the mean value is equal to 0, then the variance is equal to the mean-square
value. For a zero-mean random variable x, i.e., m
x
0, we have
s
2
x
Ex
2
P
x
,
3:3:12
which is the power of x. In addition, if y ax where a is a constant, it can be shown that
s
2
y
a
2
s
2
x
. It can also be shown (see exercise problem) that P
x
m
2
x
s
2
x
if m
x
T
0.
Consider a uniform density function as given in (3.3.7). The mean of the function can
be computed by
INTRODUCTION TO RANDOM VARIABLES
93