This article introduces numerical characteristics of random variables such as expectation and variance.
Expectation
Definition
Discrete random variable
Let the probability distribution of the discrete random variable be . If the series
If it converges absolutely, its value is called the expectation of , written .
Continuous random variable
Let the density function of the continuous random variable be . If the integral
When it converges absolutely, this value is the expectation of , denoted .
Unified definition
Let the distribution function of the random variable be . If the Stieltjes integral
Absolute convergence makes this value the expectation of , which we denote by .
Example where the expectation does not exist
Consider a discrete random variable with the following distribution:
Although the series converges to , it is not absolutely convergent, so the expectation of does not exist.
Now consider a continuous random variable with the following density function:
It is easy to verify that the expectation of also does not exist.
Properties of expectation
Linearity
If the expectations of random variables exist, then
- For any real numbers , .
- .
Expectation of the product of random variables
If the expectations of random variables and exist and and are independent, then
Note that independence is not a necessary condition in the property above.
Counterexample
Consider random variables and , where is uniformly distributed on and .
Converting between expectation and probability
For a random event , consider its indicator function :
By definition, its expectation is . This conversion is very common in practical applications.
Example
Suppose a sequence of length , , is given, where , with probability , takes the value and, with probability , takes the value . Consider how to find the expectation of .
Directly applying the definition requires finding the probability of every possible value of , which is rather cumbersome, so the details are omitted here.
Alternatively, let be the indicator function of the random event . Then
It is then easy to obtain
Conditional distribution and conditional expectation
We have previously studied conditional probability; similarly, we can introduce the concept of conditional expectation.
Definition
For two random variables and , conditional on , the probability distribution (density function) of is called the conditional probability distribution (conditional probability density), denoted respectively by
Under this condition, the expectation of is called the conditional expectation, denoted by .
Properties of conditional expectation
Many properties of conditional expectation follow from conditional probability and will not be elaborated here.
It is worth noting that is generally a function of the random variable , and this function is usually not linear. However, we do have
The equation above is called the law of total expectation.
Application
HDU 5984 Pocky
There is a Pocky stick of length , which is randomly broken into two pieces each time. If the length of the piece on the right is no greater than , stop; otherwise, repeat the process on the piece on the right. Find the expected number of repetitions.
Solution
Let denote the expected number of repetitions for a piece of length . The case is trivial.
When , let the distance from the break point to the right endpoint be . Clearly, , and the expected number of repetitions at this point is
By the law of total expectation,
Solving the integral equation above and substituting the initial condition gives
Variance
Definition
Let a random variable have an existing expectation , and suppose that the expectation
also exists. Then its value is called the variance of the random variable , denoted by or . The arithmetic square root of the variance is called the standard deviation, denoted by .
Properties of variance
If the variance of a random variable exists, then
- For any constants , .
- .
Covariance and correlation coefficient
In general, the equality does not hold. This naturally raises two questions:
- What exactly is the difference between and ?
- Under what conditions are and equal?
We introduce covariance to answer the first question.
Definition of covariance
For random variables ,
is called the covariance of and , denoted by .
Properties of covariance
For random variables , we have
- For any constants ,
Covariance and variance are also related as follows:
About covariance
You may notice that the properties of covariance are highly consistent in form with the properties of the inner product of vectors.
From the perspective of functional analysis, for a given probability space, all random variables on it form a linear space, while covariance is an inner product on this space, and the standard deviation is the norm induced by this inner product.
For the second question raised above, it is easy to see that if and only if . A natural necessary condition is that and are independent, because then
However, this condition is not sufficient. To describe the relationship characterized by between random variables and , we introduce the correlation coefficient.
Correlation coefficient
For random variables ,
is called the Pearson correlation coefficient of and , denoted by .
The Pearson correlation coefficient describes the strength of the linear association between two random variables. The larger is, the stronger the linear association between and . It is not difficult to prove that , and can occur only in the following two cases:
- If there are a real number and a positive real number such that , then .
- If there are a real number and a negative real number such that , then .
When , we say that random variables and are uncorrelated; in this case, there is no linear relationship between and .
“Uncorrelated” and “independent”
Two random variables being uncorrelated only means that there is no linear association between them; it does not mean that there are no other forms of dependence.
Therefore, the statement that two random variables are uncorrelated is a necessary but not sufficient condition for them to be independent.
For the second question mentioned at the beginning of this section, we conclude that the necessary and sufficient condition for is that either one of and is constant with probability , or that are uncorrelated.