The Central Idea

If \(X\) is a random variable and \(g\) is a function, then

\[ \boxed{Y=g(X)} \]

defines a new random variable.

The values of \(Y\) are determined by applying \(g\) to the possible values of \(X\).

Why Transform Random Variables?

Transformations arise naturally when we:

Linear Transformations

The simplest and most important transformation is

\[ \boxed{Y=aX+b}. \]

The constant \(a\) rescales the random variable, while \(b\) shifts it.

Effect on Expected Value

By linearity of expectation,

\[ \boxed{ \mathbb{E}[aX+b] = a\mathbb{E}[X]+b }. \]

Multiplying \(X\) by \(a\) multiplies the mean by \(a\). Adding \(b\) shifts the mean by \(b\).

Effect on Variance

For

\[ Y=aX+b, \]

the variance is

\[ \boxed{ \operatorname{Var}(Y) = a^2\operatorname{Var}(X) }. \]

The added constant \(b\) does not affect spread.

Effect on Standard Deviation

Since standard deviation is the square root of variance,

\[ \boxed{ \sigma_Y=|a|\sigma_X }. \]

The absolute value is required because standard deviation is nonnegative.

Example: Unit Conversion

Suppose \(X\) is a temperature in degrees Celsius and

\[ Y=\frac95X+32 \]

is the temperature in degrees Fahrenheit.

If

\[ \mathbb{E}[X]=20, \]

then

\[ \mathbb{E}[Y] = \frac95(20)+32 = \boxed{68}. \]

Variance Under the Temperature Conversion

If

\[ \operatorname{Var}(X)=25, \]

then

\[ \operatorname{Var}(Y) = \left(\frac95\right)^2(25) = \frac{81}{25}(25) = \boxed{81}. \]

Therefore,

\[ \boxed{\sigma_Y=9}. \]

Standardization as a Transformation

Standardization is a special linear transformation:

\[ \boxed{ Z=\frac{X-\mu}{\sigma} }. \]

If \(X\) has mean \(\mu\) and positive standard deviation \(\sigma\), then

\[ \mathbb{E}[Z]=0 \]

and

\[ \operatorname{Var}(Z)=1. \]

Why Standardization Works

Using linearity,

\[ \mathbb{E}[Z] = \frac{\mathbb{E}[X]-\mu}{\sigma} = 0. \]

For the variance,

\[ \operatorname{Var}(Z) = \frac{1}{\sigma^2} \operatorname{Var}(X) = 1. \]

Transforming a Discrete Random Variable

If \(X\) is discrete and

\[ Y=g(X), \]

then the probability of a value \(y\) is obtained by adding the probabilities of all \(x\)-values that map to \(y\):

\[ \boxed{ P(Y=y) = \sum_{x:g(x)=y} P(X=x) }. \]

Example: A One-to-One Discrete Transformation

Suppose

\[ P(X=0)=0.2,\qquad P(X=1)=0.5,\qquad P(X=2)=0.3. \]

Define

\[ Y=2X+1. \]

Then the possible values of \(Y\) are

\[ 1,3,5. \]

Transformed PMF in the One-to-One Example

Since the transformation is one-to-one,

\[ P(Y=1)=P(X=0)=0.2, \] \[ P(Y=3)=P(X=1)=0.5, \]

and

\[ P(Y=5)=P(X=2)=0.3. \]

The probabilities move to new locations but retain their original masses.

Many-to-One Discrete Transformations

A transformation may send several \(x\)-values to the same \(y\)-value.

In that case, their probabilities must be combined.

Example: Squaring a Discrete Variable

Suppose

\[ P(X=-2)=0.2,\qquad P(X=-1)=0.3,\qquad P(X=1)=0.1,\qquad P(X=2)=0.4. \]

Define

\[ Y=X^2. \]

Then \(Y\) can equal \(1\) or \(4\).

Combine Probabilities After Squaring

Since both \(X=-1\) and \(X=1\) map to \(Y=1\),

\[ P(Y=1) = 0.3+0.1 = 0.4. \]

Likewise,

