Lecture Notes ApSc 3115/6115: Engineering Analysis III Chapter 7: Expectation and Variance Version: 5/30/2014 Text Book: A Modern Introduction to Probability and Statistics, Understanding Why and How By: F.M. Dekking. C. Kraaikamp, H.P.Lopuhaä and L.E. Meester APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 1
7.1 Expected Valuesá Random variables are complicated objects, containing a lot of information on the experiments that are modeled by them. Typically, random variables are summarized by two numbers: The expected value: also called the expectation or mean, gives the center - in the sense of average value - of the distribution of the random variable. The variance: a measure of spread of the distribution of the random variable. Example Expected Value: An oil company needs 10 drill bits in an exploration project. Suppose that it is known that drill bits will last, $, or % hours with probabilities!þ",!þ(, and!þ. How long can we expect the exploration to last? APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 2
7.1 Expected Valuesá One drill bit lasts on average:!þ"!þ( $!Þ %œ$þ" hours 10 drill bits Ê Exploration can continue (on average) for $" hours But could be as short as "! œ! hours or as long as "! % œ %! hours! Mathematical Fact: For large 8, 8drill bits last around 8 $Þ" hours. Definition: The expectation of a discrete random variable \ taking the values +ß+ßá and with probability mass function : is the number À " IÒ\Ó œ + TÐ\ œ + Ñ œ + :Ð+ Ñ 3 3 3 3 3 3 IÒ\Ó is called the expected value or mean of \, or its distribution APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 3
7.1 Expected Valuesá Quick exercise 7.1: Let \ be the discrete random variable that takes the values ",, %, ), and "', each with probability "Î&. Compute the expectation of \. " " " " " $" Solution QE7.1: IÒ\Óœ" & & % & ) & "' & œ & œ'þþ Additional Interpetation: Expected Value is the center of gravity or the balancing point of the probability distribution. For the random variable associated with the drill bit, this is illustrated in Figure 7.1. APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 4
7.1 Expected Valuesá How to define the expected value of a continuous random variable? Suppose \ is a RV on Ò!ß "Ó and we want to estimate/calculate IÒ\Ó. Step 1: Approximate \ by ] with outcomes!ß ß áß ß" and probabilities 8 " 8" 8 8 5 5 " 5 5 5 TÐ] 8 œ Ñ œ TÐ Ÿ \ Ÿ Ñ Ê IÒ] 8Ó œ TÐ] 8 œ ÑÞ 8 8 8 8 8 5" 5 1 5 8 8 8 8 8 5œ! Step 2: For large 8, we know TÐ Ÿ\Ÿ Ñ 0Ð ÑÊ 8 8 5 5 5 5 1 IÒ] 8Ó œ TÐ] 8 œ Ñ 0Ð Ñ Þ 8 8 8 8 8 5œ! 5œ! 5 5 1 Step 3: Now set IÒ\Ó œ lim 0Ð Ñ œ 8Ä B0ÐBÑ.BÞ 8 8 8 8 5œ!! " APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 5
7.1 Expected Valuesá Definition: The expectationß expected value or mean of a continuous random variable \ is the number À IÒ\Ó œ B0ÐBÑ.B APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 6
7.1 Expected Valuesá Quick exercise 7.2: Compute the expectation of a random variable Y that is uniformly distributed over Òß &Ó. " Solution QE 7.2: 0Ð?Ñ œ $ ß? Òß&Ó and! elsewhere. Hence, " " " & " & & % " " IÒYÓ œ?.? œ? œ? œ œ œ $ Þ $ $ ' ' ' ' & α " which is the balancing point! YµYÐα" ß ÑÊIÒYÓœ. The expected value of a random variable may not exist!! M œ B0ÐBÑ.B œ B0ÐBÑ.B B0ÐBÑ.B œ M M, M!ß M!Þ! It is possible that M œ ß M œ Ê The expected value does not exist. APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 7
7.1 Expected Valuesá Example: The Cauchy distribution 0ÐBÑœ " Ð"B Ñ 1 ß BÞ " " M œ B.B œ lnð"b Ñ œ! 1Ð" B Ñ 1!! " "! M œ B.B œ lnð"b Ñ œ 1Ð" B Ñ 1 The expected value may be of infinite value! When M is finite, but M is infinite, the expected value is infinite. Example: A distribution that has an infinite expectation is distribution with parameter α œ" (see Exercise 7.11). the Pareto APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 8
7.2 Three Examplesá \ The number of weeks until success µ K/9Ð:Ñß where : œ "! %. Definition: The expectation of a geometric distribution. \µk/9ð:ñêiò\óœ5 TÐ\œ5Ñœ 5" 5Ð":Ñ :œ " : 5œ" 5œ" The geometric distribution If you buy a lottery ticket every week and you have a chance of " in "!ß!!! of winning the jackpot, what is the expected number of weeks you have to buy tickets before you get the jackpot? Answer: "!ß!!! weeks (almost two centuries ;-)!!!). " " 5œ" : 5œ" Ð"BÑ 5" 5" 5:Ð" :Ñ œ follows from 5B œ (Recall Calculus!) APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 9
7.2 Three Examplesá 5" 5" " : " 5:Ð" :Ñ œ : 5Ð" :Ñ œ : œ œ Ò" Ð" :ÑÓ : : 5œ" 5œ" The exponential distribution: Recall the chemical reactor example in chapter 5. X Residence time in min. µib:ð!þ&ñ ÊEÒXÓœ% minutes. Definition: The expectation of an exponential distribution. -B \ µ IB:Ð-Ñ Ê IÒ\Ó œ B -/.B œ "! - Definition: The expectation of a normal distribution. " " B. \µrð.5 ß ÑÊIÒ\Óœ B / Ð 5 Ñ.Bœ. 5 1 APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 10
7.3 The change-of-variable formulaá Example: Suppose a construction company builds square buildings with width and depth \ß \ µ Y Ò!ß "!Ó. Suppose we have for the price T of a building À TœG \ß where Gis the price per square meter Ða constant)þ Annual revenue is proportional to, the average building size IÒ] Ó, where ] œ \. Thus, we first have to determine the distribution of ] œ \, \ Ò!ß "!Ó Ê ] œ \ Ò!ß "!!ÓÞ JÐCÑœTÐ] ŸCÑœTÐ\ ŸCÑ C œtð\ÿcñœ ß recall \µyò!ß"!óþ "!.. C " " " " 0ÐCÑ œ JÐCÑ œ œ œ.c.c "! "! C! C APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 11
7.3 The change-of-variable formulaá "!! "!! " " " IÒ\ ÓœIÒ]Óœ C.Cœ C.Cœ! C!!! " $ "!! " C œ $$ 7! $! $ Conclusion: Annual Revenue " $$ ( buildings per year) (price per 7 ÑÞ $ Observation: \ µ Y Ò!ß "!Óß IÒ\Ó œ & IÒ\ Ó Á IÒ\Ó IÒ\Ó œ &7 Þ B Alternative Method to evaluate IÒ\ Ó À Realize that buildings with area get build with the same frequency as buildings with width BÞ Thus, recalling \ µ Y Ð!ß "!Ñ one has: "! "! "" "! " B œ $$ 7!! "! $! $ " IÒ\ Ó œ B 0\ ÐBÑ.B œ B.B œ "! $ APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 12
7.3 The change-of-variable formulaá Definition: The change of variable formula. Let \ be a rv and 1 À Ä Þ \ discrete on + ß á ß + Ê IÒ1Ð\ÑÓ œ 1Ð+ ÑT Ð\ œ + Ñ œ 1Ð+ Ñ:Ð+ Ñ " 8 3 3 3 3 3 3 \ continuous, \ µ 0Ð Ñ Ê IÒ1Ð\ÑÓ œ 1ÐBÑ0ÐBÑ.B Quick exercise 7.3: Let Solution QE 7.3: \ \ µ F/<Ð:ÑÞ Compute IÒ ÓÞ TÐ\ œ!ñœ":ßtð\œ"ñœ:þ Thus: \! " IÒ Óœ TÐ\ œ!ñ TÐ\ œ!ñœ"::œ":þ APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 13
7.3 The change-of-variable formulaá Suppose 1ÐBÑ œ +B,ß +ß, and \ is a continuous RVÞ IÒ1Ð\ÑÓ œ IÒ+\,Ó œ œ œ + B0ÐBÑ.B, 0ÐBÑ.B 1ÐBÑ0 ÐBÑ.B œ+iò\ó, Ð+B,Ñ0ÐBÑ.B Same applies when \ is a discrete RV! Expected value of linear transformation of random variable \: An operation that occurs very often in practice is a change of units, e.g., changing from Fahrenheit to Celsius, from minutes to hours, etc. APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 14
7.4 Varianceá Suppose you are offered an opportunity for an investment at the cost of $&!! whose expected return is $500. Seems an OK opportunity. What if we have for payoff ]" À T Ð] " œ $ %&!Ñ œ &!%, T Ð] " œ $5 &!Ñ œ &!%? What if we have for payoff ] À TÐ] œ $!Ñ œ &!%, TÐ] œ $1000 Ñ œ &!%? Clearly, the spread (around the mean) makes you feel different. Usually this is measured by the expected squared deviation from the mean. Definition: The variance Z +<Ð\Ñ of a random variable \ is the number À Z +<Ð\Ñ œ IÒÐ\ IÒ\ÓÑ Ó œ IÒ\ Ó ÐIÒ\ÓÑ Note that: Z +<Ð\Ñ!Þ Also: Standard Deviation \ Z+<Ð\Ñ APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 15
7.4 Varianceá Quick exercise 7.4: Calculate the mean and variance for ]" and ] Payoff ]" À T Ð] " œ $ %&!Ñ œ &!%, T Ð] " œ $5 &!Ñ œ &!%? Payoff ] À TÐ] œ $!Ñ œ &!%, TÐ] œ $1000 Ñ œ &!%? Solution QE 7.4: %&! &&! IÒ] " Ó œ %&! T Ð] " œ $ %&!Ñ &&! T Ð] " œ $5 &!Ñ œ œ $ &!!! "!!! IÒ] Ó œ! T Ð] " œ $!Ñ "!!! T Ð] " œ $ "!!!Ñ œ œ $ &!! Z +<Ð] " Ñ œ Ð%&! &!!Ñ T Ð] " œ $ %&!Ñ Ð&&! &!!Ñ T Ð] " œ $5&!Ñ &!! &!! œ œ &!! Ê W>ÞH/@Ð\Ñ œ $ &!Þ Z +<Ð] Ñ œ Ð! &!!Ñ T Ð] " œ $!Ñ Ð"!!! &!!Ñ T Ð] " œ $ "!!!Ñ &!!!! &!!!! œ œ &!!!! Ê W>ÞH/@Ð\Ñ œ $ &!!Þ APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 16
7.4 Varianceá Z +<Ð\Ñ œ IÒÐ\ IÒ\ÓÑ Ó œ IÒ\ IÒ\Ó \ ÐIÒ\ÓÑ Ó œ IÒ\ Ó IÒIÒ\Ó \Ó IÒÐIÒ\ÓÑ Ó œiò\ Ó IÒ\Ó IÒ\Ó ÐIÒ\ÓÑ œ IÒ\ Ó ÐIÒ\ÓÑ An alternative expression for the variance: For any random variable \ À Z +<Ð\Ñ œ IÒ\ Ó ÐIÒ\ÓÑ Variance of a normal distribution: Definition: The expectation of a normal distribution. \µrð.5 ß ÑÊZ+<Ð\Ñœ5 APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 17
7.4 Varianceá Recall Example : \ Time a drill bit lastsþ T Ð\ œ Ñ œ!þ"ß T Ð\ œ $Ñ œ!þ(ß T Ð\ œ %Ñ!Þ"Þ IÒ\Óœ!Þ"!Þ( $!Þ %œ$þ"hours Method 1: Z +<Ð\Ñ œ IÒ\ ÐIÒ\ÓÑ Ó Z +<Ð\Ñ œ Ð $Þ"Ñ!Þ" Ð$ $Þ"Ñ!Þ( Ð% $Þ"Ñ!Þ œ Ð "Þ"Ñ!Þ" Ð!Þ"Ñ!Þ( Ð!Þ*Ñ!Þ œ "Þ"!Þ"!Þ!"!Þ(!Þ)"!Þ œ œ!þ""!þ!!(!þ"' œ! Þ* Method 2: Z +<Ð\Ñ œ IÒ\ Ó ÐIÒ\ÓÑ Z +<Ð\Ñ œ ÐÑ!Þ" Ð$Ñ!Þ( Ð%Ñ!Þ Ð$Þ"Ñ œ%!þ"*!þ("'!þ*þ'" œ!þ% 'Þ$ $Þ *Þ'" œ!þ* APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 18
7.4 Varianceá Expectation and Variance under a change of units: random variable \ and any real numbers + and, À For any random IÒ+\,Ó œ +IÒ\Ó, Z +<Ð+\,Ñ œ + Z +<Ð\Ñ Without calculation, why is Z+<Ð\Ñ not affected above by,? Z+<Ð+\,ÑœIÒÐÐ+\,ÑIÒ+\,ÓÑ œiò Ð+\, Ð+IÒ\Ó, ÑÑ œiò Ð+\,+IÒ\Ó, Ñ œ +IÒ\IÒ\Ó Ð Ñ Óœ+Z+<Ð\Ñ Ó Ó Ó œ IÒ Ð+\ +IÒ\ÓÑ Ó œ IÒ+ Ð\ IÒ\ÓÑ Ó APSC 3115/6115 notes by: J.R. van Dorp www.seas.gwu.edu/~dorpjr: dorpjr@gwu.edu - Page 19