Theory of Statistics 1
MAR 2026

Distributions of Functions of Discrete R.V.s (Univariate)

Univariate Transformations, 1-to-1 mappings, and Summation Methods

Transformations of Discrete Variables

Often in statistics, we know the probability distribution of a random variable XX, but we are actually interested in the distribution of some function of XX, say Y=g(X)Y = g(X). We want to determine the probability distribution of YY.

X
0.20
1
0.20
2
0.20
3
0.20
4
0.20
5
Y = g(X)
0.20
3
0.20
4
0.20
5
0.20
6
0.20
7
Theorem Applied
fY(y)=fX(g1(y))=fX(y2) f_Y(y) = f_X(g^{-1}(y)) = f_X(y - 2)
Hover over the X distribution to trace the mapping.
Part I

One-to-One Transformations

Definition Theorem 1 (One-to-One Mapping)

Let XX be a discrete random variable with probability function fX(x)f_X(x) and space DXD_X, and let Y=g(X)Y = g(X) be a one-to-one transformation.

The space of YY is DY={g(x):xDX}D_Y = \{g(x) : x \in D_X\}.

Then the p.m.f. of YY is:

fY(y)=P(Y=y)=P(g(X)=y)=P(X=g1(y))=fX(g1(y))f_Y(y) = P(Y = y) = P(g(X) = y) = P(X = g^{-1}(y)) = f_X(g^{-1}(y))

where g1g^{-1} is the Inverse Function.

Example 1

Let XX be a r.v. with the following probability distribution:

xx22446688\sum
fX(x)f_X(x)1/81/81/81/81/41/41/21/211

Let Y=3XY = 3X. Find the probability distribution of YY.

Solution

The transformation is y=3xy = 3x, which is one-to-one. The inverse is x=y/3x = y/3. The new space is DY={6,12,18,24}D_Y = \{6, 12, 18, 24\}.

Using the theorem fY(y)=fX(y/3)f_Y(y) = f_X(y/3), the distribution is:

yy66121218182424\sum
fY(y)f_Y(y)1/81/81/81/81/41/41/21/211

One-to-One Transformation

Slide the parameter to scale the distribution linearly.

Y = cX3
0.00.10.20.30.40.5-505101520250.1250.1250.250.5
Notice how the shape of the PMF remains identical, just horizontally spaced. fY(y)=fX(y/3)f_Y(y) = f_X(y / 3)

Example 2

Let XPoi(λ)X \sim Poi(\lambda). fX(x)=eλλxx!,x=0,1,2,f_X(x) = \frac{e^{-\lambda} \lambda^x}{x!}, \quad x = 0, 1, 2, \dots

Find the p.m.f. of Y=4XY = 4X.

Solution

The transformation y=4xy = 4x is one-to-one. The inverse is x=y/4x = y/4. The space of YY is DY={0,4,8,12,}D_Y = \{0, 4, 8, 12, \dots\}.

fY(y)=fX(y/4)=eλλy/4(y/4)!,y=0,4,8,f_Y(y) = f_X(y/4) = \frac{e^{-\lambda} \lambda^{y/4}}{(y/4)!}, \quad y = 0, 4, 8, \dots

X
0.14
0
0.27
1
0.27
2
0.18
3
4
5
6
Y = g(X)
0.14
0
0.27
4
0.27
8
0.18
12
16
20
24
Theorem Applied
fY(y)=fX(g1(y))=fX(y/4) f_Y(y) = f_X(g^{-1}(y)) = f_X(y / 4)
Hover over the X distribution to trace the mapping.

Example 3

Let XX have the following p.m.f.: fX(x)=(3x)(23)x(13)3x,x=0,1,2,3f_X(x) = \binom{3}{x} \left(\frac{2}{3}\right)^x \left(\frac{1}{3}\right)^{3-x}, \quad x = 0, 1, 2, 3

Find the p.m.f. of Y=X2Y = X^2.

Solution

Since the space of XX is non-negative (DX={0,1,2,3}D_X = \{0, 1, 2, 3\}), the transformation y=x2y = x^2 is one-to-one over this support. The inverse is x=yx = \sqrt{y}. The space of YY is DY={0,1,4,9}D_Y = \{0, 1, 4, 9\}.

fY(y)=fX(y)=(3y)(23)y(13)3y,y=0,1,4,9f_Y(y) = f_X(\sqrt{y}) = \binom{3}{\sqrt{y}} \left(\frac{2}{3}\right)^{\sqrt{y}} \left(\frac{1}{3}\right)^{3-\sqrt{y}}, \quad y = 0, 1, 4, 9

X
0
0.22
1
0.44
2
0.30
3
Y = g(X)
0
0.22
1
0.44
4
0.30
9
Theorem Applied
fY(y)=xg1(y)fX(x) f_Y(y) = \sum_{x \in g^{-1}(y)} f_X(x)
Hover over the X distribution to trace the mapping.

Example 4 (Homework)

Consider a sequence of independent flips of a fair coin. Let XX be the number of flips needed to obtain the 1st head. Let YY be the number of flips before the 1st head. Find the p.m.f. of YY.

Solution

XX follows a Geometric distribution with p=1/2p=1/2. The number of flips before the first head is Y=X1Y = X - 1. The transformation is y=x1y = x - 1, which is one-to-one. The inverse is x=y+1x = y + 1. The space of XX is DX={1,2,3,}D_X = \{1, 2, 3, \dots\}. Thus, the space of YY is DY={0,1,2,}D_Y = \{0, 1, 2, \dots\}.