\[ P(Y=4) = 0.2+0.4 = 0.6. \]

Therefore,

\[ \boxed{ P(Y=1)=0.4,\qquad P(Y=4)=0.6 }. \]

Expected Value of a Transformation

For a discrete random variable,

\[ \boxed{ \mathbb{E}[g(X)] = \sum_x g(x)P(X=x) }. \]

For a continuous random variable,

\[ \boxed{ \mathbb{E}[g(X)] = \int_{-\infty}^{\infty} g(x)f_X(x)\,dx }. \]

We often do not need the full transformed distribution to compute the transformed expectation.

Example: Expected Square Without Finding the New PMF

Suppose

\[ P(X=1)=0.4,\qquad P(X=3)=0.6. \]

Then

\[ \mathbb{E}[X^2] = 1^2(0.4)+3^2(0.6). \] \[ = 0.4+5.4 = \boxed{5.8}. \]

Nonlinear Transformations Need Care

In general,

\[ \boxed{ \mathbb{E}[g(X)] \ne g(\mathbb{E}[X]) } \]

for nonlinear \(g\).

For example,

\[ \mathbb{E}[X^2] \]

is generally not equal to

\[ (\mathbb{E}[X])^2. \]

Continuous Transformations

If \(X\) is continuous and

\[ Y=g(X), \]

then finding the density of \(Y\) requires accounting for how the transformation stretches or compresses intervals.

Monotone Transformations

Suppose \(g\) is one-to-one and differentiable on the support of \(X\).

If

\[ y=g(x), \]

and the inverse transformation is

\[ x=g^{-1}(y), \]

then the density of \(Y\) is

\[ \boxed{ f_Y(y) = f_X(g^{-1}(y)) \left| \frac{d}{dy}g^{-1}(y) \right| }. \]

Why the Derivative Factor Appears

A transformation changes interval lengths.

Probability must be preserved:

\[ f_X(x)\,dx \approx f_Y(y)\,dy. \]

Therefore,

\[ f_Y(y) = f_X(x) \left| \frac{dx}{dy} \right|. \]

The derivative corrects for stretching or compression.

Example: Linear Continuous Transformation

Let

\[ X\sim\operatorname{Uniform}(0,1) \]

and define

\[ Y=2X. \]

The inverse is

\[ X=\frac{Y}{2}. \]

Also,

\[ \left|\frac{dx}{dy}\right| = \frac12. \]

Complete the Density Transformation

Since

\[ f_X(x)=1 \]

on \(0\le x\le1\),

\[ f_Y(y) = 1\left(\frac12\right) = \frac12 \]

on

\[ 0\le y\le2. \]

Therefore,

\[ \boxed{ Y\sim\operatorname{Uniform}(0,2) }. \]

Transformation Through the CDF

Another method is to derive the CDF of \(Y\):

\[ F_Y(y)=P(Y\le y). \]

Then rewrite the event in terms of \(X\), simplify using the CDF of \(X\), and differentiate if a density is required.

Example: Increasing Transformation

Suppose

\[ Y=3X+2. \]

Then

\[ F_Y(y) = P(3X+2\le y). \]

Since the transformation is increasing,

\[ F_Y(y) = P\left( X\le\frac{y-2}{3} \right). \]

Therefore,

\[ \boxed{ F_Y(y) = F_X\left(\frac{y-2}{3}\right) }. \]

Decreasing Transformations Reverse Inequalities

Suppose

\[ Y=-X. \]

Then

\[ Y\le y \]

means

\[ -X\le y. \]

Multiplying by \(-1\) reverses the inequality:

\[ X\ge -y. \]

This reversal must be handled carefully in CDF transformations.

Absolute-Value Transformations

If

\[ Y=|X|, \]

then both \(X=y\) and \(X=-y\) may contribute to the same value of \(Y\).

For continuous \(X\), under suitable conditions,

\[ \boxed{ f_Y(y)=f_X(y)+f_X(-y) } \]

for \(y>0\).

Squaring a Continuous Variable

If

\[ Y=X^2, \]

then for \(y>0\), both

