1. Multiplying random variables
Imagine I flip this fair coin ten times and count the number of heads. Then I take that number and triple it. What could you tell me about the resulting number? You don't know exactly what it is, but could you tell me its mean, or its variance?
Just like there are laws of probability for combining events, there are laws for manipulating random variables. In these next lessons you'll learn to multiply random variables with a constant, or combine them together.
2. Multiplying a random variable
Suppose X is a random variable containing the result of flipping a fair coin ten times. We could take draws from X- one draw could be 5, another could be 7, another could be 4, each representing ten flips of a coin.
In probability, it's important to get into the habit of manipulating random variables kind of like they were algebraic symbols. So we could imagine defining a new random variable Y, which is 3 times X. If X were 5, Y would be 15. If X were 7, Y would be 21.
Now we want to know the properties of Y, such as its expected value and variance. To do that, imagine the histogram of X, then compare it to the histogram of X times 3 = Y. Notice that the shape of Y is the same, but it is both larger, and more spread out. So we would expect both the expected value and the variance to increase.
3. Simulation: Effect of multiplying on expected value
Let's see what the exact effect of multiplying by 3 is through simulation. Try taking one hundred thousand draws from X- a binomial with 10 flips of a fair coin. We can take the mean and check that the expected value is about 5: that's 10 flips times the probability .5.
To get a sample from Y, we multiply our sample of X by three. Note that 3 times X will multiply every individual value by 3. Thus, we went from one hundred thousand draws of X, to one hundred thousand draws from Y.
We can find the expected value of Y by taking the mean, and we see that it's about 15. Thus, when we multiplied a random variable by 3, we also multiplied the expected value by 3. This makes sense because we can see that the distribution has roughly the same shape, it's just three times larger.
This is a general rule: when you multiply a random variable by a constant k, you also multiply the expected value by k.
4. Simulation: Effect of multiplying on variance
We can also examine what happens to the variance. The variance of X is about 2-point-5: recall that that's the size times p times 1 minus p.
Now when we multiply it by 3 to get Y, the variance becomes 22-point-5: it's increased by a factor of 9.
Why is it nine? Because that's three squared, and the variance is the average squared distance of values from the mean. So when the distribution became three times wider, the variance increases by nine.
5. Rules of manipulating random variables
This gives us two general rules for the properties of random variables when they're multiplied by a constant.
You're learning about the binomial in these chapters, but these properties hold true no matter what the distribution the random variable follows, so they're useful in many applications of probability.
6. Let's practice!