Definition of expected value
Let's define expected value in the case of a discrete random variable with a finite set of possible values. Consider random variable that takes the values with probabilities , respectively. Then the expected value of is defined as
But what exactly stands behind this formula? Let's observe it on a classic example. So, the random variable is representing the outcome of a roll of a typical die: the possible values are , , , , , and , we are equally likely to get any of them with a probability of . For random variable we can calculate the expected value using the definition:
This means that every time we roll a dice, the value we expect to get on average is . But in case we got ourselves a different dice – for example a -sided one, with sides having number , the expected value of our random variable would change:
Having mastered the dice example, let's apply our new formula somewhere else. Imagine that you are working in an analytical department in a bank, your job is to decide whether to give out a loan. A person comes to the bank and asks for a loan of dollars at interest rate of percent. You have to decide whether to give out a loan or not.
For convenience, we shall consider that there are only two possible outcomes:
the person will pay off the loan, that is, they will return dollars to the bank
will not pay anything
Also, assume that the bank knows (or at least can estimate the probability of each of these events). In our example, let the client be a responsible young man, who will repay the loan with the probability of and will pay nothing with the probability of . To make a decision, you have to compute the expected value of profit:
dollars (potential profit, also known as interest on the loan) (probability of repayment of the loan) dollars (potential loss) (probability of total default of the loan) dollars .
So "average" returns are positive — and following your report the bank decides to lend.
Sometimes you can find different notations for the expected value of a random variable:
But what about the expectation of discrete random variables with an infinite set of values? Well, the good news is that formula stays almost the same:
Here random variable takes values from the countable infinite set . And in this case, we can imagine the expected value as the average value of the observed data if we repeat the experiment an infinite number of times.
Finding the expectation in the examples above was easy. However to find an infinite sum you might need a little more math. Don't worry, the mathematicians have already done it for you! In a few minutes, you will find out how to calculate the expectation for the most useful random variables with an infinite set of values.
Unfortunately, the infinite sum mentioned above is often equal to infinity. Here is an example of such a pitiful situation.
Imagine you come to a casino, and they offer you to play a game of chance with the following rules. The initial stake begins at 2 dollars and is doubled every time a head appears. When it is a tail, the game ends, and the player wins whatever is in the pot, so the player gets dollars, where is the number of consecutive head tosses. We already know that to estimate the potential gain, you need to calculate the expected value. Let's try to do this by definition:
As you see, the expected win is an infinite amount of money. So, don't miss out!
Properties of expected value
Mathematical expectation has some useful properties that can seriously facilitate calculations.
For example, let's calculate the expected value of the sum of the dots rolled after tosses of a die. Above, we have already calculated the expected value of one roll of a -sided die. Therefore, all we have to do is multiply the expected value we got previously by three:
It's possible because of the linearity of the expected value.
Let – the constants, and are discrete random variables, then:
Take a look at another example. Let's say now in the game one die is normal, -sided, and the other one is -sided. The random variable corresponds to the number we get on the -sided die, and Y – to the one we get on the -sided one. We'll calculate the expected value of one roll of both dices:
Finally, we'll count the expected value of three rolls of -sided and four rolls of -sided dice:
One more significant property is necessary for comparing random variables and making estimates on them. For example, there are two mechanics in an auto repair shop, and they are paid a salary in proportion to how many customers they serve per day. One of them is more experienced and manages to serve from to customers every day. The second mechanic has started working recently, so performs tasks slower: the second mechanic manages to serve only clients per day. It is clear that the "average" salary the first mechanic will receive would be bigger than that of the second one.
In such cases, we speak about the monotony of the expected value.
Here is the formal definition of this property: let are discrete random variables such that , that is , then:
But the expectation of the product of random variables is not always so easy to calculate. The point is in the non-multiplicative nature of the expected value.
Let are discrete random variables, then is not necessarily equal to . Let's look at the following example:
What will the expectation of the product of these random variables be equal to?
However, for independent random variables, the multiplicative property of the expected value will be satisfied, that is if are independent discrete random variables, then is equal to .
The linearity of the expected value takes place regardless of whether the discrete random variables are dependent or not, in contrast to multiplicative property.
Expected value of special discrete distributions
So how to calculate the expectation for the most important discrete variables?
Bernoulli distribution
Let's begin with the easiest one. As you may remember, a random variable with the Bernoulli distribution may take the value 1 with the probability p and value 0 with probability 1 — p. If we insert these numbers into the formula of expected value of a random variable, we get:
So, for a random variable with the Bernoulli distribution the expected value would be the probability of it taking the value 1 or:
Imagine you play a game, and your chances of winning are 70%. A random variable describes the outcome of a single game, and naturally, it has Bernoulli distribution, because there are only 2 possible outcomes — you either win or lose. Bearing in mind the probability of you winning, you intuitively expect to win 0.7 of the games you play.
Geometric distribution
Recall the formula of Geometric distribution:
, for , where and .
Then the expected value of the random variable with the geometric distribution is:
Here is how it works. Let there be a breeder who breeds dogs. Let's assume the breeder is determined to breed a rare-colored puppy, and wonders how many puppies will appear before the puppy of the desired color is born. Let the probability of "not a success" (birth of a regular-colored puppy) be p=0.9. Let's use the formula above:
Thus, "on average", the breeder will have nine regular-colored puppies before a rare-colored puppy appears.
Binomial distribution
As for the , the formula of expected value is even simpler:
Let's look again at our breeders. Imagine that they were afraid of such an impressive number of potential puppies and decided that was ready to get only puppies. The breeders are now wondering how many rare-colored puppies out of these puppies they will have "on average". In this case, the probability of "success" (birth of a rare-colored puppy) is . Let's calculate the expected value:
What does the following result tell us? Of course, the breeder can't have half a puppy. Calculations only mean that for attempts, the fulfillment of a dream "on average", sadly, does not fit. If the breeder still decides to have puppies, then the expectation will look like this:
If you think about it, this is exactly the result that we expected: if the probability of a rare-colored puppy's birth is , then we intuitively understand that one rare-colored puppy should appear once in every puppies.
Poisson distribution
At last, let's not forget the Poisson distribution formula:
, for
This distribution seems to be the most complicated of all considered. It is difficult to imagine that when conducting a series of experiments on average we will get ! But it's really so because for Poisson distribution
Recall that in the Poisson distribution . In fact, the parameter is initially chosen as the expected value of the considered discrete random variable, so the result once again confirms the correctness of the choice of the parameter.
Conclusion
Let's summarize what we have learned. Firstly, we have formally determined the expected value — the value you expect to get on average in every single attempt or event. Then, we have looked at its properties of linearity and monotonicity, that describe the mathematical properties of expected values and makes calculating them easier. Finally, we have calculated the expected values for some special cases: the expected value of geometric distribution is equal to , the expected value of binomial distribution is equal to , and the expected value of Poisson distribution is equal to .