Random Variables Random variables Lecture 5 - Discrete Distributions Sta02 / BME02 Colin Rundel Setember 8, 204 A random variable is a numeric uantity whose value deends on the outcome of a random event We use a caital letter, lie X, to denote a random variables The values of a random variable will be denoted with a lower case letter, in this case For eamle, P(X ) There are two tyes of random variables: Discrete random variables tae on only integer values Eamle: Number of credit hours, Difference in number of credit hours this term vs last Continuous random variables tae on real (decimal) values Eamle: Cost of boos this term, Difference in cost of boos this term vs last Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 2 / 23 Random Variables Random Variables Discrete Probability distributions A discrete robability distribution lists all ossible events and the robabilities with which they occur. The robability distribution for the gender of one child: Event B G Probability 0.5 0.5 Eamle - Discrete robability model In a game of cards you win $ if you draw a heart, $5 if you draw an ace (including the ace of hearts), $0 if you draw the ing of sades and nothing for any other card you draw. Write the robability distribution for the random variable reresenting your winnings. Rules for robability distributions: The events listed must be disjoint 2 Each robability must be between 0 and 3 The robabilities must add u to Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 3 / 23 Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 4 / 23
Random Variables Random Variables Mean and standard deviation of a discrete RVs We are often interested in the value we eect to arise from a random variable. We call this the eected value, it is a weighted average of the ossible outcomes E(X ) P(X ) Eamle - Discrete RV - Mean and SD For the revious eamle what is the eected value and the standard deviation of your winnings. X P(X ) X P(X ) (X E(X )) 2 P(X ) (X E(X )) 2 0 35 0 35 0 (0 0.8)2 0.656 35 0.656 0.446 We are also often interested in the variability in the values of a random variable. Described using Variance and Standard deviation 5 2 2 2 ( 0.8) 2 0.036 4 5 4 20 (5 0.8) 2 7.556 2 0.036 0.0083 4 7.556.3505 Var(X ) E[(X E(X )) 2 ] ( E(X )) 2 P(X ) 0 0 0 (0 0.8) 2 84.456 84.0889.6242 SD(X ) Var(X ) Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 5 / 23 Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 6 / 23 Bernoulli RVs Bernoulli RVs Bernoulli Random Variable A Bernoulli random variable describes a trial with only two ossible outcomes, one of which we will label a success and the other a failure and where the robability of a success is given by the arameter. (Since it needs to be numeric) the random variable taes the value to indicate a success and 0 to indicate a failure. X P(X) 0 - P(X ) { if if 0 Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 7 / 23 Proerties of a Bernoulli Random Variable Let X Bern() then E(X ) P(X ) 0 P(X 0) + P(X ) P(X ) Var(X ) E(X ) 2 E(X 2 2X + 2 ) E(X 2 ) 2 E(X ) + 2 (0 2 P(X 0) + 2 P(X )) 2 2 ( ) Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 8 / 23
Geometric RVs Geometric RVs Geometric Random Variable A Geometric random variable describes the number of (identical) Bernoulli trials that occur before the first success is observed. The distribution has a single arameter, the robability of a success. There is another slightly different characterization that counts the number of failures before the first success. We will focus on the former for now. Some useful infinite sum results For r < then, 0 r r r r ( r) 2 We can use the first result to show that X has a valid robability distribution, X P(X ) 2 ( ) 3 ( ) 2 4 ( ) 3.. P(X ) ( ) P(X ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 9 / 23 Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 0 / 23 Geometric RVs Proerties of a Geometric Random Variable Let X Geo() then E(X ) P(X ) ( ) ( ) / ( ) ( ) ( ) ( ( )) 2 Var(X ) 2 Combinations A common roblem in robability ass - if we have n items and want to select of them how many ossible grouings (order does not matter) are there? Given by the binomial coefficient (n )!! How many combinations of two numbers between and 6 are there: Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 / 23 Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 2 / 23
Permutations Derivation Another otion for those n items is if we select of them and want to now how many ossible uniue orderings there are. Given by (n )! How many ermutations of two numbers between and 6 are there: Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 3 / 23 Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 4 / 23 Pascal s Triangle Some roerties of the Combinations / Binomial coefficient 2 3 3 4 6 4 5 0 0 5 5 5 20 5 5 6 20 35 35 20 6 7 26 55 70 55 26 7 ( 4 0. ( 0 0) ( ) ( 0 ( ) 2 ) ( 2 ) ( 2 0 ) 2) ( 3 3) ( 3 ) ( 3 ) ( 3 0 2 2 3 4) Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 5 / 23 0 ( ) ( ) n n n 2 n + ( n ), for 0 < < n Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 6 / 23
Eamle - Cell Culture Binomial Distribution A researcher is woring with a new cell line, if there is a 0% chance of a single culture becoming contaminated during the wee what is the robability that if the researcher has four cultures that only one of them will be contaminated at the end of the wee? What about the robability cultures lasting the wee? 2 2 2 3 3 2 3 2 3 4 4 3 6 2 2 4 3 4 Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 7 / 23 Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 8 / 23 Binomial Distribution We define a random variable X that reflects the number of successes in a fied number of indeendent trials with the same robability of success as having a binomial distribution. If there are n trials then X Binom(n, ) P(X n, ) f ( n, ) ( ) n Binomial theorem Another useful result (and a connection with combinations) is the Binomial theorem which states: (a + b) m m 0 m y n m m Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 9 / 23 Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 20 / 23
Proerties of Proerties of Let X Binom(n, ) then, E(X ) P(X ) 0 n 0 ( ) n ( ) n 0 (n )!! ( ) n (n )! (n )!( )! ( ) n n (n )! n (n ( + ))!( )! ( ) n ( +) n (n )! n (n )!( )! ( ) n 0 n( + ( )) n n (n )!( )! ( ) n Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 2 / 23 Let X Binom(n, ) then, Var(X ) E [(X E(X )) 2] ( n) 2 P(X ) 0 ( ) ( n) 2 n P(X ) ( ) n 0. (lots of awfulness) n( ) We ll see an simle and elegant way of solving this on Wednesday. Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 22 / 23 Limitations of Eected Value St. Petersburg Lottery We start with $ on the table and a coin. At each ste: Toss the coin; if it shows Heads, tae the money. If it shows Tails, I double the money on the table. How much would you ay me to lay this game? i.e. what is the eected value? Sta02 / BME02 (Colin Rundel) Lec 5 Setember 8, 204 23 / 23