The p.m.f. of XX is fX(x)=(1/2)x1(1/2)=(1/2)xf_X(x) = (1/2)^{x-1}(1/2) = (1/2)^x. fY(y)=fX(y+1)=(12)y+1,y=0,1,2,f_Y(y) = f_X(y + 1) = \left(\frac{1}{2}\right)^{y+1}, \quad y = 0, 1, 2, \dots

X
0.50
1
0.25
2
0.13
3
4
5
6
7
Y = g(X)
0.50
0
0.25
1
0.13
2
3
4
5
6
Theorem Applied
fY(y)=fX(g1(y))=fX(y+1) f_Y(y) = f_X(g^{-1}(y)) = f_X(y + 1)
Hover over the X distribution to trace the mapping.
Part II

Many-to-One Transformations

In general, if the transformation Y=g(X)Y = g(X) is not one-to-one. In particular, if a given value of YY, say yy, corresponds to more than one value of XX, say x1,x2,,xKx_1, x_2, \dots, x_K. Then:

Theorem 2 (Many-to-One Mapping Derivation)
fY(y)\displaystyle f_Y(y)
=P(Y=y)=P(X=x1 or X=x2 or  or X=xK)\displaystyle = P(Y = y) = P(X = x_1 \text{ or } X = x_2 \text{ or } \dots \text{ or } X = x_K)
=P(X=x1)+P(X=x2)++P(X=xK)\displaystyle = P(X = x_1) + P(X = x_2) + \dots + P(X = x_K)
=P(X=g11(y))+P(X=g21(y))++P(X=gK1(y))\displaystyle = P(X = g_1^{-1}(y)) + P(X = g_2^{-1}(y)) + \dots + P(X = g_K^{-1}(y))
=fX(g11(y))+fX(g21(y))++fX(gK1(y))\displaystyle = f_X(g_1^{-1}(y)) + f_X(g_2^{-1}(y)) + \dots + f_X(g_K^{-1}(y))
=i=1KfX(gi1(y))\displaystyle = \sum_{i=1}^K f_X(g_i^{-1}(y))

Example 1

Consider the following probability distribution of XX:

xx2-21-100112233
fX(x)f_X(x)0.10.10.150.150.20.20.30.30.150.150.10.1

Find the probability distribution of Y=X2Y = X^2.

Solution

The space of YY is DY={0,1,4,9}D_Y = \{0, 1, 4, 9\}. We sum the probabilities for each yDYy \in D_Y:

  • fY(0)=fX(0)=0.2f_Y(0) = f_X(0) = 0.2
  • fY(1)=fX(1)+fX(1)=0.15+0.3=0.45f_Y(1) = f_X(-1) + f_X(1) = 0.15 + 0.3 = 0.45
  • fY(4)=fX(2)+fX(2)=0.1+0.15=0.25f_Y(4) = f_X(-2) + f_X(2) = 0.1 + 0.15 = 0.25
  • fY(9)=fX(3)=0.1f_Y(9) = f_X(3) = 0.1

Many-to-One Transformation

Fold the distribution mathematically to see probabilities sum together.

Y = X²
0.00.10.20.30.40.5-5-4-3-2-10123456789100.10.150.20.30.150.1
Notice how the red (X<0X \lt 0) and blue/purple (X>0X \gt 0) masses stack at the same YY coordinate. fY(y)=x2=yfX(x)f_Y(y) = \sum_{x^2=y} f_X(x)

Example 2

Let fX(x)=(1/2)x,x=1,2,3,f_X(x) = (1/2)^x, \quad x = 1, 2, 3, \dots

Find the p.m.f. of: a) Y={1,if X is odd1,if X is evenY = \begin{cases} -1, & \text{if } X \text{ is odd} \\ 1, & \text{if } X \text{ is even} \end{cases}

b) Z=(X2)2Z = (X - 2)^2

Solution

Part (a) The possible values for YY are DY={1,1}D_Y = \{-1, 1\}.

  • fY(1)=P(X is odd)=fX(1)+fX(3)+fX(5)+=12+18+132+=1/211/4=23f_Y(-1) = P(X \text{ is odd}) = f_X(1) + f_X(3) + f_X(5) + \dots = \frac{1}{2} + \frac{1}{8} + \frac{1}{32} + \dots = \frac{1/2}{1 - 1/4} = \frac{2}{3}
  • fY(1)=P(X is even)=fX(2)+fX(4)+fX(6)+=14+116+164+=1/411/4=13f_Y(1) = P(X \text{ is even}) = f_X(2) + f_X(4) + f_X(6) + \dots = \frac{1}{4} + \frac{1}{16} + \frac{1}{64} + \dots = \frac{1/4}{1 - 1/4} = \frac{1}{3}

Part (b) The possible values for ZZ based on X{1,2,3,4,}X \in \{1, 2, 3, 4, \dots\} are z=(x2)2{1,0,1,4,9,}z = (x-2)^2 \in \{1, 0, 1, 4, 9, \dots\}. The space is DZ={0,1,4,9,16,}D_Z = \{0, 1, 4, 9, 16, \dots\}.

  • fZ(0)=fX(2)=(1/2)2=1/4f_Z(0) = f_X(2) = (1/2)^2 = 1/4
  • fZ(1)=fX(1)+fX(3)=1/2+1/8=5/8f_Z(1) = f_X(1) + f_X(3) = 1/2 + 1/8 = 5/8
  • For z4z \ge 4, there is only one value of xx that maps to zz (since x4x \ge 4). The inverse is x=2+zx = 2 + \sqrt{z}. fZ(z)=fX(2+z)=(1/2)2+z,z{4,9,16,}f_Z(z) = f_X(2 + \sqrt{z}) = (1/2)^{2+\sqrt{z}}, \quad z \in \{4, 9, 16, \dots\}