The algebra of random variables in statistics, provides rules for the symbolic manipulation of random variables, while avoiding delving too deeply into the mathematically sophisticated ideas of probability theory. Its symbolism allows the treatment of sums, products, ratios and general functions of random variables, as well as dealing with operations such as finding the probability distributions and the expectations (or expected values), variances and covariances of such combinations.

In principle, the elementary algebra of random variables is equivalent to that of conventional non-random (or deterministic) variables. However, the changes occurring on the probability distribution of a random variable obtained after performing algebraic operations are not straightforward. Therefore, the behavior of the different operators of the probability distribution, such as expected values, variances, covariances, and moments, may be different from that observed for the random variable using symbolic algebra. It is possible to identify some key rules for each of those operators, resulting in different types of algebra for random variables, apart from the elementary symbolic algebra: Expectation algebra, Variance algebra, Covariance algebra, Moment algebra, etc.

Algebra of random variables

Elementary symbolic algebra of random variables

Considering two random variables and , the following algebraic operations are possible:

Algebra of random variables

Addition: Subtraction: Multiplication: Division: Exponentiation:

Algebra of random variables

In all cases, the variable resulting from each operation is also a random variable. All commutative and associative properties of conventional algebraic operations are also valid for random variables. If any of the random variables is replaced by a deterministic variable or by a constant value, all the previous properties remain valid.

Expectation algebra for random variables

The expected value of the random variable resulting from an algebraic operation between two random variables can be calculated using the following set of rules:

Addition: Subtraction: Multiplication: . Particularly, if and are independent from each other, then: . Division: . Particularly, if and are independent from each other, then: . Exponentiation:

If any of the random variables is replaced by a deterministic variable or by a constant value (), the previous properties remain valid considering that and, therefore, .

If is defined as a general non-linear algebraic function of a random variable , then:

Some examples of this property include:

The exact value of the expectation of the non-linear function will depend on the particular probability distribution of the random variable .

Variance algebra for random variables

The variance of the random variable resulting from an algebraic operation between random variables can be calculated using the following set of rules:

Addition: . Particularly, if and are independent from each other, then: . Subtraction: . Particularly, if and are independent from each other, then: . That is, for independent random variables the variance is the same for additions and subtractions: Multiplication: . Particularly, if and are independent from each other, then: . Division: . Particularly, if and are independent from each other, then: . Exponentiation:

where represents the covariance operator between random variables and .

The variance of a random variable can also be expressed directly in terms of the covariance or in terms of the expected value:

If any of the random variables is replaced by a deterministic variable or by a constant value (), the previous properties remain valid considering that and , and . Special cases are the addition and multiplication of a random variable with a deterministic variable or a constant, where:

If is defined as a general non-linear algebraic function of a random variable , then:

The exact value of the variance of the non-linear function will depend on the particular probability distribution of the random variable .

Covariance algebra for random variables

The covariance () between the random variable resulting from an algebraic operation and the random variable can be calculated using the following set of rules: