2

I'm trying to find the pdf for $V= \cos(2 \pi U)$, where $U$ is a random variable following the $U[0,1]$ distribution.

I found a similar example here.

I tried to solve for the cdf, but I am not sure how to compute it and solve for $P(\cos(2 \pi U) \le v).$ I am having a hard time with the inequality and computing the probability for it. This is how I set it up:

$P(0 \le X \le \frac{\arccos(v)}{2\pi} \text{or}\:\: 1-\frac{\arccos(v)}{2\pi}<X\le 1) $

$= P(0 \le X \le \frac{\arccos(v)}{2\pi} ) + P(1-\frac{\arccos(v)}{2\pi}<X\le 1)$

to get the cdf $\frac{\arccos(v)}{\pi}$

Mittens
  • 46,352
mike
  • 39
  • 5
    Solve the inequality: $$\cos(2\pi U) \le v \iff \arccos(v) \le 2\pi U \le 2\pi - \arccos(v)$$ for $-1\le v \le 1$. – peterwhy Jul 06 '24 at 23:22
  • May I know how you solved that? For example, $U=0$ with $v=\frac12$, they satisfy $0\le U \le \frac{\arccos(v)}{2\pi} = \frac16$, but $\cos (2\pi U) = 1 \not\le v = \frac12$. – peterwhy Jul 06 '24 at 23:50
  • @peterwhy thank you, i see how it is incorrect. I got that result from computing the solutions for $2\pi U = v$. I got $arccos(v)$ and $2\pi - arccos(v)$. I then split the interval $(0,1)$ to get the inequalities in my solution. I think i solved the inequalities incorrectly. – mike Jul 06 '24 at 23:54
  • @peterwhy could you please explain how to derive the if and only if statement – mike Jul 06 '24 at 23:58
  • notice that the image of $\arccos(t)$ is $[0,\pi] $ while $2\pi U$ can get to $2\pi $ so you need to take the values $[\pi,2\pi]$ into account. Notice that $\arccos(t)$ is a monotonic decreasing function,so it reverses inequality signs. You get $$ \cos\left(2\pi U\right)\le v\Rightarrow\begin{cases} 2\pi U\ge\arccos\left(v\right) & if:2\pi U\le\pi\ -2\pi U+2\pi\ge\arccos\left(v\right) & if:\pi\le2\pi U \end{cases} $$ Because $ \cos\left(t\right)=\cos\left(-t\right)=\cos\left(-t+2\pi\right) $ and that guarantees we hit the image of $\arccos(v)$ – Danny Blozrov Jul 07 '24 at 00:09
  • Your first step of finding the end points $2\pi U=\arccos(v)$ or $2\pi U=2\pi - \arccos(v)$ is good. Then by considering the properties of cosine, for example its unit circle definition, check that: a) near $2\pi U= \pi$, $\cos(2\pi U)$ (i.e. the $x$-coordinate) is more negative; and b) near $2\pi U = 0$ or $2\pi U = 2\pi$, $\cos (2\pi U)$ is more positive. So the $2\pi U$ that satisfy $\cos(2\pi U) \le v$ are those in between: $\arccos(v) \le 2\pi U \le 2\pi - \arccos(v)$. – peterwhy Jul 07 '24 at 00:16
  • @peterwhy thanks! – mike Jul 07 '24 at 00:46
  • 1
    @DannyBlozrov thanks! – mike Jul 07 '24 at 00:46

3 Answers3

1

The restriction of $\cos$ to $[0,\pi]$ is bijective with inverse $\arccos:[-1,1]\rightarrow[0,\pi]$.

\begin{align} \{u\in[0,1]:\cos(2\pi u)\leq v\}=\left\{\begin{array}{lcr} \emptyset &\text{if} & v<-1\\ [0,1] &\text{if} & v>1\\ \big[\frac{\arccos(v)}{2\pi},\frac12\big]\cup\big(\frac12,1-\frac{\arccos(v)}{2\pi}\big] &\text{if} & -1\leq v\leq1 \end{array} \right. \end{align} Hence $$P[\cos(2\pi U)\leq v]=\Big(1-\frac{\arccos(v\wedge1)}{\pi}\Big)\mathbb{1}_{(-1,\infty)}(v)$$

Thus, the $V=\cos(2\pi U)$ has a density function (w.r.t. Lebesgue's measure) given by $$f_V(v)=\frac1\pi\frac{1}{\sqrt{1-v^2}}\mathbb{1}_{(-1,1)}(v)$$

Mittens
  • 46,352
0

The whole idea is -“besides a multiplicative factor”-: $$ {1 \over \left\vert{\rm d}V/{\rm d}U\right\vert} = {1 \over 2\pi\left\vert\sin\left(2\pi U\right)\right\vert} = \color{#44f}{\large{1 \over 2\pi\sqrt{1 - V^{2}}}} $$

Felix Marin
  • 94,079
  • 1
    NB: $V=\cos(2\pi U)=\cos(2\pi(1-U))$ entails $U$ has two values for every $V$ : $U \in{ \arccos(V)/2\pi, 1-\arccos(V)/2\pi}$ . Therefore: $$\begin{align}f_{V}(v) &= \left\lvert \dfrac{\mathrm d\arccos v}{2\pi~\mathrm d v}\right\rvert~f_U(\arccos(v)/2\pi)+\left\lvert \dfrac{\mathrm d\arccos v}{2\pi~\mathrm d v}\right\rvert~f_U(1-\arccos(v)/2\pi) \[1ex] &= \dfrac{1}{\pi\sqrt{1-v^2}}\mathbf 1_{-1\leq v\leq 1}\end{align}$$ – Graham Kemp Jul 09 '24 at 04:22
  • @GrahamKemp Yes. Thanks.$\mbox{}$ – Felix Marin Jul 09 '24 at 11:51
0

The function $\cos^{-1}(v)$ is decreasing and always returns values between $0$ and $\pi$. This second fact tells us that if we want to use $\cos^{-1}(\cos x) = x$, then we need to have $x \in [0, \pi]$.

Suppose $x \in [0, \pi]$. Since applying a decreasing function to both sides of an inequality reverses the inequality, we have $$ \cos x \le v \quad\text{iff}\quad x \ge \cos^{-1} v. $$ On the other hand, suppose $x \in [\pi, 2\pi]$. Then $\cos x = \cos(2\pi - x)$ and $2\pi - x \in [0, \pi]$. Therefore, in this case, \begin{align*} \cos x \le v &\quad\text{iff}\quad \cos(2\pi - x) \le v\\ &\quad\text{iff}\quad 2\pi - x \ge \cos^{-1} v\\ &\quad\text{iff}\quad x \le 2\pi - \cos^{-1} v. \end{align*} We therefore have, for any $v \in [-1, 1]$, \begin{align*} P(V \le v) &= P(\cos 2\pi U \le v)\\ &= P(\cos 2\pi U \le v, U \le 1/2) + P(\cos 2\pi U \le v, U > 1/2)\\ &= P\left({U \ge \frac1{2\pi}\,\cos^{-1} v, U \le 1/2}\right) + P\left({U \le 1 - \frac1{2\pi}\,\cos^{-1} v, U > 1/2}\right)\\ &= \left({\frac12 - \frac1{2\pi}\,\cos^{-1} v}\right) + \left({1 - \frac1{2\pi}\,\cos^{-1} v - \frac12}\right)\\ &= 1 - \frac1\pi\,\cos^{-1} v. \end{align*} Differentiating gives $$ f_V(v) = \frac1{\pi \sqrt{1 - v^2}}, $$ for $v \in (-1, 1)$.