Slide set 8 Stat 330 (Spring 2015) Last update: January 16, 2015 Stat 330 (Spring 2015): slide set 8 Statistics of R.V.s Expectation The expected value of a function h(X) is defined as P E[h(X)] := i h(xi) · pX (xi). The most important version of this is the case h(x) = x: P E[X] = i xi · pX (xi) =: µ E[X] is usually denoted by the symbol µ. The expected value of a random variable E[X] is a measure of the average value of the possible values of the random variable. We see that it is actually a weighted average of the values of X, weighted by the point masses pX (xi)’s. 1 Stat 330 (Spring 2015): slide set 8 Example Toss a Die Toss a fair die, and denote by X the number of spots on the upturned face. What is the expected value for X? The probability mass function of X is pX (i) = 1 6 for all i ∈ {1, 2, 3, 4, 5, 6}. Therefore, using the definition 6 X 1 1 1 1 1 1 E(X) = ipX (i) = 1 · + 2 · + 3 · + 4 · + 5 · + 6 · = 3.5. 6 6 6 6 6 6 i=1 This formula shows that E(X) is also the center of gravity of masses pX placed at corresponding points x. 2 Stat 330 (Spring 2015): slide set 8 Statistics of R.V.s Variance A second common measure for describing a random variable is a measure of how far its values are spread out. The variance of a random variable X is defined as: P 2 V ar(X) := E[{X − E(X)} ] = i{xi − E(X)}2 · pX (xi) V ar(X) is usually denoted by the symbol σ 2 The variance is measured in squared units of X. p σ := V ar(X) is called the standard deviation of X, its units are the original units of the values of X. 3 Stat 330 (Spring 2015): slide set 8 Example: Toss a die (continued...) Toss a fair die, and denote with X the number of spots on the upturned face. What is the variance for X? Looking at the above definition for V ar(X), we see that we need to know the probability mass function and the value of E(X) for this computation. Recall: The probability mass function of X is pX (i) = {1, 2, 3, 4, 5, 6}; and E(X) = 3.5. Therefore, P6 V ar(X) = i=1(xi − 3.5)2pX (i) 1 6 for all i ∈ = 6.25 · 16 + 2.25 · 61 + 0.25 · 16 + 0.25 · 16 + 2.25 · 61 + 6.25 · 16 2 = 2.917 (spots ). The standard deviation for X is: p σ = V ar(X) = 1.71 (spots). 4 Stat 330 (Spring 2015): slide set 8 Example: Toss the doctored die Recall the example of the doctored die we talked about earlier. In that example, Z denoted the number of spots on the upturned face after toss of the die, the pmf of Z was shown to be z p(z) 1 2 3 4 1/6 1/3 1/3 1/6 Calculate E(Z) and V ar(Z)? E(Z) = 1 · 61 + 2 · 31 + 3 · 13 + 4 · 61 = 15 6 = 2.5 V ar(Z) = (1−2.5)2 · 61 +(2−2.5)2 · 13 +(3−2.5)2 · 13 +(4−2.5)2 · 61 = 0.9167 5 Stat 330 (Spring 2015): slide set 8 Some properties of E(X) and V ar(X) Theorem For two random variables X and Y and two real numbers a, b following holds: E(aX + bY ) = aE(X) + bE(Y ). Theorem For a random variable X and a real number a, following hold: (i) V ar(X) = E(X 2) − (E(X))2 (ii) V ar(aX) = a2V ar(X) Chebyshev’s Inequality For any positive real number k, and random variable X with variance σ 2: P (|X − E(X)| ≤ kσ) ≥ 1 − 1 k2 6 Stat 330 (Spring 2015): slide set 8 Cumulative Distribution Function Motivation: Very often we are interested in the probability of a whole range of values, like P (X ≤ 5) or P (4 ≤ X ≤ 16). Assume X is a discrete random variable: The function FX (t) := P (X ≤ t) is called the cumulative distribution function or the cdf of X. (Note that in Hofmann’s notes a different terminology is used; she calls it the probability distribution function. But we will use the terminology used in Baron’s book) What is the relationship between cdf and pmf, pX and FX ? Since X is a discrete random variable, the image of X can be written as {x1, x2, x3, . . .}, we are therefore interested in all xi with xi ≤ t: P FX (t) = P (X ≤ t) = P ({xi|xi ≤ t}) = i,with xi≤t pX (xi). 7 Stat 330 (Spring 2015): slide set 8 Example of a cdf Roll a fair die: X = number of spots on upturned face Sample Space is Ω = {1, 2, 3, 4, 5, 6} The probability mass function for X therefore is 1 2 3 4 5 6 x pX (x) 16 16 16 16 16 16 What is the cumulative distribution function? P Pbtc Solution: FX (t) = i≤t pX (i) = i=1 pX (i) = truncated value of t. btc 6 , where btc is the t (−∞, 1) [1, 2) [2, 3) [3, 4) [4, 5) [5, 6) [6, ∞) 1 2 3 4 5 FX (t) 0 1 6 6 6 6 6 See Example 3.1, 3.2 in Baron and Figure 3.1 for another example. 8 Stat 330 (Spring 2015): slide set 8 Example of a cdf (continued...) Plot of the cdf for the fair die tossing problem: 9 Stat 330 (Spring 2015): slide set 8 Plots of pmf and cdf for the doctored die example Let Z denote the number of spots on the upturned face after toss of the doctored die. The pmf of Z was shown to be z 1 2 3 4 p(z) 1/6 1/3 1/3 1/6 10 Stat 330 (Spring 2015): slide set 8 Example of computing CDFs Let X be a random variable with the pmf: x p(x) 0 1 2 3 1/8 1/2 1/4 1/8 Evaluate FX (0.5), FX (1), FX (3) FX (0.5) = P (X ≤ 0.5) = P (X = 0) = 1 8 FX (1) = P (X ≤ 1) = P (X = 0 or X = 1) = P (X = 0) + P (X = 1) = 1 8 + 21 = 5 8 FX (3) = P (X ≤ 3) = P (X = 0) + P (X = 1) + P (X = 2) + P (X = 3) = 1.0 11 Stat 330 (Spring 2015): slide set 8 Properties of FX Properties of FX : random variable X. The following properties hold for the cdf FX of a • 0 ≤ FX (t) ≤ 1 for all t ∈ R • FX is nondecreasing, (i.e. if x1 ≤ x2 then FX (x1) ≤ FX (x2).) • limt→−∞ FX (t) = 0 and limt→∞ FX (t) = 1. • FX (t) is right continuous with respect to t 12