UCLA STAT A Applied Probability & Statistics for Egieers Istructor: Ivo Diov, Asst. Prof. I Statistics ad Neurology Teachig Assistat: Neda Farziia, UCLA Statistics Uiversity of Califoria, Los Ageles, Sprig 4 http://www.stat.ucla.edu/~diov/ Chapter 3 Discrete Radom Variables ad Probability Distributios Slide Slide 3. Radom Variables Radom Variable For a give sample space S of some experimet, a radom variable is ay rule that associates a umber with each outcome i S. Slide 3 Slide 4 Beroulli Radom Variable Ay radom variable whose oly possible values are ad is called a Beroulli radom variable. Types of Radom Variables A discrete radom variable is a rv whose possible values either costitute a fiite set or else ca listed i a ifiite sequece. A radom variable is cotiuous if its set of possible values cosists of a etire iterval o a umber lie. Slide 5 Slide 6
3. Probability Distributios for Discrete Radom Variables Probability Distributio The probability distributio or probability mass fuctio (pmf) of a discrete rv is defied for every umber x by p(x) = P(all s S : X( s) = x). Slide 7 Slide 8 Parameter of a Probability Distributio Suppose that p(x) depeds o a quatity that ca be assiged ay oe of a umber of possible values, each with differet value determiig a differet probability distributio. Such a quatity is called a parameter of the distributio. The collectio of all distributios for all differet parameters is called a family of distributios. Slide 9 Cumulative Distributio Fuctio The cumulative distributio fuctio (cdf) F(x) of a discrete rv variable X with pmf p(x) is defied for every umber by F( x) = P( X x) = p( y) Slide yy : x For ay umber x, F(x) is the probability that the observed value of X will be at most x. Propositio For ay two umbers a ad b with a b, P( a X b) = F( b) F( a ) a represets the largest possible X value that is strictly less tha a. Note: For itegers Pa ( X b) = Fb ( ) Fa ( ) Probability Distributio for the Radom Variable X A probability distributio for a radom variable X: x P(X = x) 8.3 3.5.7. Fid a. P( X ).65 b. P 3 X.67 ( ).5 4. 6.9 Slide Slide
3.3 Expected Values of Discrete Radom Variables The Expected Value of X Let X be a discrete rv with set of possible values D ad pmf p(x). The expected value or mea value of X, deoted E( X ) or µ X, is E( X) = µ = x p( x) X x D Slide 3 Slide 4 Example I the at least oe of each or at most 3 childre example, where X ={umber of Girls} we have: X 3 pr(x ) 8 5 8 Slide 5 8 E( X ) = x P( x) x 5 = + + + 3 8 8 8 8 =.5 8 Ex. Use the data below to fid out the expected umber of the umber of credit cards that a studet will possess. x = # credit cards x 3 4 5 6 P(x =X).8.8.38.6.6.3. E ( X) = xp+ xp +... + xp = (.8) + (.8) + (.38) + 3(.6) + 4(.6) + 5(.3) + 6(.) =.97 About credit cards Slide 6 The Expected Value of a Fuctio If the rv X has the set of possible values D ad pmf p(x), the the expected value of ay fuctio h(x), deoted EhX [ ( )] or µ hx ( ), is E[ hx ( )] = hx ( ) px ( ) D Rules of the Expected Value E( ax + b) = a E( X ) + b This leads to the followig:. For ay costat a, E( ax ) = a E( X ).. For ay costat b, E( X + b) = E( X) + b. Slide 7 Slide 8 3
The Variace ad Stadard Deviatio Let X have pmf p(x), ad expected value µ The the variace of X, deoted V(X) (or σ or σ ), is X V( X) = ( x µ ) p( x) = E[( X µ ) ] D The stadard deviatio (SD) of X is σ X = σ X Ex. The quiz scores for a particular studet are give below:, 5,, 8,,, 4,,, 5, 4, 5, 8 Fid the variace ad stadard deviatio. Value Frequecy Probability µ =.8 8.5 4.3.8 4.5 5 3.3 ( µ ) ( µ ) ( µ ) V( X) = p x + p x +... + p x σ = V( X) Slide 9 Slide V( X ) =.8 +.5 8 +.3 ( ) ( ) ( ) ( ) ( ) ( ) +.8 +.5 4 +.3 5 V( X ) = 3.5 σ = V( X) = 3.5 3.64 Shortcut Formula for Variace V( X) = σ = x p( x) µ D ( ) E( X) = E X Slide Slide Rules of Variace + σ V( ax + b) = σax b = a X ad σ + = a σ ax b X This leads to the followig:. σax = a σx, σax = a σx. σx+ b = σx Liear Scalig (affie trasformatios) ax + b For ay costats a ad b, the expectatio of the RV ax + b is equal to the sum of the product of a ad the expectatio of the RV X ad the costat b. E(aX + b) = a E(X) +b Ad similarly for the stadard deviatio (b, a additive factor, does ot affect the SD). SD(aX +b) = a SD(X) Slide 3 Slide 4 4
Liear Scalig (affie trasformatios) ax + b Liear Scalig (affie trasformatios) ax + b Why is that so? E(aX + b) = a E(X) +b SD(aX +b) = a SD(X) E(aX + b) = (a x + b) P(X = x) = x = a x P(X = x) + b P(X = x) = x = x = a x P(X = x) + b P(X = x) = x = x = ae(x) + b = ae(x) + b. Slide 5 Example: E(aX + b) = a E(X) +b SD(aX +b) = a SD(X). X={-,,, 3, 4,, -, }; P(X=x)=/8, for each x. Y = X-5 = {-7, -, -5,, 3, -5, -9, -3} 3. E(X)= 4. E(Y)= 5. Does E(X) = E(X) 5? 6. Compute SD(X), SD(Y). Does SD(Y) = SD(X)? Slide 6 Liear Scalig (affie trasformatios) ax + b Ad why do we care? E(aX + b) = a E(X) +b SD(aX +b) = a SD(X) -completely geeral strategy for computig the distributios of RV s which are obtaied from other RV s with kow distributio. E.g., X~N(,), ad Y=aX+b, the we eed ot calculate the mea ad the SD of Y. We kow from the above formulas that E(Y) = b ad SD(Y) = a. -These formulas hold for all distributios, ot oly for Biomial ad Normal. Slide 7 Liear Scalig (affie trasformatios) ax + b Ad why do we care? E(aX + b) = a E(X) +b SD(aX +b) = a SD(X) -E.g., say the rules for the game of chace we saw before chage ad the ew pay-off is as follows: {$, $.5, $3}, with probabilities of {.6,.3,.}, as before. What is the ewly expected retur of the game? Remember the old expectatio was equal to the etrace fee of $.5, ad the game was fair! Y = 3(X-)/ {$, $, $3} {$, $.5, $3}, E(Y) = 3/ E(X) 3/ = 3 / 4 = $.75 Ad the game became clearly biased. Note how easy it is to compute E(Y). Slide 8 Meas ad Variaces for (i)depedet Variables! Meas: Idepedet/Depedet Variables {X, X, X3,, X} E(X + X + X3 + + X) = E(X)+ E(X)+ E(X3)+ + E(X) Variaces: Idepedet Variables {X, X, X3,, X}, variaces add-up Var(X +X + X3 + + X) = Var(X)+Var(X)+Var(X3)+ +Var(X) Depedet Variables {X, X} Variace cotiget o the variable depedeces, E.g., If X = X + 5, Var(X +X) =Var (X + X +5) = Var(3X +5) =Var(3X) = 9Var(X) Slide 9 3.4 The Biomial Probability Distributio Slide 3 5
Biomial Experimet A experimet for which the followig four coditios are satisfied is called a biomial experimet.. The experimet cosists of a sequece of trials, where is fixed i advace of the experimet.. The trials are idetical, ad each trial ca result i oe of the same two possible outcomes, which are deoted by success (S) or failure (F). 3. The trials are idepedet. 4. The probability of success is costat from trial to trial: deoted by p. Slide 3 Slide 3 Biomial Experimet Suppose each trial of a experimet ca result i S or F, but the samplig is without replacemet from a populatio of size N. If the sample size is at most 5% of the populatio size, the experimet ca be aalyzed as though it were exactly a biomial experimet. Biomial Radom Variable Give a biomial experimet cosistig of trials, the biomial radom variable X associated with this experimet is defied as X = the umber of S s amog trials Slide 33 Slide 34 Notatio for the pmf of a Biomial rv Because the pmf of a biomial rv X depeds o the two parameters ad p, we deote the pmf by b(x;,p). Computatio of a Biomial pmf x x p ( p ) x =,,,... b( x;, p) = p otherwise Slide 35 Slide 36 6
Ex. A card is draw from a stadard 5-card deck. If drawig a club is cosidered a success, fid the probability of a. exactly oe success i 4 draws (with replacemet). p = ¼; q = ¼ = ¾ 3 4 3 4 4.4 b. o successes i 5 draws (with replacemet). 5 5 3 4 4.37 Notatio for cdf For X ~ Bi(, p), the cdf will be deoted by P( X x) = B( x;, p) = b( y;, p) x y= x =,,, Slide 37 Slide 38 Mea ad Variace For X ~ Bi(, p), the E(X) = p, 8 V(X) = p( p) = pq, 6 σ X = pq (where q = p). Ex. 5 cards are draw, with replacemet, from a stadard 5-card deck. If drawig a club is cosidered a success, fid the mea, variace, ad stadard deviatio of X (where X is the umber of successes). p = ¼; q = ¼ = ¾ µ = p = 5 =.5 4 3 V ( X) = pq = 5 =.9375 4 4 σ = pq =.9375.968 X Slide 39 Slide 4 Ex. If the probability of a studet successfully passig this course (C or better) is.8, fid the probability that give 8 studets a. all 8 pass. 8.8 8.8 b. oe pass. 8 c. at least 6 pass..8.8 8 ( ) ( ) 8 ( ) ( ) 8 8 8 6 7 8 (.8) (.8) + (.8) (.8) + (.8) (.8) 6 7 8.758 +.359 +.44 =.839.44. 3.5 Hypergeometric ad Negative Biomial Distributios Slide 4 Slide 4 7
The Hypergeometric Distributio The three assumptios that lead to a hypergeometric distributio:. The populatio or set to be sampled cosists of N idividuals, objects, or elemets (a fiite populatio).. Each idividual ca be characterized as a success (S) or failure (F), ad there are M successes i the populatio. 3. A sample of idividuals is selected without replacemet i such a way that each subset of size is equally likely to be chose. Slide 43 Slide 44 Hypergeometric Distributio If X is the umber of S s i a completely radom sample of size draw from a populatio cosistig of M S s ad (N M) F s, the the probability distributio of X, called the hypergeometric distributio, is give by M N M x x PX ( = x) = hxmn ( ;,, ) = N max(, N + M) x mi(, M) Slide 45 Hypergeometric Mea ad Variace M N M M EX ( ) = VX ( ) = N N N N Slide 46 The Negative Biomial Distributio The egative biomial rv ad distributio are based o a experimet satisfyig the followig four coditios:. The experimet cosists of a sequece of idepedet trials.. Each trial ca result i a success (S) or a failure (F). 3. The probability of success is costat from trial to trial, so P(S o trial i) = p for i =,, 3, 4. The experimet cotiues util a total of r successes have bee observed, where r is a specified positive iteger. Slide 47 Slide 48 8
pmf of a Negative Biomial The pmf of the egative biomial rv X with parameters r = umber of S s ad p = P(S) is x+ r+ r x b( x; r, p) = p ( p) r x =,,, Negative Biomial Mea ad Variace ( ) ( ) ( ) r p ( ) r E X = V X = p p p Slide 49 Slide 5 Hypergeometric Distributio & Biomial Biomial approximatio to Hyperheometric M is small (usually <.), the p N N approaches HyperGeom( x; N,, M ) Bi( x;, p) M / N = p Ex: 4, out of, residets are agaist a ew tax. 5 residets are selected at radom. P(at most 7 favor the ew tax) =? Geometric, Hypergeometric, Negative Biomial Negative biomial pmf [X ~ NegBi(r, p), if r= Geometric (p)] x P( X = x) = ( p) p Number of trials (x) util the r th success (egative, sice umber of successes (r) is fixed & umber of trials (X) is radom) x + r r x P( X = x) = p ( p) r r( p) r( p) E( X ) = ; Var( X ) = p p Slide 5 Slide 5 3.6 The Poisso Probability Distributio Poisso Distributio A radom variable X is said to have a Poisso distributio with parameter ( >, ) if the pmf of X is x e px ( ; ) = x=,,... x! Slide 53 Slide 54 9
The Poisso Distributio as a Limit Suppose that i the biomial pmf b(x;, p), we let ad p i such a way that p approaches a value >. The bxp ( ;, ) px ( ; ). Poisso Distributio Mea ad Variace If X has a Poisso distributio with parameter, the E( X) = V( X) = Slide 55 Slide 56 Poisso Process 3 Assumptios:. There exists a parameter α > such that for ay short time iterval of legth t, the probability that exactly oe evet is received is α t+ o( t).. The probability of more tha oe evet durig t is o( t). 3. The umber of evets durig the time iterval t is idepedet of the umber that occurred prior to this time iterval. Slide 57 Slide 58 Poisso Distributio αt k Pk () t = e ( αt) / k!, so that the umber of pulses (evets) durig a time iterval of legth t is a Poisso rv with parameter = αt. The expected umber of pulses (evets) durig ay such time iterval is αt, so the expected umber durig a uit time iterval is α. Poisso Distributio Defiitio Used to model couts umber of arrivals (k) o a give iterval The Poisso distributio is also sometimes referred to as the distributio of rare evets. Examples of Poisso distributed variables are umber of accidets per perso, umber of sweepstakes wo per perso, or the umber of catastrophic defects foud i a productio process. Slide 59 Slide 6
Fuctioal Brai Imagig Positro Emissio Tomography (PET) Fuctioal Brai Imagig - Positro Emissio Tomography (PET) Slide 6 Slide 6 http://www.ucmed.buffalo.edu Fuctioal Brai Imagig Positro Emissio Tomography (PET) Fuctioal Brai Imagig Positro Emissio Tomography (PET) Isotope Eergy (MeV) Rage(mm) /-life Appl. C.96. mi receptors 5O.7.5 mi stroke/activatio 8 F.6. mi eurology 4I ~..6 4.5 days ocology Slide 63 Slide 64 Hypergeometric Distributio & Biomial Biomial approximatio to Hyperheometric M is small (usually <.), the p N N approaches HyperGeom( x; N,, M ) Bi( x;, p) M / N = p Ex: 4, out of, residets are agaist a ew tax. 5 residets are selected at radom. P(at most 7 favor the ew tax) =? Poisso Distributio Mea Used to model couts umber of arrivals (k) o a give iterval k e Y~Poisso( ), the P(Y=k) =, k =,,, k! Mea of Y, µ Y =, sice k k k e k E( Y ) = k = e = e = k! k! ( k )! = e k = k= k = e ( k )! k = k= k = e k! k = e = Slide 65 Slide 66
Poisso Distributio - Variace k Y~Poisso( ), the P(Y=k) = e Variace of Y, σ Y = ½ k!, sice σ = = Y Var( Y ) k= ( k ) k e k!, k =,,, For example, suppose that Y deotes the umber of blocked shots (arrivals) i a radomly sampled game for the UCLA Bruis me's basketball team. The a Poisso distributio with mea=4 may be used to model Y. =... = Poisso Distributio - Example For example, suppose that Y deotes the umber of blocked shots i a radomly sampled game for the UCLA Bruis me's basketball team. Poisso distributio with mea=4 may be used to model Y. 3 4 5 6 7 8 9 3 4 5 Slide 67 Slide 68 Poisso as a approximatio to Biomial Suppose we have a sequece of Biomial(, p ) models, with lim( p ), as ifiity. For each <=y<=, if Y ~ Biomial(, p ), the y y P(Y =y)= p p y ( ) But this coverges to: y y y e p ( p ) y WHY? p y! Thus, Biomial(, p ) Poisso() Poisso as a approximatio to Biomial Rule of thumb is that approximatio is good if: >= p<=. = p <= The, Biomial(, p ) Poisso() Slide 69 Slide 7 Example usig Poisso approx to Biomial Suppose P(defective chip) =.= -4. Fid the probability that a lot of 5, chips has > defective! Y~ Biomial(5,,.), fid P(Y>). Note that Z~Poisso( = p =5, x.=.5) P( Z > ) = P( Z ) =.5 e!.5.5 + e!.5 Slide 7 z =.5 + e! z.5 e z!.5 =.456.5 =