Suggested languages for you:

Americas

Europe

|
|

# Transforming Random Variables

Random variables are everywhere! Think of a groceries store. Whenever a client comes in, you cannot know in advance how much money they will spend on groceries. The manager of the store, however, needs to have a picture in mind of how much an average client spends in his store.

To address this issue, the money spent by a single client is treated as a random variable. However, big stores typically have hundreds or thousands of clients a day! It might also be possible that the whole store goes on sale. What happens to random variables under these circumstances? They are transformed. Here you will learn about transforming random variables and what scenarios can be modeled by these transformations.

## What is the Transformation Method for Functions of Random Variables?

Let's use the groceries store example to talk about the transformation of random variables. Rather than being the manager, you will now be a customer.

Suppose you go to the groceries store once a week. You usually buy the same stuff, with only slight variations, so you know more or less how much will be spent on your groceries. How can you give an estimate of how much will you spend on groceries in the month?

Now suppose the entire store goes on a $$10 \%$$ sale, but you will limit yourself to buying the usual stuff. How can you give an estimate of how much will you spend on groceries while the store is on sale?

The above scenarios describe two types of transformations that can be done to random variables. In your monthly groceries shopping example, you are adding random variables. In the store-on-sale example, you are multiplying a random variable by a constant.

Transforming random variables refers to doing operations on random variables and analyzing how these operations affect the possible outcomes.

Multiplication and addition are not the only transformations available, as typically, you can:

• Add a constant to a random variable.
• Subtract a constant from a random variable.
• Multiply a random variable by a constant.
• Add or subtract two random variables.

Since there are numbers and operations involved, it is assumed that you are working with quantitative data.

The addition/subtraction of two or more random variables is usually referred to as combining random variables.

## What is the Impact of Transforming Random Variables?

You have seen that there are four types of transformations that can be done to random variables. Here you will see how data is transformed accordingly.

You can use the groceries store example to have an idea of how to transform random variables. Suppose you spent $$\ 14.25$$ on groceries in one go, so the value of the random variable has been now determined. This value will be used to illustrate each case of the transformation of random variables.

### Adding a Constant to a Random Variable

Adding a constant to a random variable is pretty straightforward. You just need to add that value to the value of the random variable! If you are working with a data set, then the variable is added to each value of the data set. If $$X$$ is a random variable and $$k$$ is a constant, this is just $X+k.$

What if just before paying for your groceries, you get a phone call from your friend who is craving a chocolate bar?

You decide to pick one for $$\ 1.25$$ so you anticipate that the sales total will be $$\ 1.25$$ more than expected. Suppose $$X$$ is the random variable that represents how much will you spend on groceries under normal circumstances, then you need to find

$X+1.25.$

In this hypothetical scenario, you previously determined that $$X=14.25$$, so if you now include the chocolate bar this would be

\begin{align} X+1.25 &= 14.25+1.25 \\ &= 15.50 \end{align}

The idea of adding a constant to a random variable in this scenario is that, no matter how much you spend on groceries, in the end, you will have to add $$\1.25$$ to the total to satisfy your friend's cravings!

### Subtracting a Constant from a Random Variable

Like with the addition of a constant to a random variable, to subtract a constant from a random variable you just need to subtract the constant from the value of the random variable, that is

$X - k.$

Data sets are worked similarly, so you have to subtract the constant from every value of the data set.

What if, just before paying for your groceries, you remember that you have a coupon for $$2$$ dollars off in your next buy?

Suppose $$X$$ is the random variable that represents how much will you spend on groceries under normal circumstances, then you need to find

$X-2.$

In this hypothetical scenario, you previously determined that $$X=14.25$$, so if you now include the discount coupon this would be

\begin{align} X-2 &= 14.25-2 \\ &= 12.25 \end{align}

This time, you will need to subtract $$\ 2$$ from the total. Thank you, coupon!

### Multiplying a Random Variable by a Constant

This time rather than adding or subtracting from a random variable, the constant multiplies the value of the random variable, so

$kX.$

For a data set, you multiply each value of the data set by the same constant $$k$$.

What if just before paying for your groceries, you remember that you have a coupon for $$10 \%$$ off in your next buy?

In this example, you have a $$10 \%$$ off coupon, so you end up paying only $$90 \%$$ of the price. Let $$X$$ be the random variable that represents how much will you spend on groceries under normal circumstances, then you need to find

