# Functions of a Discrete Random Variable

• Jun 26th 2012, 11:45 PM
usagi_killer
Functions of a Discrete Random Variable
Hi there,

I just wanna verify my solution to this:

Let $X$ be a Discrete Uniform random variable over the interval $[-n, n], n \ge 1$. What is the distribution of $|X|$?

The PMF of the Discrete Uniform RV is given by: $p_X(x) = \frac{1}{n-m+1}, x \in [m, n]$

Let $Y$ be the RV such that $Y = |X|$

Thus $p_Y(y) = \sum_{\{x | |x| = y\}}p_X(x)$

Note that in this case $x \in [-n, n]$, thus $p_X(x) = \frac{1}{2n+1}$

$p_Y(0) = \sum_{\{x | |x| = 0\}}p_X(x) = \sum_{\{x | x = 0\}}p_X(x) = \frac{1}{2n+1}$ since $0 \in [-n, n]$ as $n \ge 1$

$p_Y(1) = \sum_{\{x | |x| = 1\}}p_X(x) = \sum_{\{x | x = -1, 1\}}p_X(x) = p_X(-1) + p_X(1) = \frac{2}{2n+1}$

$p_Y(2) = \sum_{\{x | |x| = 1\}}p_X(x) = \sum_{\{x | x = -2, 2\}}p_X(x) = p_X(-2) + p_X(2) = \frac{2}{2n+1}$

$p_Y(n) = \sum_{\{x | |x| = 1\}}p_X(x) = \sum_{\{x | x = -n, n\}}p_X(x) = p_X(-n) + p_X(n) = \frac{2}{2n+1}$

Thus the PMF of $Y = |X|$ is given by:

$p_Y(y) = \frac{1}{2n+1}$ if $y = 0$ and $p_Y(y) = \frac{2}{2n+1}$ if $y = 1, 2, \cdots, n$

Thanks :)
• Jun 27th 2012, 02:28 AM
PandaBambu
Re: Functions of a Discrete Random Variable
Correct indeed