Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Random Variables and Probability Distributions Schaum’s Outlines of Probability and Statistics Chapter 2 Presented by Carol Dahl Examples by Tyler Hodge 2-2 Outline of Topics Topics Covered: Random Variables Discrete Probability Distributions Continuous Probability Distributions Discrete Joint Distributions Continuous Joint Distributions Joint Distributions Example Independent Random Variables Changing of Variables Convolutions 2-3 Random Variables Variables events or values given probabilities Examples Drill for oil - may hit oil or a dry well Quantity oil found 2-4 Random Variables Notation: P (X=xk)= P(xk) probability random variable, X, takes value xk = P(xk). Example Drilling oil well in Saudi Arabia outcome is either (Dry, Wet) 5% chance of being dry P (X = Dry well) = 0.05 or 5% P (X = Wet well) = 0.95 or 95% 2-5 Discrete Probability Distributions Discrete probability distribution takes on discrete, not continuous values. Examples: Mineral exploration discrete - finds deposit or not Amount of deposit found continuous - any amount may be found 2-6 Discrete Probability Distributions If random variable X defined by: P(X=xk)= P(xk) , k=1, 2, …. Then, 0<P (xk)<1 ∑k P(x) = 1 2-7 Discrete Probability Distributions Example: Saudi oil well drilling Drilled well Dry Wet f (well) 0.05 0.95 So, ∑ f (well) = 0.05 +0.95 = 1.0 2-8 Discrete Probability Distributions Random variable X cumulative distribution function probability X x F ( x ) P( X x ) P(ui ) ui x 2-9 Discrete Probability Distributions Example: Find cumulative distribution function wind speed at a location (miles per hour) Wind Speed P(x) F(x) 4 4/36 4/36 5 6 7 8 5/36 6/36 6/36 6/36 9/36 15/36 21/36 27/36 9 10 5/36 4/36 32/36 36/36 2-10 Continuous Probability Distributions Definition: Continuous probability distribution takes any value over a defined range Similar to discrete BUT replace summation signs with integrals Examples: • amount of oil from a well • student heights & weights 2-11 Continuous Probability Distributions Continuous probability distribution describe probabilities in ranges f (x) 0 f ( x)dx 1 x Equation for probability X lies between a and b: b P(a X b) f ( x)dx a 2-12 Continuous Probability Distributions Example: Engineer wants to know probability gas well pressure in economical range between 300 and 350 psi 350 P(300 X 350) f (x)dx 300 2-13 Continuous Probability Distributions Example cont: let f(x) = x/180,000 for 0<X<600 = 0 everywhere else verify that f(x) is bonafied probability distribution if not fix it 2-14 Continuous Probability Distributions Example cont: let f(x) = x/180,000 for 0<X<600 = 0 everywhere else 350 P(300 X 350) (x / 180,000)dx 300 x 2 350 3502 3002 |300 0.09 9% 360,000 360,000 360,000 2-15 Discrete Joint Distributions X and Y - two discrete random variables joint probability distribution of X and Y P(X=x,Y=y) = f(x,y) Where following should be satisfied: f(x,y) 0 and f ( x, y) 1 x y 2-16 Discrete Joint Distributions joint distribution of two discrete random table cells make up joint probabilities column and row summations marginal distributions. X\Y x1 x2 ... xm P(Y) y1 y2 f(x1,y1) f(x1,y2) f(x2,y1) f(x2,y1) ... ... f(xm,y1) f(xm,y2) f2(y1) f2(y2) ... ... ... ... ... yn f(x1,yn) f(x1,yn) ... f(xm,yn) f2(yn) P(X) f1(x1) f1(x2) ... f1(xm) 1 (grand total) 2-17 Continuous Joint Distributions X and Y two continuous random variables joint probability distribution of X and Y f(x,y) with f(x,y) 0 and b P(a X b, c Y d) d f (x, y) dy dx x a y c 2-18 Discrete Joint Distribution (Example) Example: Yield from two forests has distribution f(x,y) = c(2x+y) where x and y are integers such that: 0X2 and 0Y3 and f(x,y)=0 otherwise 2-19 Joint Distributions (Example) cont. For previous slide, find value of “c” P (X=2, Y=1) Find P(X 1, Y 2) Find marginal probability functions of X & Y 2-20 Joint Distributions (Example) cont. P (X=0, Y=0) = c(2X+Y) = c(2*0+0) = 0 P (X=1, Y=0) = c(2X+Y) = c(2*1+0) = 2c Fill in all possible probabilities in table 2-21 Joint Distributions (Example) cont. X\Y 0 1 2 3 totals 0 0 c 2c 3c 6c 1 2c 3c 4c 5c 14c 2 4c 5c 6c 7c 22c totals 6c 9c 12c 15c 42c Since, f ( x, y ) 1 x y 42c=1 which implies that c=1/42. 2-22 Joint Distributions (Example) cont. find P( X=2 ,Y=1) from table: X\Y 0 1 2 totals 0 0 2/42 4/42 6/42 P(X=2,Y=1)=5/42 1 1/42 3/42 5/42 9/42 2 2/42 4/42 6/42 12/42 3 3/42 5/42 7/42 15/42 totals 6/42 14/42 22/42 42/42 2-23 Joint Distributions (Example) cont. Evaluate P(X1,1<Y2) sum cells of shaded region below: X\Y 0 1 2 totals 0 0 2/42 4/42 6/42 1 1/42 3/42 5/42 9/42 2 2/42 4/42 6/42 12/42 P(X1,1<Y2) = (3 + 4 + 5 + 6)/42 = 18/42=0.429 3 3/42 5/42 7/42 15/42 totals 6/42 14/42 22/42 42/42 2-24 Joint Distributions (Example) cont. Functions: Marginal X = P(X=xi) = j(X=xi, Y=yj) Marginal Y = P(Y=yj) = i(X=xi, Y=yj) 2-25 Joint Distributions (Example) cont. Marginal probability functions read off totals across bottom and side of table: X\Y 0 1 2 3 P(X) 0 0 1/42 2/42 3/42 6/42 1 2/42 3/42 4/42 5/42 14/42 2 4/42 5/42 6/42 7/42 22/42 P(Y) 6/42 9/42 12/42 15/42 42/42 2-26 Joint Distributions Continuous Case X, Y ~ f(X,Y) fx(X) = f(X,Y)dx fy(Y) = f(X,Y)dy Example: ore grade for copper and zinc f(x,y) = ce-x-y 0<x<0.4 0<Y<0.3 = 0 elsewhere 2-27 Exp-x-y 1 0.8 0.6 0.2 0 0.1 0.1 0.2 0.3 0.4 0 2-28 Joint Distributions Continuous Case Example: ore grade for copper and zinc f(x,y) = ce-x-y 0<X<0.4 0<Y<0.3 what is c ∫ ∫ cf(x,y)dxdy = 1 fx(x) = 0 0.3 = 0 0.4 ce-x-y dy (-ce-x-0.3 + =- 0.3 -x-y ce | 0 = - ce-x-0.3 + ce-x-0. ce-x-0 )= ce-x-0.3 - ce--x 0.4 |0 = ce-0.4 -0.3 - ce –0.4 - [ce-0.3 - ce -0] = 1 = c[e-0.7 - e –0.4 - e-0.3 + 1] = 1 c = 1/[e-0.7 - e –0.4 - e-0.3 + 1]= 1/3.084 = 0.324 2-29 Independent Random Variables Random variables X and Y are independent if occurrence of one ->no affect other’s probability 3 tests 1. iff P(X=x|Y=y) = P(X=x) for all X and Y P(X|Y) = P(X) for all values X and Y otherwise dependent 2-30 Independent Random Variables Random variables X and Y are independent if occurrence of one ->no affect other’s probability 2. iff P(X=x,Y=y) = P(X=x)*P(Y=y) P(X,Y) = P(X)*P(Y) otherwise X and Y dependent 2-31 Independent Random Variables Random variables X and Y are independent if occurrence of one ->no affect other’s probability 3. iff P(Xx,Yy) = P(Xx)*P(Yy) F(X,Y) = F(X)*F(Y) otherwise X and Y dependent 2-32 Independent Random Variables (Reclamation Example) State of Pennsylvania problems with abandoned coal mines Government officials-reclamation bonding requirements new coal mines size of mine influence probability reclamation 2-33 Independent Random Variables (Reclamation Example cont.) Office of Mineral Resources Management compiled joint probability distribution Abandons Size of Mine Mine (000 st) 0- 100 1/18 100 – 500 2/18 500 – 1,000 2/18 > 1,000 1/18 P(Y) 6/18 Reclaims Mine 2/18 4/18 4/18 2/18 12/18 P(X) 3/18 6/18 6/18 3/18 2-34 Independent Random Variables – Check 1 Mine Size and Reclamation Independent? 1. Does P(X|Y) = P(X) for all values X and Y? Does P(Mine 0-100|Reclaim) = P(Mine 0-100 and reclaim)/P(Reclaim) (2/18)/(12/18) = 2/12 = 1/6 P(mine 0 - 100 ) = 3/18 = 1/6 Holds for these values Check if holds for all values X and Y If not hold for any values dependent 2-35 Independent Random Variables – Check 2 2. Does P(X,Y) = P(X)*P(Y) for all values X and Y? P(Mine 0-100 and reclaim) = 2/18 = 1/9 P(mine 0-100)* P(reclaim) = 3/18*12/18 = 36/324 = 1/9 Holds for these values Checking it holds for all values X and Y If not hold for any values – dependent 2-36 Independent Random Variables – Check 3 3. Does F(X,Y) = F(X)*F(Y) for all values X and Y? P(Mine<500 and reclaim) = 2/18 + 4/18 = 1/3 P(Mine < 500)* P(reclaim) =6/18+3/18 = 9/18*12/18 =108/324 = 1/3 Holds for these values Checking if holds for all values X and Y If not hold for any values – dependent 2-37 Are Copper and Zinc Ore Grades Independent: Continuous Case f(x,y) = 0.324e-x-y Discrete: P(X|Y) = P(X) Continuous f(x|y) = f(x) f(x|y) = f(x,y)/f(y) = 0.324e-x-y/(-0.324e-0.3-y+0.324e-y) ?= (-0.324e-0.4-x+0.324e-x) Discrete: P(X,Y) = P(X)*P(Y) Continuous: f(x,y) = f(x)*f(y) 0.324e-x-y?= (-0.324e-0.4-x+0.324e-x)*(-0.324e-0.3-y+0.324e-y) Discrete: P(Xx,Yy) = P(Xx)*P(Yy) x y x 0 y 0 y x f ( x, y )dxdy x 0 f ( x )dx y 0 f ( y )dy 2-38 Convolutions - Example density function of their sum U=X+Y : X, Y ~ e-X-Y Y = U-X g (U ) f ( X ,U X )dX U 0.324 Xe U |0.4 0.1296 e 0 0.4 0 0.324e X U X dX 2-39 Integrate Exponential Functions Integrate Exponential functions xe x2 dw Let u = x2 du/dx = 2x du xe 2 x dx = du/2x u 1 u 1 u e du e c 2 2 1 x2 xe dx 2 e c x2 From oil well example : x7 1 72 e c 2 1.95 2-40 Changing of Variables Example discrete probability distribution size Pennsylvania coal mine 2 x x 1,2,3, . . . P( X ) otherwise 0 P(X = 1) = 2-1 = 1/2 P(X = 2) = 2-2 = 1/4 P(X = 3) = 2-3 = 1/8, etc. 2-41 Changing of Variables MRM wants probability distribution of reclamation bond amounts where reclamation = U U = g(X) = X4 + 1 What is pdf of U P(X = 1) = 2-1 = 1/2 =>P(U =X4 + 1= 14 + 1=2)= 1/2 P(X = 2) = 2-2 = 1/4 =>P(U =X4 + 1= 24 + 1=17)= 1/4 P(X = 3) = 2-3 = => P(U =X4 + 1= )= P(X = x) = 2-x => P(U =X4 + 1) 2-42 Changing of Variables Discrete Example P(X = x) = 2-x = 1/2x => P(U =X4 + 1) = 1/2x Want in terms of U U = X4 + 1 Solve for X = (U – 1)(1/4) P(U = x) = 2-x = 2 (U – 1)^(1/4) for U = (14+1, 24+1, 34+1, . . 2-43 Changing Variables General Case Discrete X ~ Px(X) for X = a,b,c, . . U = g(X) => X = g-1(U) U ~ Pu(U) = Px(g-1(U)) for g(a), g(b), g(c), . . . Continuous X ~ fx(X) where fx(X) = f(X) for a < X < b fx(X) = 0 elsewhere U = g(X) => X = g-1(U) U ~ fu(U) = fx(g-1(U)) for g(a) < U < g(b) 2-44 Normal Practice Variable Change Problem X ~ N(, ) – < X < f(X) = 1 exp(-(X- )2/(2 2)) dX (2)0.5 Show that (X – ) / ~ N (0,1) – < Z < 2-45 Convolutions Extending Variable Change to Joint Distributions X, Y ~ f(X,Y) Want density function of sum U=X+Y 2-46 Convolutions special case X and Y are independent, f (x,y) = f1(x) f2(y) and previous equation is reduced to following: g (u ) f 1( x) f 2(u x)dx 2-47 Convolutions - Example Example: X (Oil Production) and Y (Gas Production) independent random variables 2 e f 1(oil ) 0 2 x x0 x0 3e 3 y f 2( gas ) 0 f(x,y) = e-2x*3e-3y Find density function of their sum U=X+Y? g(u) = 0 2e-2x*3e-3(u-x)dx = complete this example y0 y0 2-48 Sum Up Random Variables and Probability Distributions (PS 2) Discrete Probability Distributions values with probabilities attached Cumulative Discrete Probability Functions F ( x ) P( X x ) P(ui ) ui x Continuous Probability Distributions b P ( a X b) a f ( x)dx 2-49 Chapter 2 Sum up Discrete Joint Distributions P(X=x,Y=y) = f(x,y) Independent Random Variables P(X|Y) = P(X) for all values X and Y P(X,Y) = P(X)*P(Y) F(X,Y) = Fx(X)*Fy(Y) f(x,y) = f1(x)*f2(y) 2-50 Changing Variables Discrete X ~ Px(X) for X = a,b,c, . . U = g(X) => X = g-1(U) U ~ Pu(U) = Px(g-1(U)) for g(a), g(b), g(c), . . . Continuous X ~ fx(X) where fx(X) = f(X) for a < X < b fx(X) = 0 elsewhere U = g(X) => X = g-1(U) U ~ fu(U) = fx(g-1(U)) for g(a) < U < g(b) 2-51 Convolutions: Extending Variable Change to Joint Distributions X, Y ~ f(X,Y) Want density function of sum U=X+Y g (u ) f ( x, u x)dx 2-52 Convolutions Special case X and Y are independent, f (X,Y) = f1(X) f2(Y) and previous equation is reduced to following: g (u ) f 1( x) f 2(u x)dx