$0.9X.$

In this hypothetical scenario, you previously determined that $$X=14.25$$, so if you now include the discount coupon this would be

\begin{align} 0.9X &= 0.9(14.25) \\ &= 12.83 \end{align}

This coupon discounts by a percentage, so you will have to multiply the total by the percentage written in decimal form.

### Adding or Subtracting Two Random Variables

Sometimes, you will need to operate with more than one random variable, essentially you will have a combination of random variables! As usual, it is assumed that both random variables represent quantitative data.

For this one, you have to be careful. The notation can be deceiving because, even if you are using the plus sign, you are dealing with random variables and not numbers. This means that the usual algebraic conventions, like saying that $$X+X=2X$$ do not always apply! The plus sign is used as a means of notation.

What if you have to consider your next buy at the groceries store? You cannot know how much are you going to spend next week, but you know that you will have to add both values. Let $$Y$$ be the random variable that represents how much will you pay next week, then

$X+Y$

will represent the money spent in two weeks.

The notation $$X+Y$$ is used to represent combined random variables, but to work with actual numbers you have to use values like the mean and the standard deviation, as you will see below.

## Rules for Transforming and Combining Random Variables

You can have a clearer grasp on the transformation of random variables by taking a look at how the mean and the standard deviation are affected.

### Effects on the Mean

Whenever you do a transformation of a random variable, you are essentially transforming data. Because of this transformation, you can expect that the mean is transformed as well!

Adding a constant to a random variable essentially translates to adding the same constant to the mean. Likewise, if you subtract a constant from a random variable, then the mean will be modified by subtracting the same constant from the original mean.

For the multiplication of a random variable by a constant, you can see the operation as a rescaling of the data, so the mean will be rescaled by the same factor.

Let $$X$$ be a random variable and $$k$$ a constant. Then the mean $$\mu$$ of the random variable has the following properties:

$\mu (X+k) = \mu (X) + k,$

$\mu (X-k) = \mu (X) - k,$

and

$\mu (kX) = k \cdot \mu(X).$

And what if you need to combine random variables?

If $$X$$ and $$Y$$ are two independent random variables, then

$\mu (X+Y) = \mu(X)+\mu(Y).$

The above expression gives you a method for operating combined random variables by adding their means.

### Effects on the Variance and Standard Deviation

Variance and standard deviation are ways of measuring how spread the possible values of a random variable are. If the random variable is modified, you can expect these measures of spread to be modified as well.

Since adding (or subtracting) a constant to a random variable essentially translates its possible values by the same amount, then the spread will be the same! It is like if you moved a bunch of things together, their relative position will stay the same, so the measures of spread will not be modified.

If you were to multiply the random variable by a constant $$k$$, then its values will be rescaled. You can expect the spread of the data to be modified as well, so the data will spread more if $$k>1$$, or less if $$k<1$$.

Let $$X$$ be a random variable and $$k$$ a constant. Then the standard deviation $$\sigma$$ of the random variable has the following properties:

$\sigma(X+k) = \sigma(X),$

$\sigma(X-k) = \sigma(X),$

and

$\sigma(kX) = k \, \sigma(X).$

Since the variance is the square of the standard deviation, you can also conclude that

$\sigma^2(X+k) = \sigma^2(X),$

$\sigma^2(X-k) = \sigma^2(X),$

and

$\sigma^2(kX) = k^2 \, \sigma^2 (X).$

Here is something to spice things up. When combining random variables, the standard deviation is not as straightforward as the mean. What is straightforward is the variance, that is:

$\sigma^2(X+Y) = \sigma^2(X)+\sigma^2(Y).$

This, of course, is assuming that the variables are independent.

To find the standard deviation of the sum of two random variables, first add the variances, and then take the square root.

If $$X$$ and $$Y$$ are two independent random variables, then:

$\sigma(X+Y) = \sqrt{ \sigma^2(X)+\sigma^2(Y)}$

## Multivariate Transformation of Random Variables

When working with higher-level statistics, you might come across more elaborated transformations involving several random variables. These transformations will not only involve sums and multiplications but will involve functions and derivatives as well!

These types of transformations are usually analyzed using methods from calculus and more advanced statistics, so this will remain out of the scope of this article.

