Random variables, expectation and variance(CSCI 2824, Spring 2015)
Topic covered:
(Section 6.4 of the book) Random variablesIn an (random) experiment, where we have finitely many possible outcomes, often times it is natural to assign a value to each outcome. Example 1When tossing a die, naturally we can get a numerical outcome from . Example 2In the case of flipping a coin, we can assign numerical values for the head and the tail. For instance, we can define a function : Let's imagine I have a bet with a friend on flipping a coin:
Now we can talk about what a random variable is. Random variables
In an experiment where the sample space is finite (i.e., is the set of all and finitely many possible outputs), a random variable is a function , where is a subset of . In mathematics, random variables are simply functions (when an experiment has only finitely many outcomes). In practice, we can think of random variables as measurements associating each possible outcome in an experiment with a numerical value. We are being very careful here avoiding situations where there are infinitely many possible output. In particular, we are avoiding the likes of normal distribution and Poisson distribution, which are often encountered in real life. To fully understand the mathematics behind continuous probability distribution, one would need some basic notion of measure theory. Expected valueSince we focus only on experiments with finitely many possible outcome, we can assume that every random variable can take on only finitely many possible values. Expected value of random variables
Suppose we have a random variable , whose output values lie in the finite set . The expected value of is defined as: The expected value of a random variable is simply the average value of the random variable we would get from a random experiment. Example 3When we throw a die, we can get one of the six possible values . What is the expected value of the outcome? Answer
Each number can be obtained with equal probability . Hence the expected value of the outcome is Example 4Suppose I have a loaded coin, where
I enter a bet with a friend (as in Example 2):
What is the expected value of my gain on flipping the coin one time only? Answer
Example 5Following up on Example 4: suppose now that we flip the coin twice. What is the expected value of my gain? Answer
Here are the four possible outcomes, along with my gain and the probability:
Hence the expected value is As you would expect, I win more on average if we play the flipping coin bet twice instead of once! The expected value is linear, in the following sense: if and are two random variables defined on the same sample space and is a real-valued constant, then VarianceGiven a random variable, we can talk about not only the average value (i.e. the expected value), but also how far in general we can expect to be away from the average value. You have probably heard of the term standard deviation in statistics (which is handy for determing your standing in terms of course grades, for example). Like standard deviation, the variance of a random variable measures the spread from the expected value. Given a random variable whose output value lies in , the variance of is defined as Example 6We consider again the scenario in Example 5. We can calculate the variance of my gain: What this number says is basically that I do have a good chance of losing money! |