<< Chapter < Page | Chapter >> Page > |
X = [2 2.5 3 3.5]; % Matrix of values (ordered)PX = 0.1*[2 2 3 3]; % Matrix of probabilitiesEX = dot(X,PX) % The usual MATLAB operation
EX = 2.8500Ex = sum(X.*PX) % An alternate calculation
Ex = 2.8500ex = X*PX' % Another alternate
ex = 2.8500
Expectation and primitive form
The definition and treatment above assumes X is in canonical form , in which case
We wish to ease this restriction to canonical form.
Suppose simple random variable X is in a primitive form
We show that
Before a formal verification, we begin with an example which exhibits the essential pattern. Establishing the general case is simply a matter of appropriate use of notation.
Inspection shows the distinct possible values of X to be 1, 2, or 3. Also,
so that
Now
To establish the general pattern, consider . We identify the distinct set of values containedin the set . Suppose these are . For any value t i in the range, identify the index set J i of those j such that . Then the terms
By the additivity of probability
Since for each we have , we have
—
Thus, the defining expression for expectation thus holds for X in a primitive form .
An alternate approach to obtaining the expectation from a primitive form is to use the csort operation to determine the distribution of X from the coefficients and probabilities of the primitive form.
Suppose X in a primitive form is
with respective probabilities
c = [1 2 1 3 2 2 1 3 2 1]; % Matrix of coefficientspc = 0.01*[8 11 6 13 5 8 12 7 14 16]; % Matrix of probabilitiesEX = c*pc'
EX = 1.7800 % Direct solution[X,PX] = csort(c,pc); % Determination of dbn for Xdisp([X;PX]')1.0000 0.4200
2.0000 0.38003.0000 0.2000
Ex = X*PX' % E[X]from distribution
Ex = 1.7800
Linearity
The result on primitive forms may be used to establish the linearity of mathematical expectation for simple random variables. Because of its fundamental importance, we work throughthe verification in some detail.
Suppose and (both in canonical form). Since
we have
Note that and . The class of these sets for all possible pairs forms a partition. Thus, the last summation expresses in a primitive form. Because of the result on primitive forms, above, we have
Notification Switch
Would you like to follow the 'Applied probability' conversation and receive update notifications?