## Examples of Transformation of Random Variables

Typically, you will be asked to find means and standard deviations when transforming random variables. Here are some examples.

The average height of the members of the theater club is $$67$$ inches.

1. Suppose that everyone needs to wear stilts for a school play. The stilts increase the height of the wearer by $$10$$ inches. What is the average height of the theater club when everyone is wearing stilts?
2. Will the standard deviation of the height of the theater club change if everyone is wearing their stilts?

Solution:

1. In this case, the random variable $$X$$ represents the height of a member of the theater club. You are being told that the average height is $$67$$ inches, which corresponds to the mean height of the theater club. By wearing stilts, everyone becomes $$10$$ inches taller, so$X+10$is the height of a person in the theater club that is wearing stilts. You are adding $$10$$ to the random variable $$X$$, so the new mean can be found by adding $$10$$ to the original mean as well. This means that\begin{align} \mu(X+10) &= \mu(X)+10 \\ &= 67+10 \\ &=77 \end{align}is the average height of the theater club when everyone is wearing their stilts.
2. You just found that this situation is being described by the addition of a constant to a random variable. Since the standard deviation does not change when a constant is added to a random variable, you can conclude that the standard deviation of the height of the theater club will not change if everyone wears their stilts.

Statistics are often used in stores for administrative purposes.

The average customer of a store spends $$\ 20$$ on groceries in each visit, with a standard deviation of $$\ 7.25$$.

1. What is the expected income obtained from $$30$$ customers?
2. What is the standard deviation of the income obtained from $$30$$ customers?
3. Suppose the store goes on sale and everything is $$50 \%$$ off. What can you say about the mean income from a client?

Solution:

1. Since each client purchases different stuff, the money spent by a customer can be seen as a random variable. You are told that the average customer spends $$\ 20$$, so$\mu(X)=20.$You are trying to find the expected income from $$30$$ customers, so you can label these as$X_1, X_2, \dots , X_{30}.$

Each client is different! Do not make the mistake of using the same label for everyone.

This means that you need to find the expected value of $$X_1+X_2+\dots+X_{30}$$. Each customer is independent, so you can use the formula for the mean of combined random variables, that is\begin{align} \mu(X_1+X_2+\dots+X_{30}) &= \mu(X_1)+\mu(X_2)+\dots+\mu(X_{30}) \end{align}Each client is expected to spend $$\20$$, so each $$\mu$$ equals $$20$$$\mu(X_1+X_2+\dots+X_{30}) = 20+20+\dots+20.$Since you are adding $$20$$ a total of $$30$$ times, you can just multiply $$20$$ and $$30$$, so$\mu (X_1+X_2+\dots+X_{30}) = 600.$This means that the store can expect about $$\ 600$$ from attending $$30$$ customers.
2. This time you need to find$\sigma(X_1+X_2+\dots+X_{30}).$Whenever you need to find the standard deviation of combined random variables, you first have to find the variance.Just like you did before since each random variable is independent, you can add the variance $$30$$ times, that is\begin{align} \sigma^2(X_1+X_2+\dots+X_{30}) &= \sigma^2(X_1)+\sigma^2(X_2)+\dots+\sigma^2(X_{30}) \\ &= 7.25^2+7.25^2+\dots+7.25^2 \\ &= 30(7.25^2) \\ &= 1576.875.\end{align}Finally, find the standard deviation by taking the square root of the variance, so\begin{align} \sigma(X_1+X_2+\dots+X_{30}) &= \sqrt{1576.875} \\ &= 39.7\end{align}
3. While it is true that having a $$50\%$$ discount is the same as multiplying every price by $$0.5$$, which in turn means that you can use the formula$\mu(kX) = k \, \mu(X),$you should first think of the scenario for a while.What would you do if you went to your usual store just to find out that everything is way cheaper than usual? You would most likely buy more things! Because of this, further information on consumption habits is needed before assuming that the store will just make half its earnings from the discount. If this were true, no store would ever go on sale!

## Transforming Random Variables - Key takeaways

• Transforming random variables refers to doing operations on random variables and analyzing how these operations affect the possible outcomes.
• When transforming random variables, you typically can:
• Add a constant to a random variable.
• Subtract a constant from a random variable.
• Multiply a random variable by a constant.
• Add or subtract two random variables.
• Let $$X$$ and $$Y$$ be independent random variables and $$k$$ a constant. The mean $$\mu$$ has the following properties:

