# discrete random variables transformation

I have two discrete random variables $X$ and $Y$, let $P_X$ and $P_Y$ be the PMF of the random variables, if $Y=X^2$ ,I want to know the PMF of Y in terms of PMF of X ?

I know how to do it with continuous RVs

$P_Y(y)=((P_X(sqrt(y))+P_X(-sqrt(y)))/(2*sqrt(y))$

is there a difference if X and Y are discrete RVs?

-

If the random variables are discrete, then the probability mass function is given as follows. $$\mathbb{P}_Y(Y = y) = \mathbb{P}_X(X^2 = y) = \begin{cases} \mathbb{P}_X(X = 0) & \text{ if }y=0\\ \mathbb{P}_X \left(X = \sqrt{y} \right) + \mathbb{P}_X \left(X = -\sqrt{y} \right) & \text{ for all }y > 0 \end{cases}$$