4

Given $$ f(x) = \begin{cases} \frac12 &,\ -0.5 \le x\le 1.5\\0 &,\ \mbox{otherwise} \end{cases}$$

find the probability density function of $Y=X^2$.

To solve this I first divided up the pdf of X into three parts:

$$f(x) = \begin{cases} \frac12 &, \ -0.5 \le x\le 0\\\frac12 &, \ 0\le x\le 0.5 \\ \frac12 &,\ 0.5 \le x\le 1.5\\ 0 &, \ \mbox{otherwise} \end{cases}$$

Then applying $g^{-1}(y) = -\sqrt{y}$ for $-0.5 \le x \le 0 $ and $g^{-1}(y) = +\sqrt{y}$ for $ 0 \le x \le 0.5 $ and $ 0.5 \le x \le 1.5 $, I get:

$$ g(y) = \begin{cases} \frac{1}{4\sqrt{y}} &,\ 0 \le x \le 0.25\\ \frac{1}{4\sqrt{y}} &, \ 0\le x\le 0.25 \\ \frac{1}{4\sqrt{y}} &, \ 0.25 \le x \le 2.25 \\ 0 &, \ \mbox{otherwise} \end{cases}$$

Summing up the first two cases I get:

$$ g(y) = \begin{cases} \frac{1}{2\sqrt{y}} &, \ 0 \le x \le 0.25 \\ \frac{1}{4\sqrt{y}} &, \ 0.25 \le x \le 2.25\\ 0 &, \ \mbox{otherwise} \end{cases} $$

Could someone confirm whether my solution is correct or not? And whether my argumentation makes sense? Thanks!

NasuSama
  • 3,364
Ben
  • 237

1 Answers1

2

It looks fine. However, for future reference, I highly recommend the following method: find the cdf of $X$, find the cdf of $Y$, differentiate the cdf to get back your pdf for $Y$. The steps for this problem would be as follows:

For $x<.5$, the cdf comes out to zero, and for $x>1.5$, it comes out to $1$. For the values in between, we have $$ cdf_x=P(X<x)=\int_{-0.5}^{x}f(x)\,dx=\frac12(x+0.5)=\frac x2 + 0.25 $$ Now for y, we can say $cdf_y=P(X^2<y)=cdf_x(\sqrt{y})-cdf_x(-\sqrt{y})$. Long story short, we end up with $$ cdf_y= \begin{cases} 0 & y<0\\ \sqrt{y} & 0≤y≤0.25\\ 0.25+\frac12 \sqrt{y} & 0.25≤y≤2.25\\ 1 & y≥2.25 \end{cases} $$ Differentiating, we find $$ pdf_y=\frac{d}{dy}cdf_y= \begin{cases} 0 & y<0\\ \frac1{2\sqrt{y}} & 0≤y≤0.25\\ \frac1{4\sqrt{y}} & 0.25≤y≤2.25\\ 0 & y≥2.25 \end{cases} $$ As you found.

(While in this case the work amounted to the same, this is a favorite method of mine because it works when the way in which you should deal with the multiple inverses isn't necessarily obvious).

Ben Grossmann
  • 225,327
  • Could you please explain in more detail how you get from $$cdf_y = cdf_x(\sqrt{y}) - cdf_x (-\sqrt{y})$$ to $$cdf_y = \begin{cases} 0 &, y < 0 \ \sqrt{y} &, 0 \le y \le 0.25\ 0.25 + \frac12 \sqrt{y} &, 0.25\le y \le 2.25\ 1 &, y \ge 2.25 \end{cases}$$ ? – Ben Jun 14 '13 at 09:02
  • So for $y<0$, it is just a matter of saying that $X^2$ will never be less than $y$ (since technically speaking the $\sqrt y$ trick doesn't work). For the last range, again, common sense prevails, though you could verify that $cdf_x(\sqrt{y})=1$ and $cdf_x(-\sqrt{y})=0$. By the way, I put the wrong sign in for $cdf_x$ before, see the current version. – Ben Grossmann Jun 14 '13 at 14:58
  • As for the middle bit: from $0$ to $0.25$, the expression $cdf_x(\sqrt y)-cdf_x(-\sqrt y)$ becomes $[\sqrt y/2+0.5]-[-\sqrt y/2 + 0.5]$, which simplifies to $\sqrt y$ as shown. For values from $0.25$ to $2.25$, $cdf_x(-\sqrt y)$ is zero, leaving you with only the term on the left. – Ben Grossmann Jun 14 '13 at 15:03