$\mu (X+k) = \mu (X) + k,$

$\mu (X-k) = \mu (X) - k,$

$\mu (kX) = k \cdot \mu(X),$and$\mu (X+Y) = \mu(X) + \mu(Y).$

• Let $$X$$ be a random variable and $$k$$ a constant. Then the standard deviation $$\sigma$$ of the random variable has the following properties:

$\sigma(X+k) = \sigma(X),$

$\sigma(X-k) = \sigma(X),$

and

$\sigma(kX) = k \, \sigma(X).$

• The variance of two independent random variables is given instead by$\sigma^2(X+Y) = \sigma^2(X)+\sigma^2(Y),$so the standard deviation is$\sigma(X+Y) = \sqrt{\sigma^2(X) + \sigma^2(Y)}.$

Transforming random variables refers to doing operations on random variables and analyzing how these operations affect the possible outcomes.

The usual transformation of random variables are the following:

• Add a constant to a random variable.
• Subtract a constant from a random variable.
• Multiply a random variable by a constant.
• Add or subtract two random variables.

Transforming random variables also transform the mean and the standard deviation. The formulas all depend on what type of transformation you are doing.

An example of transformation of random variables is adding a constant to a random variable. This can happen whenever you need to consider adding a value to a whole data set, for example, adding tips to the bills in a restaurant.

Random variables are transformed in order to take more factors into account when studying a data set. For example, the revenue obtained from certain sales can be transformed by taking discounts into account.

## Final Transforming Random Variables Quiz

Question

True/False: Adding a constant to a random variable modifies its mean.

True.

Show question

Question

True/False: Adding a constant to a random variable modifies its standard deviation.

False.

Show question

Question

Suppose you multiply a random variable $$X$$ by a constant $$k$$. What is the value of $$\mu(kX)$$?

$$k\,\mu(X)$$.

Show question

Question

Suppose you multiply a random variable $$X$$ by a constant $$k$$. What is the value of $$\sigma^2(kX)$$?

$$k^2\sigma^2(X)$$.

Show question

Question

Suppose you multiply a random variable $$X$$ by a constant $$k$$. What is the value of $$\sigma(kX)$$?

$$k\,\sigma(X)$$.

Show question

Question

Whenever you are transforming random variables, it is assumed that you are working with ____.

quantitative variables.

Show question

Question

Let $$X$$ and $$Y$$ be two random variables. Which of the following expressions is used to find $$\sigma(X+Y)$$?

$$\sqrt{\sigma^2(X)+\sigma^2(Y)}$$.

Show question

Question

It is known that doing the laundry might shrink some clothes. Let $$X$$ represent the length of an individual sock. Which transformation would you use to model this scenario?

Multiply $$X$$ by a constant.

Show question

Question

Let $$X$$ represent the price of a random pair of shoes in a shoes store. You remember that you have a coupon for $$\ 5$$ off in your next buy. Which transformation would you use to model the new price of the shoes?

Subtract a constant from $$X$$.

Show question

Question

Let $$X$$ represent the price of a random item in a retail store. You remember that you have a coupon for $$10 \%$$ off in your next buy. Which transformation would you use to model the new price of the item?

Multiply $$X$$ by a constant.

Show question

Question

A manager in a restaurant wants to find how much an average client spends in total for a meal, considering tips as well.  In this case you can describe the tip as ____.

a constant.

Show question

60%

of the users don't pass the Transforming Random Variables quiz! Will you pass the quiz?

Start Quiz

## Study Plan

Be perfectly prepared on time with an individual plan.

## Quizzes

Test your knowledge with gamified quizzes.

## Flashcards

Create and find flashcards in record time.

## Notes

Create beautiful notes faster than ever before.

## Study Sets

Have all your study materials in one place.

## Documents

Upload unlimited documents and save them online.

## Study Analytics

Identify your study strength and weaknesses.

## Weekly Goals

Set individual study goals and earn points reaching them.

## Smart Reminders

Stop procrastinating with our study reminders.

## Rewards

Earn points, unlock badges and level up while studying.

## Magic Marker

Create flashcards in notes completely automatically.

## Smart Formatting

Create the most beautiful study materials using our templates.