{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


l20_prob_randvar - 6.042/18.062J Mathematics for Computer...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
6.042/18.062J Mathematics for Computer Science April 28, 2005 Srini Devadas and Eric Lehman Lecture Notes Random Variables We’ve used probablity to model a variety of experiments, games, and tests. Through- out, we have tried to compute probabilities of events . We asked, for example, what is the probability of the event that you win the Monty Hall game? What is the probability of the event that it rains, given that the weatherman carried his umbrella today? What is the probability of the event that you have a rare disease, given that you tested positive? But one can ask more general questions about an experiment. How hard will it rain? How long will this illness last? How much will I lose playing 6.042 games all day? These questions are fundamentally different and not easily phrased in terms of events. The problem is that an event either does or does not happen: you win or lose, it rains or doesn’t, you’re sick or not. But these new questions are about matters of degree: how much, how hard, how long? To approach these questions, we need a new mathematical tool. 1 Random Variables Let’s begin with an example. Consider the experiment of tossing three independent, un- biased coins. Let C be the number of heads that appear. Let M = 1 if the three coins come up all heads or all tails, and let M = 0 otherwise. Now every outcome of the three coin flips uniquely determines the values of C and M . For example, if we flip heads, tails, heads, then C = 2 and M = 0 . If we flip tails, tails, tails, then C = 0 and M = 1 . In effect, C counts the number of heads, and M indicates whether all the coins match. Since each outcome uniquely determines C and M , we can regard them as functions mapping outcomes to numbers. For this experiment, the sample space is: S = { HHH, HHT, HTH, HTT, THH, THT, TTH, TTT } Now C is a function that maps each outcome in the sample space to a number as follows: C ( HHH ) = 3 C ( THH ) = 2 C ( HHT ) = 2 C ( THT ) = 1 C ( HTH ) = 2 C ( TTH ) = 1 C ( HTT ) = 1 C ( TTT ) = 0 Similarly, M is a function mapping each outcome another way: M ( HHH ) = 1 M ( THH ) = 0 M ( HHT ) = 0 M ( THT ) = 0 M ( HTH ) = 0 M ( TTH ) = 0 M ( HTT ) = 0 M ( TTT ) = 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 Random Variables The functions C and M are examples of random variables . In general, a random variable is a function whose domain is the sample space. (The codomain can be anything, but we’ll usually use a subset of the real numbers.) Notice that the name “random variable” is a misnomer; random variables are actually functions! 1.1 Indicator Random Variables An indicator random variable (or simply an indicator or a Bernoulli random variable ) is a random variable that maps every outcome to either 0 or 1. The random variable M is an example. If all three coins match, then M = 1 ; otherwise, M = 0 . Indicator random variables are closely related to events. In particular, an indicator partitions the sample space into those outcomes mapped to 1 and those outcomes mapped to 0. For example, the indicator M partitions the sample space into two blocks as follows: HHH �� TTT HHT HTH HTT �� THH THT TTH M = 1 M = 0 In the same way, an event partitions the sample space into those outcomes in the event and those
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}