\[ X=\sqrt y \]

and

\[ X=-\sqrt y \]

may contribute.

Non-one-to-one transformations require summing contributions from all inverse branches.

General Many-to-One Density Formula

If the equation

\[ y=g(x) \]

has inverse branches

\[ x_1(y),x_2(y),\ldots, \]

then under suitable regularity conditions,

\[ \boxed{ f_Y(y) = \sum_i f_X(x_i(y)) \left| \frac{dx_i}{dy} \right| }. \]

Sums of Random Variables

A common transformation involving multiple random variables is

\[ S=X+Y. \]

The distribution of a sum depends on the joint behavior of \(X\) and \(Y\).

Mean of a Sum

Regardless of dependence,

\[ \boxed{ \mathbb{E}[X+Y] = \mathbb{E}[X]+\mathbb{E}[Y] }. \]

Linearity of expectation does not require independence.

Variance of a Sum

In general,

\[ \boxed{ \operatorname{Var}(X+Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) + 2\operatorname{Cov}(X,Y) }. \]

Dependence matters through covariance.

Independent Sums

If \(X\) and \(Y\) are independent, then

\[ \operatorname{Cov}(X,Y)=0. \]

Therefore,

\[ \boxed{ \operatorname{Var}(X+Y) = \operatorname{Var}(X)+\operatorname{Var}(Y) }. \]

Discrete Convolution

If \(X\) and \(Y\) are independent discrete random variables and

\[ S=X+Y, \]

then

\[ \boxed{ P(S=s) = \sum_x P(X=x)P(Y=s-x) }. \]

This summation is called a convolution.

Example: Sum of Two Fair Dice

Let \(X\) and \(Y\) be independent fair six-sided dice.

For

\[ S=X+Y, \]

the probability of \(S=7\) comes from the six ordered pairs

\[ (1,6),(2,5),(3,4),(4,3),(5,2),(6,1). \]

Therefore,

\[ \boxed{ P(S=7)=\frac{6}{36}=\frac16 }. \]

Continuous Convolution

If \(X\) and \(Y\) are independent continuous random variables and

\[ S=X+Y, \]

then

\[ \boxed{ f_S(s) = \int_{-\infty}^{\infty} f_X(x)f_Y(s-x)\,dx }. \]

This is the continuous convolution formula.

Linear Combinations

More generally, consider

\[ Y=a_1X_1+\cdots+a_nX_n+b. \]

Its expected value is

\[ \boxed{ \mathbb{E}[Y] = a_1\mathbb{E}[X_1] +\cdots+ a_n\mathbb{E}[X_n] +b }. \]

Variance of Independent Linear Combinations

If \(X_1,\ldots,X_n\) are independent, then

\[ \boxed{ \operatorname{Var}(Y) = a_1^2\operatorname{Var}(X_1) +\cdots+ a_n^2\operatorname{Var}(X_n) }. \]

Each coefficient is squared because variance measures squared deviations.

Transformations of Normal Random Variables

If

\[ X\sim N(\mu,\sigma^2) \]

and

\[ Y=aX+b, \]

then \(Y\) is also normally distributed:

\[ \boxed{ Y\sim N(a\mu+b,\;a^2\sigma^2) }. \]

Standard Normal as a Transformation

Taking

\[ a=\frac1\sigma \]

and

\[ b=-\frac{\mu}{\sigma} \]

gives

\[ Z=\frac{X-\mu}{\sigma}. \]

Therefore,

\[ \boxed{ Z\sim N(0,1) }. \]

Transformations of Poisson Variables

Scaling a Poisson random variable generally does not produce another ordinary Poisson random variable.

However, sums of independent Poisson variables do preserve the family:

\[ X\sim\operatorname{Poisson}(\lambda_1), \qquad Y\sim\operatorname{Poisson}(\lambda_2) \]

independent implies

\[ \boxed{ X+Y\sim\operatorname{Poisson}(\lambda_1+\lambda_2) }. \]

Transformations of Binomial Variables

If independent binomial variables share the same success probability,

\[ X\sim\operatorname{Binomial}(n_1,p) \]

