Cos$^2(x)$ function of a uniform distribution

239 Views Asked by At

I would like to find the cos$^2$(x) distribution of a uniform variable X, defined over -$\frac{\pi}{2}$ to $\frac{\pi}{2}$. So I set Y=cos$^2$(x), and proceed as follows. P(Y$\leq$y)=P(cos$^2$(x) $\leq$ y)=P($-\sqrt(y)\leq cosx \leq \sqrt(y)$)=P($x\leq \arccos(\sqrt(y))$ +P(x$\leq$ $\arccos(-\sqrt(y)))$ - 1 = $\frac{2\arccos(\sqrt(y))+2\arccos(-\sqrt(y))+2\pi}{\pi}$. I am I right or I do a mistake somewhere?

Thank you in advance

1

There are 1 best solutions below

0
On

Let’s ignore the obvious typo at the end with $2\pi$ missing a $-$ and check each step:

$$\mathbb P(Y \leq y) = \mathbb P(\cos(X)^2 \leq y)$$ is obviously correct. $$ \mathbb P(\cos(X)^2 \leq y) = \mathbb P(-\sqrt y \leq \cos X \leq \sqrt y)$$ is correct. Next you should be careful: if $-\pi/2\leq X\leq \pi/2$ then $\cos X \geq 0$. So in fact this is the same as $$ \mathbb P(\cos X \leq \sqrt y) $$ This is the same as $$ \mathbb P(X \geq \arccos(\sqrt y)) + \mathbb P(X \leq -\arccos(\sqrt y)) $$ which is then $$ 2\cdot \mathbb P(X \leq -\arccos(\sqrt y)) = \frac{1}{\pi} 2(\pi/2 - \arccos(\sqrt y)) = 1 - 2/\pi\arccos(\sqrt y)$$

See here an R simulation that compares the heuristic probability ($P$) with your solution ($p_1$), your solution with the fixed sign ($p_2$) and this solution ($p_3$). Note how you can thus easily check your result yourself using a simple R simulation.

https://sagecell.sagemath.org/?z=eJyVjLsOgzAMRfdK_MMdGBxKeKRbBf_QEcaIhxqphBSCqvx9E7pQdaoHW7bPPQ0qjmXTaqSy-FQKblQuUoTOolOLGt28UsOSRESnPiR6aWU2LnIayPk3FVefZsgRhmdiUwbspeyd-hQCCUgGyfpcLDnGcMa-88NBJEYFh--7Qvyr4D-Ky1FRBmB_eteXaodvgV2lMQ9HfexSjJvurJo1ZY5hGqSmFlUNv3neJ94X71Kw&lang=r&interacts=eJyLjgUAARUAuQ==

(in fact this simulation shows you that your result is in fact constant. This is to be expected, $\arccos(-x) = \pi - \arccos(x)$).