# Probability Problem - Finding a pdf

Below is a problem I did. However, I did not come up with the answer in book. I am thinking that I might have the wrong limits for the integral. I am hoping somebody can point out what I did wrong.

Bob

Problem

Let $Y = \sin X$, where $X$ is uniformly distributed over $(0, 2 \pi)$. Find the pdf of $Y$.

\begin{eqnarray*} P(Y<=y_0) &=& P( \sin x <= y_0 ) = P( x <= \arcsin( y_0) ) \\ P(Y<=y_0) &=& \int_0^{\arcsin(y_0)} \frac{1}{2 \pi} dx = \frac{x}{2 \pi} \Big|_0^{\arcsin(y_0)} = \frac{\arcsin(y_0)}{2 \pi} - \frac{0}{2 \pi} \\ P(Y<=y_0) &=& \frac{\arcsin(y_0)}{2 \pi} \\ F(Y) &=& \frac{\arcsin(Y)}{2 \pi} \\ f(y) &=& \frac{1}{2 \pi \sqrt{1 - y^2}} \\ \end{eqnarray*} However, the book gets: \begin{eqnarray*} f(y) &=& \frac{1}{\pi \sqrt{1 - y^2}} \\ \end{eqnarray*} I believe that book is right because \begin{eqnarray*} \int_{-1}^{1} \frac{1}{\pi \sqrt{1 - y^2} } dy &=& \frac{\arcsin{y}}{\pi} \Big|_{-1}^{1} = \frac{\frac{\pi}{2}}{\pi} - \frac{-\frac{\pi}{2}}{\pi} \\ \int_{-1}^{1} \frac{1}{\pi \sqrt{1 - y^2} } dy &=& 1 \\ \end{eqnarray*}

• Note that $\arcsin$ is defined only over $\left[-\frac{\pi}{2}, \frac{\pi}{2}\right]$, so writing $P(\sin(x) \leq y_0) = P(X \leq \arcsin(y_0))$ is invalid, since $y_0 \in [-1, 1]$. – Clarinetist Mar 25 '16 at 13:27
• I am still confused. If I had written $sin ^{-1}(y)$ would that have been right? Do I need to write several integrals? – Bob Mar 25 '16 at 13:52

If $X$ is uniform in $(0,2\pi)$, then has cdf $$F_X(x)=\begin{cases} 0 & x\le 0\\ \frac{x}{2\pi} & x\in (0,2\pi)\\ 1 & x\ge 2\pi \end{cases}$$ The random variable $Y=\sin (X)$ takes values on $(-1,1)$. Hence, $\Bbb P(Y\le y) = 0$ for $y \le -1$ and $\Bbb P(Y\le y) = 1$ for $y \ge 1$. Let now $y \in (-1, 1)$. We have $$F_Y(y)=\Bbb P(Y\le y)=\Bbb P(\sin (X)\le y)$$ The equation $\sin(x) = y$ has two solutions in the interval $(0, 2\pi)$:

• $x = \arcsin(y)$ and $\pi-\arcsin(y)$ for $y > 0$
• $x = \pi-\arcsin(y)$ and $2\pi + \arcsin(y)$ for $y < 0$.

Hence, $Y$ has positive values if $X$ takes values in $A_1=(0,\arcsin y)$ or $A_2=(\pi-\arcsin y,2\pi)$; $Y$ has negative values if $X$ takes values in $B=(\pi-\arcsin y,2\pi + \arcsin y)$.

So we have for $-1<y<1$, $$\Bbb P(Y\le y)=\begin{cases} \Bbb P(X\in B)& -1<y< 0\\ \Bbb P(X\in A_1\cup A_2)=\Bbb P(X\in A_1)+\Bbb P(X\in A_2)& 0<y< 1\\ \end{cases}$$ that is $$F_Y(y)=\begin{cases} F_X(2\pi + \arcsin y) -F_X(\pi-\arcsin y)& -1<y< 0\\ F_X(\arcsin y) +1-F_X(\pi-\arcsin y)& 0<y< 1\\ \end{cases}$$ and then $$F_Y(y)=\frac{\pi + 2 \arcsin(y)}{2\pi},\qquad y\in (-1,1)$$

The distribution function of $Y$ is $$F_Y(y)=\begin{cases} 0 & y\le 0\\ \frac{\pi + 2 \arcsin(y)}{2\pi} & y\in (-1,1)\\ 1 & y\ge 1 \end{cases}$$ We differentiate the above expression to obtain the probability density: $$f_Y(y)=\begin{cases} \frac{1}{\pi\sqrt{1-y^2}} & y\in (-1,1)\\ 0 & y\notin (-1,1) \end{cases}$$

• I follow you when you say there are two solutions on the interval for the equation. I do not understand how you come up $F_y(y)$. Please explain it. – Bob Mar 25 '16 at 14:18
• I've added some details. – alexjo Mar 25 '16 at 15:36

your answer is correct indeed just a little mistake. in the first step: $$P(Y \le y) = P( \sin x \le y ) \Rightarrow P(x_1 \le x \le x_2 )$$ as shown in figure below (sorry figure is for $y=sin(x+\theta)$ but still is useful .just draw the figure for $sin(x)$ in your imagination. also figure is from "Probability, Random Variables and Stochastic Processes" by Papoulis A. chapter 5 example 7. which is very similar to your problem).

since $sin(x)$ intersects with each horizontal line two times. so we can now write the right answer as below: $$P(Y \le y)= \frac{1}{2\pi} \int_0^{x_{1}}dx+\frac{1}{2\pi} \int_{x_{2}}^{2\pi}dx$$ and we have in mind that $x_2=\pi-\arcsin(y)=\pi-x_1$ so we get:

$$P(Y \le y)= \frac{1}{2\pi} \int_0^{x_{1}}dx+\frac{1}{2\pi} \int_{x_{2}}^{2\pi}dx = \frac{1}{2\pi}\times (x_{1}+2\pi-x_{2})=\frac{1}{2\pi}\times (x_{1}+\pi+x_{1}) = \frac{1}{2\pi}\times (2x_{1}+\pi)=\frac{1}{2}+\frac{1}{\pi}\arcsin(y)$$

now by taking derivative with respect to $y$ we get: $$f(y) = \frac{1}{\pi \sqrt{1 - y^2}}$$