Problem

Let $X$ have a probability density function

$$ f_X(x) = \begin{cases} 1/4 & 0 < x < 1 \\ 3/8 & 3 < x < 5 \\ 0 & \text{otherwise} \end{cases} $$

(a) Find the cumulative distribution function of $X$.

(b) Let $Y = 1/X$. Find the probability density function $f_y(y)$ for $Y$. Hint: Consider three cases:

  • $1/5 \leq y \leq 1/3$
  • $1/3 \leq y \leq 1$
  • $y \geq 1$.

Solution

(a)

To find the CDF $F_X(x)$ we need to integrate the pdf: $\int_{-\infty}^{x}f_x(x)dx$.

$$ F_X(x) = \begin{cases} 0 & x \leq 0 \\ \frac{x}{4} & 0 < x \leq 1 \\ \frac{1}{4} & 1 < x \leq 3 \\ \frac{1}{4} + \frac{3}{8}(x - 3) & 3 < x \leq 5 \\ 1 & x > 5 \end{cases} $$

(b)

To express $f_Y(y)$ in terms of $X$, we need a way to express $F_Y(y)$ in terms of $F_X(x)$ and then differentiate it back to get $f_Y(y)$.

$F_Y(y) = P(Y \leq y)$ = $P(\frac{1}{X} \leq y)$ = $P(\frac{1}{y} < X)$ = $1 - P(X \leq \frac{1}{y})$
= $1 - F_X(\frac{1}{y})$.

Let's first plug in $\frac{1}{y}$ to $F_X(x)$ to get $F_X(\frac{1}{y})$

$$ F_X(\frac{1}{y}) = \begin{cases} 0 & \frac{1}{y} \leq 0 \\ \frac{1}{4y} & 0 < \frac{1}{y} \leq 1 \\ \frac{1}{4} & 1 < \frac{1}{y} \leq 3 \\ \frac{1}{4} + \frac{3}{8}(\frac{1}{y} - 3) & 3 < \frac{1}{y} \leq 5 \\ 1 & \frac{1}{y} > 5 \end{cases} $$

$\frac{1}{4} + \frac{3}{8}(\frac{1}{y} - 3)$ simplifies to $\frac{3}{8y} - \frac{7}{8}$

leaving us with

$$ F_X(\frac{1}{y}) = \begin{cases} 0 & \frac{1}{y} \leq 0 \\ \frac{1}{4y} & 0 < \frac{1}{y} \leq 1 \\ \frac{1}{4} & 1 < \frac{1}{y} \leq 3 \\ \frac{3}{8y} - \frac{7}{8} & 3 < \frac{1}{y} \leq 5 \\ 1 & \frac{1}{y} > 5 \end{cases} $$

Given that $F_Y(y) = 1 - F_X(\frac{1}{y})$, we get:

$$ F_Y(y) = \begin{cases} 1 & \frac{1}{y} \leq 0 \\ 1 - \frac{1}{4y} & 0 < \frac{1}{y} \leq 1 \\ \frac{3}{4} & 1 < \frac{1}{y} \leq 3 \\ 1 - (\frac{3}{8y} - \frac{7}{8}) & 3 < \frac{1}{y} \leq 5 \\ 0 & \frac{1}{y} > 5 \end{cases} $$

simplifying to

$$ F_Y(y) = \begin{cases} 1 & \frac{1}{y} \leq 0 \\ 1 - \frac{1}{4y} & 0 < \frac{1}{y} \leq 1 \\ \frac{3}{4} & 1 < \frac{1}{y} \leq 3 \\ \frac{15}{8} - \frac{3}{8y} & 3 < \frac{1}{y} \leq 5 \\ 0 & \frac{1}{y} > 5 \end{cases} $$

We can flip the inequalities and invert both sides (including $\frac{1}{y}$ to $y$) yielding:

$$ F_Y(y) = \begin{cases} 1 & y > \infty \\ 1 - \frac{1}{4y} & 1 \leq y < \infty \\ \frac{3}{4} & \frac{1}{3} \leq y < 1 \\ \frac{15}{8} - \frac{3}{8y} & \frac{1}{5} \leq y < \frac{1}{3} \\ 0 & y \leq \frac{1}{5} \end{cases} $$

We can lose the $y > \infty$ case, and $1 \leq y < \infty$ can be expressed as $y > 1$. If we order the cases appropriately we are finally left with:

$$ F_Y(y) = \begin{cases} 0 & y < \frac{1}{5} \\ \frac{15}{8} - \frac{3}{8y} & \frac{1}{5} \leq y < \frac{1}{3} \\ \frac{3}{4} & \frac{1}{3} \leq y < 1 \\ 1 - \frac{1}{4y} & y \geq 1 \end{cases} $$

Finally, we can get $f_Y(y) = \frac{d}{dy} F_y(y) dy$

$$ f_Y(y) = \begin{cases} \frac{3}{8y^2} & \frac{1}{5} \leq y < \frac{1}{3} \\ \frac{1}{4y^2} & y \geq 1 \end{cases} $$