# Homework Help: PDF of arccos and arcsin of a uniform random number

Tags:
1. Mar 26, 2014

### thapyhap

1. The problem statement, all variables and given/known data

I want to find the PDF for arccos and arcsin of a uniform random number. Given:

$$Y\sim\mathcal{U}(0,2\pi) \\ X = cos(Y)$$

3. The attempt at a solution

I started with trying to find the CDF:

\begin{align} F_X& = P(X \le x) \\ & = P(cos(Y) \le x) \\ & = P(Y \le arccos(x)) \end{align}

But I'm stuck on the next step. I found a similar walkthrough online for arcsin, but I don't understand the step they take at this point either. Any pointers would be appreciated.

2. Mar 26, 2014

### vela

Staff Emeritus
It's not clear exactly what the problem is here as you've provided contradictory information.

Do you have a random variable X which is uniformly distributed and you are trying to find the PDF of Y=arccos(X)? This is what you wrote in words sounds like.

Or do you have a random variable Y which is uniformly distributed and you are trying to find the PDF of X=cos(Y)? What you wrote in notation suggests this.

3. Mar 26, 2014

### thapyhap

Sorry that it is unclear. I have a random variable Y which is uniformly distributed, and I am interested in the PDF of X, given that:

$$X = cos(Y)$$

Does that clarify?

4. Mar 26, 2014

### vela

Staff Emeritus
Over what range of values is Y distributed?

5. Mar 26, 2014

### thapyhap

Y is uniformly distributed between [0, 2∏)

6. Mar 26, 2014

### vela

Staff Emeritus
Try looking at a plot of x=cos(y) to deduce the PDF for X. If x=-1/2, for example, what portion of the graph would satisfy that? To what interval of y would this correspond to?

7. Mar 26, 2014

### Ray Vickson

The function $\cos(y)$ is strictly decreasing on the y-interval $[0,\pi]$ and strictly increasing on $[\pi,2\pi]$. Therefore, your statement that $P(cos(Y) \leq x) = P(Y \leq \arccos(x))$ may not be true. You need to think about this more carefully.

8. Mar 26, 2014

### pasmith

It is not the case that $\cos(y) \leq x$ if and only if $0 \leq y \leq \arccos(x)$; in fact, since $\cos(y)$ is decreasing on $[0, \pi]$, if $y \leq \arccos(x)$ then $\cos(y) \geq x$.

Remember that $\cos(y) = \cos(2\pi - y)$ but $0 \leq \arccos(x) \leq \pi$ for all $x \in [-1,1]$.

9. Mar 26, 2014

### thapyhap

Thanks for all of your replies. All of your points make sense, but I'm still not sure how to proceed.

It's obvious that:

\begin{align} P(X\le1)&=1 \\ P(X\le0)&=0.5 \\ P(X\le-1)&=0 \\ \end{align}

It's also clear that the CDF will be the same for both sin(Y) and cos(Y) since it does not depend on the phase, only on the range of Y. I have no idea how to calculate, for example, P(X ≤ 0.5). I feel like I'm missing something really obvious.

10. Mar 26, 2014

### vela

Staff Emeritus
Take a look at this plot (which is of sine, not cosine, but it's the same idea). Does this help? The red portion of the domain corresponds to the green part of the graph. I plotted it in units of $\pi$ on the horizontal axis.

#### Attached Files:

• ###### plot.png
File size:
4 KB
Views:
145
11. Mar 26, 2014

### thapyhap

I'm not sure- I still feel like I'm missing something simple. Looking at the sin plot I can see a geometric solution as follows:

$$A_1=y(\pi-2\sin^{-1}y)$$

\begin{align} A_2&=2\int^{\sin^{-1}y}_0 \sin x \,dx \\ &=2\left[ \cos 0 - \cos(\sin^{-1} y) \right] \\ &=2\left( 1 - \sqrt{1-y^2} \right) \end{align}

$$A_3 = 2$$

Now I have that $P(Y \le y) = \frac{A_1 + A_2 + A_3}{4}$, but this doesn't seem to simplify to anything and I have the feeling there is a much simpler approach. I'm also not sure how to put it all together, considering that I have to rejigger everything if $y \lt 0$.

12. Mar 26, 2014

### LCKurtz

Take your three pictures together, one sine graph and the three blue regions shaded. Look at the x values where the blue touches the x axis. Call that set $S$. You want the probability that $x\in S$, which isn't that hard to calculate since $X$ is uniform. You really have only two cases to consider, when y is above the axis and below it. And the cosine problem is even easier because of the symmetry.

Remember that $\arcsin(y)$ is the x value just less than 1 in your picture. You can express everything in terms of that using symmetry.

13. Mar 27, 2014

### thapyhap

Great, I see it now! Finally, I have:

\begin{align} F_Y(y) &= \frac{\pi - \cos^{-1}{y}}{\pi} \\ &= \frac{\frac{\pi}{2} + \sin^{-1}{y}}{\pi} \end{align}

Which gives me:
$$f_Y(y) = \frac{1}{\pi \sqrt{1 - y^2}}$$

Thanks so much for all of your help and patience.

Last edited: Mar 27, 2014