Definition of the moment function An informal definition of the median An example of using the median in replacement of the mean

: j i i i g x y p x   is the sum of probabilities for the event gX = y j to occur { } j j j g X y y P    = E[gX]. by the definition of E[gX] Example 4.10 Let random variable X P {X 0.2, P{X = 0} = 0.5, P{X = 1} = 0.3, and let gX = X 2 , computer E[gX]. Solution:  By Proposition 4.1, we have E [X 2 2 p1 + 0 2 p0 + 1 2 p1 2 0.2 + 0 2 0.5 + 1 2 0.3 = 0.5 which is the same as that computed in Example 4.9

3. Linearity property of the expectation function

 Corollary 4.1 If a and b are two constants, then E [aX + b] = aE[X] + b. Proof: E [aX + b] = : 0 x p x ax b p x    by Proposition 4.1 : 0 : 0 x p x i p x a xp x b p x       = aE[X] + b. by the definition of expectation and Axiom 2: : 0 i p x p x   = 1  Noteμ the notation “i: px discrete values x with non-zero px are dealt with.  Comments:  The expectation function E[· ] may be regarded as a linear operator according to the above corollary.  E[X] is also called the first moment of X.

4. Definition of the moment function

 Definition 4.5 The nth moment of X is defined as E [X n ] = : 0 n x p x x p x   .  The moment function is useful in many engineering application areas. 5. Other interesting averages of numbers ---  In daily life, the mean may be used roughly a simple representative value of a group of numerical data, showing the “overall magnitude” or the “trend” of the data values. Here, in this course it is formally defined as the weighted average of the possible values of a random variable.  However, the mean sometimes is not a good representation of a data group in certain applications. There are “averages of other senses” for various uses. 6. An example of improper use of the mean --- Two groups of students took a test and their scores are shown in Table 4.1. How should we evaluate their achievements? Which group is better? A common answer is to use the means in the following way.  The two groups’ mean scores may be computed easily to be 87 and 103, respectively.  And so we may say that group B has a better achievement accordingly.  However, an inspection of the table data reveals that the larger mean score value of Group B is contributed mainly by the large value of 357 of a member in the group; the other members as a whole actually are not so good as those of Group A.  Then, is there another way of evaluation using a single representative value related to the data of each group?  An answer is to use the median instead of the mean, as described next.

7. An informal definition of the median

Simply speaking, the median m of a group of numerical data is the value such that the number of data values larger than m is equal to the number of those smaller than m. A formal definition of median for random variables will be given later.

8. An example of using the median in replacement of the mean

For the last example immediate above, we try to use the median in the following way.  After sorting the data in Table 4.1 to become Table 4.2, the medians of the two groups can be found easily to be 86 and 75, respectively.  Therefore, judging from the two median values 86 and 75, we get a conclusion, contrary to that mentioned previously, that Group A, instead of B, has a better achievement.  Translation of the two terms mean, median: Table 4.1 Test scores of two groups of students. Group A Group B 86 75 72 38 112 357 113 77 91 79 48 42 87 53 sum=609 sum=721 mean=87 mean=103 Table 4.2 Test scores of two groups of students. Group A Group B 72 38 48 42 86 53 median=87 median=75 113 77 91 79 112 357 sum=609 sum=721 mean=87 mean=103 9. Formal definition of the median of a random variable ---  In the last example, a group of data values may be regarded as the outcomes of a random variable X and the informal definition of its median m --- “the number of data values larger than m is equal to the number of those smaller than m ” --- means that the value of X is just as likely to be larger than m as it is to be smaller, or equivalently, that the probability for X m and that for X m are equal, leading to the following formal definition for the median.  Definition 4.6 --- Given a discrete random variable X with cdf F, the median of X is defined as the value m such that Fm = 12.  Comments:  In words, a random variable is just as likely to be larger than its median as it is to be smaller.  Sometimes, due to the discreteness of the random variable, the exact value of m for Fm = 12 to be true is not available, but can only be estimated in such a way that Fm is as close to 12 as possible. Example 4.11 computing the median for a discrete random variable Find the median m of the random variable X whose values are taken to be the outcomes of tossing a fair die. Note that the mean of this X has been computed to be 3.5 in Example 4.7. Solution:  Obviously, the pmf for X is: p1 = 16, p 2 = 16, …, p6 = 16.  By the definition of cdf, it is easy to see that the cdf F for X is: F1 = 16, F2 = 16 + 16 = 13, F3 = 16 +16 + 16 = 12, and so on.  Therefore, the median of X is 3, which is different from the mean of X already known to be 3.5.

10. Two other types of means: geometric and harmonic means