Oct 6 2009 LEC 4 ECON 240A 1 Random Variables L Phillips I Introduction A random variable is a variable that takes on values in its range with some associated probability An example may be the number of heads in one flip of a fair coin which can take the value zero with probability or the value one with probability So a random variable is associated with a probability distribution In this example the random variable the number of heads takes on discrete values Random variables can also take on continuous values for example along the number line We will use repeated trials of a random experiment such as flipping a coin n times to study the binomial distribution Given the distribution of a random variable we will examine notions of central tendency such as the expected value of a random variable as well as measures of dispersion such as the variance of a random variable II Repeated Bernoulli Trials In the single flip of a coin heads may be the outcome with probability p or tails with probability 1 p If we consider the random variable k to be the number of heads it can take the value zero with probability 1 p or the value one with probability p The central tendency or the expected number of heads is E k i ki P ki 0 1 p 1 p p so each value of k is multiplied by its associated probability of occurrence and this weighted sum is the expected value of k If the coin is fair then the expected number of heads or mean or average value is The dispersion around the mean is the variance VAR k VAR k E k Ek 2 i ki EkI 2 P ki Oct 6 2009 LEC 4 ECON 240A 2 Random Variables L Phillips In our example the variance in the number of heads is VAR k 0 p 2 1 p 1 p 2 p p2 1 p 1 p 2 p p 1 p p 1 p p 1 p Let us expand the number of trials to two a sequence of two independent or random experiments consisting of the flip of a coin twice with outcomes given by the tree diagram in Figure 1 p p H H 1 p p 1 p T H T 1 p T Figure 1 Tree Diagram for Two Coin Flips So it is possible to get zero heads with probability 1 p 2 one head with probability 1 p p or one head with probability p 1 p or two heads with probability p2 The expected value of the number of heads is E k 0 1 p 2 1 1 p p 1 p 1 p 2 p2 2 1 p p 2 p2 2 p 1 p p 2p Oct 6 2009 LEC 4 ECON 240A 3 Random Variables L Phillips So the mean for the case of two trials is just twice the mean for one trial The variance in the number of heads is VAR k VAR k E k Ek 2 0 2p 2 1 p 2 1 2p 2 1 p p 1 2p 2 p 1 p 2 2p 2 p2 4p2 1 p 2 2 1 4p 4p2 1 p p 4 1 p 2 p2 8p2 1 p 2 2 1 p p 8 p2 1 p 8 p3 1 p 8p2 1 p 2 2 1 p p 8 p2 1 p 1 p 2 1 p p i e twice the variance for one trial As we shall see for n trials the mean number of heads is np and the variance is n p 1 p III Histograms of the Probability Distributions In the case of a single flip of a coin the number of heads could take two values zero or one with probabilities and respectively for a fair coin This is illustrated in Figure 2 1 Probability 1 2 0 0 Figure 2 Histogram for a Single Flip 1 Number of Heads Oct 6 2009 LEC 4 ECON 240A 4 Random Variables L Phillips In the case of two successive flips it is possible to get zero one two heads with probabilities respectively for a fair coin This is illustrated in Figure 3 1 Probability 1 2 1 4 0 0 1 2 Number of Heads Figure 3 Histogram for Two Flips Note from Figures 1 and 3 that the outcome of one head is more likely than zero or two heads This is because you can obtain one head with two combinations HT or TH The probability of either of these elementary outcomes is p 1 p and we have to account for the number of combinations of one head in two trials denoted C2 1 2 1 1 2 So the probability of obtaining one head in two trials for a fair coin is P k 1 C2 1 p 1 p 2 1 2 1 2 1 2 IV Pascal s Triangle The value of the number of combinations is given by Pascal s triangle illustrated in Figure 4 Oct 6 2009 LEC 4 ECON 240A 5 Random Variables L Phillips 1 1 1 1 2 1 1 3 3 1 Figure 4 Pascal s Triangle Each Entry Is the Sum of the Two Numbers Above It To find Cn k start counting at zero and count down to row n and starting at zero over to entry k V The Binomial Distribution Consider three successive flips of a coin i e three successive random experiments as illustrated in Figure 5 p p p H H 1 p H H T p 1 p T T H H T 1 p p T H 1 p T T Figure 5 Three Flips of a Coin Oct 6 2009 LEC 4 ECON 240A 6 Random Variables L Phillips The probability of getting k heads in three trials where k can take the values zero one two or three is p k C3 k pk 1 p n k For a fair coin the probability of zero heads is P k 0 3 0 3 1 2 0 1 2 3 1 8 And the probability of obtaining one head is P k 1 3 1 2 1 2 1 1 2 2 3 1 8 3 8 For three flips the histogram of the probability of getting k heads is shown in Figure 6 1 Probability 1 2 3 8 1 4 1 8 0 0 1 2 3 Number of Heads Figure 6 Histogram for Three Flips From the histograms for one flip two flips and three flips we can draw the suggestion that the probability distribution for a fair coin is symmetric and becomes more bell shaped as the number of trials increases Oct 6 2009 LEC 4 ECON 240A 7 Random Variables L Phillips VI Expected Value of the Sum of Random Variables Recall that for a single flip of a coin the expected value of the number of heads equals p The probability of getting kI heads on flip one and kII heads on flip two where …
View Full Document
Unlocking...