Section 6.1: Discrete Random Variables A random variable is discrete if and only if its set of possible values is finite or, at most, countably infinite ➤ A discrete random variable is uniquely determined by Its set of possible values Its probability density function (pdf): A real-valued function defined for each probability that has the value ➤ ✦ as the ✦ By definition, Section 6.1: Discrete Random Variables 1 is Equilikely and each possible value is equally likely is the sum of the two up faces, If Example 6.1.2 Roll two fair dice ➤ Example 6.1.1 ➤ Examples From example 2.3.1, Section 6.1: Discrete Random Variables 2 Example 6.1.3 A coin has as its probability of a head ➤ Toss it until the first tail occurs ➤ If : Verify that and the set of possible values is infinite & % $ " # ! ➤ is Geometric ➤ and the pdf is is the number of heads, ➤ Section 6.1: Discrete Random Variables 3 Cumulative Distribution Function is Equilikely If then the cdf is . . is Geometric If then the cdf is " ) # 01 / ' ) ➤ " - ) ' ➤ ) * +, ( ' The cumulative distribution function(cdf) of the discrete random for each as variable is the real-valued function ' ➤ Section 6.1: Discrete Random Variables 4 62 67 5 8 4 2 62 3 7 9 7 ? 8 <= 9 7 > Section 6.1: Discrete Random Variables 67 5 8 4 2 3 7 :97 8= 9:7 6 ;< 2 is small enough to tabulate the cdf :97 ➤ for sum of two dice 9 6 7 No simple equation for ➤ ' Example 6.1.5 5 Relationship Between cdfs and pdfs = ' ➤ ' ' A pdf can be generated from its corresponding cdf by subtraction ➤ ' ' ' For example, A cdf can be generated from its corresponding pdf by recursion ➤ A discrete random variable can be defined by specifying either its pdf or its cdf Section 6.1: Discrete Random Variables 6 Other cdf Properties 1 @ ' $ The cdf values are bounded between 0.0 and 1.0 Monotonicity of is the basis to generate discrete random variates in the next section ➤ ' ➤ , then $ 1 if ' A cdf is strictly monotone increasing: @ ➤ Section 6.1: Discrete Random Variables 7 Mean and Standard Deviation ➤ The corresponding standard deviation is is ➤ The variance is A$ $ B A $ or B $ B D E F D C B A of the discrete random variable The mean A ➤ Section 6.1: Discrete Random Variables 8 $ 1$ %H B G and Section 6.1: Discrete Random Variables . G I M G $ B " $ A and A $ D K L D C 1$ is the sum of two dice then " If , 1$ ➤ is Equilikely When A A and B then the mean and standard deviation are I J is Equilikely If ➤ Examples 9 is Geometric If then the mean and standard deviation are 1 1 " " # $ $ A $ $ B $ $ ! " ! " # A ! ! ➤ Another Example B N $ B $ .. Section 6.1: Discrete Random Variables 10 Expected Value The expected value of the discrete random variable A is ➤ Q The mean of a random variable is also known as the expected value OP ➤ W V A U T U SR Section 6.1: Discrete Random Variables ) is the mode, which can The most likely value (with largest be different from the expected value ➤ $ 1 Q Expected value refers to the expected average of a large sample corresponding to : as . OP ➤ 11 ➤ The most likely number of heads is 0 ➤ The expected number of heads is 1 ➤ 0 occurs with probability and 1 occurs with probability M Toss a fair coin until the first tail appears . ➤ . Example 6.1.10 The most likely value is twice as likely as the expected value ➤ For some random variables, the mean and mode may be the same For the sum of two dice, the most likely value and expected value are both 7 Section 6.1: Discrete Random Variables 12 [ X Section 6.1: Discrete Random Variables Q X Note: in general, this is not equal to OP Q OP X is \Q The expected value of [ U is a new random variable, with possible values OP ➤ for all possible values of \ ➤ \ X X Define function X ZY ➤ More on Expectation 13 ➤ $ B $ A $ B $ A $ $ Q OP with equality if and only if Section 6.1: Discrete Random Variables $ A $ $ Q$ OP B $ Q OP ^_Q $ OP $ OP \Q OP A $ Q A $ $ , ] Q$ Q \Q OP A ] , A So that ➤ If A ➤ with OP If $ ➤ OP Example 6.1.11 is not really random 14 Example 6.1.12 ➤ Q OP Q and , for constants OP \ \Q If OP ➤ Suppose is the number of heads before the first tail Win $2 for every head and let be the amount you win \ ✦ ✦ The possible values ➤ Your expected winnings are Section 6.1: Discrete Random Variables Q OP Q OP \Q OP ] you win are defined by X \ ➤ 15 Discrete Random Variable Models Section 6.1: Discrete Random Variables For example, the functions Equilikely and Geometric generate and Geometric random variates corresponding to Equilikely random variables, respectively ➤ A random variate is an algorithmically generated possible value of a random variable ➤ A random variable is an abstract, but well defined, mathematical object ➤ 16 ➤ The cdf: ➤ The mean: ➤ The variance: ➤ The standard deviation: $ B $ `1 B $ A for /`1 ' Section 6.1: Discrete Random Variables for The pdf: ➤ with probability and with probability ➤ with possible values The discrete random variable ➤ Bernoulli Random Variable 17 To generate a Bernoulli ➤ Bernoulli Random Variate random variate if (Random()< 1.0-p) return 0; else return 1; V Monte Carlo simulation that uses replications to estimate an unknown probability is equivalent to generating an iid sequence random variates of Bernoulli V ➤ Section 6.1: Discrete Random Variables 18 Example 6.1.14 ➤ ➤ Pick-3 Lottery: pick a 3-digit number between 000 and 999 Costs $1 to play the game and wins $500 if a player matches the 3-digit number chosen by the state ➤ The player’s expected yield is be the player’s yield # G X X X \Q OP 1 b bM X a \ Let X ➤ Section 6.1: Discrete Random Variables 19 as its probability of a head and toss this coin V is a Binomial times random and the pdf is V R ` V V ➤ Let be the number of heads; variable ➤ A coin has ➤ V Binomial Random Variable tosses of the coin generate an iid sequence random variables and Bernoulli Section 6.1: Discrete Random Variables R 1 $ R of $ 1 V ➤ 20 Binomial equation ➤ In the particular case where j i c R ` R " # V R ➤ d fge h Verify that R ` " # R R V R and Section 6.1: Discrete Random Variables 21 " # Section 6.1: Discrete Random Variables V A $ + o V V q V q `q) ) po q V p + and $ The variance is R p # + o " 1 V o o ` V 1 R ` V o R " " # # Q OP R ` A V R R The mean is A $ ➤ V Let OP " ) ➤ Q$ B $ A n h mlgke Mean and Variance of Binomial 22 Pascal Random Variable A coin has as its probability of a head and toss this coin until the tail occurs V ) r ➤ is the number of heads, is a Pascal V If random variable ={0,1,2,...} and the pdf is ➤ R V ➤ Section 6.1: Discrete Random Variables 23 Pascal Random Variable ctd. V $ V ` R V Negative binomial expansion: ➤ Prove that the infinite pdf sum converges to 1 ➤ It can also be shown that ` R R " # $ A $ $ A $ Q$ OP B $ V ! " # Q A OP V ! " # R V ! ➤ Section 6.1: Discrete Random Variables 24 X " x vu XX XX + w X % V We see that a Pascal random variable is the sum of iid random variables Geometric ➤ $ 1 & |z" x vu XX } XX X +X w t ~z" x uv XX X & w +X t X X is large, a head/tail sequence might be X yz" x vu X X { X + w X t X V and X For example,if t X ➤ M V R $ 1 V s If and is an iid sequence of Geometric random variables, the sum is a Pascal random variable V ➤ Example 6.1.17 Section 6.1: Discrete Random Variables 25 Section 6.1: Discrete Random Variables ! R V A and A A So that A A R V V V A o o V V o ` R A R Vo A A A Vo W V U as V Vo and V o A Fix A ➤ o Poisson o V ➤ ! R ! R is a limiting case of Binomial V A . V Poisson Random Variable It can be shown that 26