Announcements: Quz starts after class today, ends Monday Last chance to take probablty survey ends Sunday mornng. Next few lectures: Today, Sectons 8.1 to 8. Monday, Secton 7.7 and extra materal Wed, Secton 8.4 and extra materal Homework (Due Mon, Feb 11): Chapter 8: #14abc, 18, 6 Chapter 8 Random Varables 8.1 What s a Random Varable? Random Varable: assgns a number to each outcome of a random crcumstance, or, equvalently, to each unt n a populaton. Two dfferent broad classes of random varables: 1. A contnuous random varable can take any value n an nterval or collecton of ntervals.. A dscrete random varable can take one of a countable lst of dstnct values. Notaton for ether type: X, Y, Z, W, etc. Examples of Dscrete Random Varables Assgns a number to each outcome n the sample space for a random crcumstance, or to each unt n a populaton. 1. Couple plans to have chldren. The random crcumstance ncludes the brths, specfcally the sexes of the chldren. Possble outcomes (sample space): {BBB, BBG, etc.} X = number of grls X s dscrete and can be 0, 1,, For example, the number assgned to BBB s X=0. Populaton conssts of UCI students (unt = student) Y = number of sblngs a student has Y s dscrete and can be 0, 1,,?? 4 Examples of Contnuous Random Varables Assgns a number to each outcome of a random crcumstance, or to each unt n a populaton. 1. Populaton conssts of UC female students Unt = female student W = heght W s contnuous can be anythng n an nterval, even f we report t to nearest nch or half nch. You are watng at a bus stop for the next bus Random crcumstance = when the bus arrves Y = tme you have to wat Y s contnuous anythng n an nterval Today: Dscrete Random Varables X = the random varable (r.v.), such as number of grls. k = a number the dscrete r. v. could equal (0, 1, etc). P(X = k) s the probablty that X equals k. Example (shown on board): Two Clcker questons wth 4 choces each X = ponts earned f you are just guessng. What are the possble values for k? Probablty dstrbuton functon (pdf) for a dscrete r.v. X s a table or rule that assgns probabltes to possble values of X. 1
Dscrete random varables, contnued NOTE: Sometmes the probabltes are gven or observed, and sometmes you have to compute them usng rules from Ch. 7. Probablty dstrbuton functon (pdf) for clcker ponts, shown on board, computed usng rules from Chapter 7. Cumulatve dstrbuton functon (cdf) s a rule or table that provdes P(X k) for every real number k. (More useful for contnuous random varables than for dscrete, as we wll see.) Condtons for Probabltes for Dscrete Random Varables Condton 1 The sum of the probabltes over all possble values of a dscrete random varable must equal 1. Condton The probablty of any specfc outcome for a dscrete random varable, P(X = k), must be between 0 and 1. Note: The possble values of k are mutually exclusve Ex: For clcker questons, you can t earn both ponts and 4 ponts. Another example of computng the PDF and CDF from Chapter 7 Rules Example: You buy tckets for the Daly lottery (dfferent days) Probablty that you wn each tme s 1/1000 =.001 Results on the two days are ndependent. X = number of wnnng tckets you have X could be 0, 1,. P(X = 0) = (.999) =.998001, (Rule b), 998,001 n a mllon P(X = ) = (.001) =.000001, (Rule b), 1 n a mllon P(X = 1) = 1 P(X = 0 or X = ) = 1 (.998001 +.000001) =.001998 (Rule 1), 1998 n a mllon PDF and CDF for Buyng Two Lottery Tckets k pdf P(X=k) cdf P(X k) 0.998001.998001 1.001998.999999.000001 1.0 For example, probablty of exactly one wnnng tcket s.001998, but probablty of less than or equal to one wnnng tcket s.999999. Example of usng observed proportons to create a pdf Survey of 17 students n ntroductory statstcs: k Number wth k sblngs pdf P(X=k) cdf P(X k) 0 14 14/17 =.08.08 1 68 68/17 =.9.9 +.08 =.47 5.1.47 +.1 =.78 1.1.90 4 8.05.95 5 6.0.98 6.0 1.00 Clcker data collecton (non credt) How many sblngs (brothers and ssters) do you have? Count half-sblngs (share one parent), but not step sblngs. A. 0 B. 1 C. D. E. 4 or more
Graph of pdf for number of sblngs (wth frequency nstead of relatve frequency) Compare class results. proporton k P(X=k) 0.08 1.9.1.1 4.05 5.0 6.0 More Complcated Examples for Dscrete R.V.s Probablty dstrbuton functon (pdf) X s a table or rule that assgns probabltes to possble values of X. Usng the sample space to fnd probabltes: Step 1: Lst all smple events n sample space. Step : Fnd probablty for each smple event. Step : Lst possble values for random varable X and dentfy the value for each smple event. Step 4: Fnd all smple events for whch X = k, for each possble value k. Step 5: P(X = k) s the sum of the probabltes for all smple events for whch X = k. Example: Sblng blood types Suppose: Father has OO (type O blood) Mother has OA (type A blood; A s domnant) They have chldren. Let X = number wth Blood type A. Each chld equally lkely to nhert: Father Mother Chld blood type O O Blood type O O A Blood type A So, each chld has Type O or Type A, each wth probablty ½, ndependent across chldren. Example: Sblng blood types Famly has chldren. Probablty of type A s ½ for each chld. What are the probabltes of 0, 1,, or wth type A? Sample Space: For each chld, wrte ether O or A. There are eght possble arrangements of O and A for three brths. These are the smple events. S = {OOO, OOA, OAO, AOO, OAA, AOA, AAO, AAA} Sample Space and Probabltes: The eght smple events are equally lkely. Each has probablty (1/)(1/)(1/) = 1/8 Random Varable X: number of Type A n three chldren. For each smple event, the value of X s the number of A s lsted. How Many Chldren wth Type A? Value of X for each smple event: Smple Event OOO OOA OAO AOO OAA AOA AAO AAA Probablty 1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8 X = # Type A 0 1 1 1 Probablty dstrbuton functon for X = # of Type A: Cumulatve Dstrbuton Functon for number of Type A: Cumulatve dstrbuton functon (cdf) provdes the probabltes P(X k) for any real number k. Cumulatve probablty = probablty that X s less than or equal to a partcular value. /8 Example: Cumulatve Dstrbuton Functon for the Number of Kds wth Type A Graph of the pdf of X: Probablty /8 1/8 0 For example, the probablty s 7/8 that kds have Type A. 0 1 Numbe r of Ty pe A
8. Expected Value (Mean) for Random Varables The expected value of a random varable s the mean value of the varable X n the sample space, or populaton, of possble outcomes. If X s a random varable wth possble values x 1, x, x,..., occurrng wth probabltes p 1, p, p,..., then the expected value of X s calculated as X x p Example of expected value Number of sblngs for ntro stat students: x p x p 0 14/17 =.08.00 1 68/17 =.9.9.1.6.1.6 4.05.0 5.0.15 6.0.1 Sum = 1.0 Sum = 1.84 X = 1.84 x p = mean number of sblngs Expected value = mean value s where the pcture of the pdf balances 1.84 Other examples of expected value Example 1: How much better off are you dong clcker questons nstead of quz each week? Just guessng for questons on clcker, quz X = clcker, Y = quz; Clcker: 1 pont for answerng, 1 pont for gettng t rght. Quz: ponts for gettng t rght (no ponts for answerng) E(X)=.5, E(Y)=1, (on board) EXAMPLE : Raffle tcket costs $.00. You wn $5.00 wth probablty 10/100, so net gan = $ $100 wth probablty 1/100, so net gan = $98 Nothng wth probablty 89/100, so net gan = $ X = net gan. What s E(X)? X x p =$ (10/100) + $98 (1/100) $.00 (89/100) = $(0 + 98 178)/100 = $50/100 A loss of 50 cents on average for each $.00 tcket. People runnng the raffle gan 50 cents per tcket. Should you buy extended warrantes? You buy a new applance, computer, etc. Extended warranty for a year costs $10. Unknown to you, the probablty you wll need a repar s 1/50, and t wll cost $00 f you do. Is the warranty a good deal? X = your cost to repar the tem. k P(X = k) k P(X=k) $00 1/50 $00/50 $0 49/50 0/50 E(X) = $00/50 = $4.00 If you buy the warranty your cost s fxed at $10. If you don t, your cost s ether $00 or $0, but the long run average s $4.00 4
Notes about expected value It s the average or mean value of the random varable over the long run. It may not be an actual possble value for the random varable (usually t sn t; e.g. 1.84 sbs). In gamblng, lotteres, nsurance, extended warranty, etc., you can be pretty sure that your expected cost per event f you play or buy s more than f you don t the house wns! However, for nsurance, for example, you mght prefer the peace of mnd of knowng your fxed cost. For lottery, you mght want the thrll of the possblty of wnnng, even though you lose on average. Standard Devaton for a Dscrete Random Varable The standard devaton of a random varable s essentally the average dstance the random varable falls from ts mean over the long run. If X s a random varable wth possble values x 1, x, x,..., occurrng wth probabltes p 1, p, p,..., and expected value E(X) =, then Varance of X V Standard Devaton of X x p X x p Example 8.1 Gan for an nvestment Should you choose rsky nvestments? Investng $100 whch plan would you choose? Varablty over the years of nvestng Very dfferent standard devatons for the two plans: Same Expected Value for each plan: Plan 1: E(X ) = $5,000 (.001) + $1,000 (.005) + $0 (.994) = $10.00 Plan : E(Y ) = $0 (.) + $10 (.) + $4 (.5) = $10.00 Plan 1: Varance of X = $9,900.00 and = $17.9 Plan : Varance of X = $48.00 and = $6.9 The possble outcomes for Plan 1 are much more varable. If you wanted to nvest cautously, you would choose Plan, If you wanted to have the chance to gan a large amount of money, you would choose Plan 1. Notes about standard devaton Smlar to when we used standard devaton for data n Chapter, t s most useful for normal random varables (next week). In general, useful for comparng two random varables to see whch s more spread out. Examples: Compare two ctes temperatures over the year: Cty #1: Mean = 65, st. dev. = Cty #: Mean = 65, st. dev. = 0 Compare two nvestment funds: Fund #1: Mean rate of return = 8%, st. dev. = % Fund #: Mean rate of return = 10%, st. dev. = 0% HOMEWORK (due Mon, Feb 11): 8.14abc 8.18 8.6 5