and

\[ Y\sim\operatorname{Binomial}(n_2,p), \]

then

\[ \boxed{ X+Y \sim \operatorname{Binomial}(n_1+n_2,p) }. \]

Transformations Change Support

The support of \(Y=g(X)\) is obtained by applying \(g\) to the support of \(X\).

For example, if

\[ X\in[0,3] \]

and

\[ Y=2X+1, \]

then

\[ \boxed{Y\in[1,7]}. \]

Increasing and Decreasing Maps

If \(g\) is increasing, order is preserved:

\[ x_1 If \(g\) is decreasing, order reverses.

This distinction matters when transforming CDF inequalities.

Common Error: Transforming the Mean Only

Finding

\[ \mathbb{E}[Y] \]

does not determine the entire distribution of \(Y\).

A transformation can change support, shape, density, and variance in ways that are not captured by the mean alone.

Common Error: Forgetting to Combine Discrete Probabilities

If several \(x\)-values map to the same transformed value \(y\), their probabilities must be added.

This commonly occurs with

\[ Y=X^2 \]

or

\[ Y=|X|. \]

Common Error: Forgetting the Absolute Derivative

For a continuous one-to-one transformation,

\[ f_Y(y) = f_X(g^{-1}(y)) \left| \frac{d}{dy}g^{-1}(y) \right|. \]

The absolute value ensures the density remains nonnegative.

Common Error: Using One Inverse Branch for a Many-to-One Map

If

\[ Y=X^2, \]

then both

\[ X=\sqrt Y \]

and

\[ X=-\sqrt Y \]

may contribute.

Ignoring one branch loses probability.

Common Error: Forgetting to Reverse an Inequality

Multiplying an inequality by a negative number reverses its direction.

This is especially important in CDF transformations involving decreasing functions.

Common Error: Assuming \(\operatorname{Var}(aX+b)=a\operatorname{Var}(X)\)

The correct rule is

\[ \boxed{ \operatorname{Var}(aX+b) = a^2\operatorname{Var}(X) }. \]

Common Error: Assuming Independence for a Sum

The expectation of a sum does not require independence, but the simplified variance formula does.

Without independence,

\[ \operatorname{Var}(X+Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) + 2\operatorname{Cov}(X,Y). \]

A Reliable Procedure for Discrete Transformations

  1. List the possible values of \(X\).
  2. Apply \(g(x)\) to each value.
  3. Identify the resulting support of \(Y\).
  4. Combine probabilities when several \(x\)-values map to the same \(y\).
  5. Check that the transformed PMF sums to \(1\).
  6. Use direct expectation formulas when only \(\mathbb{E}[g(X)]\) is needed.

A Reliable Procedure for Continuous Transformations

  1. Identify the support of \(X\).
  2. Define \(Y=g(X)\).
  3. Determine the support of \(Y\).
  4. If \(g\) is one-to-one, solve \(x=g^{-1}(y)\).
  5. Compute \(\left|dx/dy\right|\).
  6. Substitute into the change-of-variable formula.
  7. If the map is many-to-one, sum over all inverse branches.
  8. Verify that the transformed density integrates to \(1\).

Practice 1: Linear Mean

Suppose

\[ \mathbb{E}[X]=6. \]

If

\[ Y=4X-3, \]

find \(\mathbb{E}[Y]\).

Practice 2: Linear Variance

Suppose

\[ \operatorname{Var}(X)=5. \]

If

\[ Y=-2X+7, \]

find \(\operatorname{Var}(Y)\).

Practice 3: Standardization

Suppose

\[ \mu=50,\qquad \sigma=10. \]

Find the standardized value corresponding to

\[ X=70. \]

Practice 4: Discrete Transformation

Suppose

\[ P(X=-1)=0.4,\qquad P(X=1)=0.6. \]

Define

\[ Y=X^2. \]

Find the distribution of \(Y\).

Practice 5: Expected Transformation

Suppose

\[ P(X=1)=0.25,\qquad P(X=2)=0.75. \]

Find

\[ \mathbb{E}[X^2]. \]

Practice 6: Uniform Scaling

Let

\[ X\sim\operatorname{Uniform}(0,1) \]

and define

\[ Y=5X. \]

Identify the distribution of \(Y\).

Practice 7: Sum Mean

Suppose

\[ \mathbb{E}[X]=3,\qquad \mathbb{E}[Y]=8. \]

Find

\[ \mathbb{E}[X+Y]. \]

Practice 8: Independent Sum Variance

Suppose \(X\) and \(Y\) are independent with

\[ \operatorname{Var}(X)=4,\qquad \operatorname{Var}(Y)=9. \]

Find

\[ \operatorname{Var}(X+Y). \]

Practice 9: Normal Transformation

Suppose

\[ X\sim N(10,4). \]

Define

\[ Y=3X+1. \]

Find the distribution of \(Y\).

Practice 10: Identify the Error

A student claims that

\[ \mathbb{E}[X^2] = (\mathbb{E}[X])^2 \]

for every random variable.

Explain the error.

Practice Answers

Practice 1

\[ \mathbb{E}[Y] = 4\mathbb{E}[X]-3 = 4(6)-3 = \boxed{21}. \]

Practice 2

\[ \operatorname{Var}(Y) = (-2)^2\operatorname{Var}(X) = 4(5) = \boxed{20}. \]

Practice 3

\[ Z = \frac{70-50}{10} = \boxed{2}. \]

Practice 4

Both possible values of \(X\) map to

\[ Y=1. \]

Therefore,

\[ \boxed{P(Y=1)=1}. \]

Practice 5

\[ \mathbb{E}[X^2] = 1^2(0.25)+2^2(0.75). \] \[ = 0.25+3 = \boxed{3.25}. \]

Practice 6

Scaling \([0,1]\) by \(5\) gives \([0,5]\). Therefore,

\[ \boxed{ Y\sim\operatorname{Uniform}(0,5) }. \]

Practice 7

\[ \mathbb{E}[X+Y] = 3+8 = \boxed{11}. \]

Practice 8

Independence allows variances to add:

\[ \operatorname{Var}(X+Y) = 4+9 = \boxed{13}. \]

Practice 9

Since

\[ X\sim N(10,4), \]

we have \(\mu=10\) and \(\sigma^2=4\).

Then

\[ \mathbb{E}[Y] = 3(10)+1 = 31, \]

and

\[ \operatorname{Var}(Y) = 3^2(4) = 36. \]

Therefore,

\[ \boxed{ Y\sim N(31,36) }. \]

Practice 10

Squaring is nonlinear, so expectation does not generally commute with the transformation. In fact,

\[ \operatorname{Var}(X) = \mathbb{E}[X^2] - (\mathbb{E}[X])^2. \]

Equality holds only in special cases, such as when the variance is zero.

What to Remember

A transformed random variable has the form

\[ \boxed{Y=g(X)}. \]

For a linear transformation,

\[ \boxed{ \mathbb{E}[aX+b] = a\mathbb{E}[X]+b } \]

and

\[ \boxed{ \operatorname{Var}(aX+b) = a^2\operatorname{Var}(X) }. \]

For discrete variables,

\[ \boxed{ P(Y=y) = \sum_{x:g(x)=y}P(X=x) }. \]

For a one-to-one continuous transformation,

\[ \boxed{ f_Y(y) = f_X(g^{-1}(y)) \left| \frac{d}{dy}g^{-1}(y) \right| }. \]

For independent sums,

\[ \boxed{ \operatorname{Var}(X+Y) = \operatorname{Var}(X)+\operatorname{Var}(Y) }. \]

The central interpretation is: transforming a random variable changes the values it can take and may change its distributional shape, but expectation, variance, and density transformations follow precise structural rules.

Where We Go Next

Transformations allow us to construct new random quantities from existing ones. The final step in this sequence is to study what happens when many random contributions are combined and averaged.

The next lesson, Law of Large Numbers and Central Limit Theorem, develops two foundational results explaining long-run averages and the emergence of normal behavior in sums and sample means.