## Linear algebra viewpoint of function of discrete random variable

Suppose $X$ is a discrete random variable can take on $n$ values $x_{1} < x_{2} <\ldots with probability $p_{x_{1}},p_{x_{2}},\ldots ,p_{x_{n}}$; and $Y$ is a random variable defined by $Y = g(X)$.

Define a column vector $\lambda_{X} = [p_{x_{1}} \quad p_{x_{2}} \quad \ldots \quad p_{x_{n}}]^{T}$, can be called the probability mass distribution vector (?) of $X$

Define a $n \text{x} n$ matrix $P = \left[ \begin{array}{c} a_{1} \\ a_{2} \\ \ldots \\ a_{n} \end{array}\right]$ with $a_{1},a_{2},\ldots ,a_{n}$ are $1\text{x}n$ row vectors.
$P$ can be called the mapping probability mass matrix (?). The values of $P$ is based on the sample space values $x_{1},x_{2},\ldots ,x_{n}$ and the function $g$.
Then $\lambda_{Y}$ -the probability mass distribution vector of $Y$– can be obtained as followed:
$\lambda_{Y}=P\cdot \lambda_{X}$ $= \left[ \begin{array}{c} a_{1} \\ a_{2} \\ \ldots \\ a_{n} \end{array}\right]$ $\cdot \left[ \begin{array} {cccc} p_{x_{1}} & p_{x_{2}} & \ldots & p_{x_{n}} \end{array}\right] ^{T}$