# Conditioning to derive the distribution of function of uniform random variables

After seeing this question here, I was genuinely curious if there was a way to derive this distribution.

I've attempted it below using the CDF for $$Z$$ and conditioning on the value of $$Y$$. It is unclear to me if it would have been easier to condition on the value of $$X$$.

Denote the CDF as $$F_X(x) \equiv P(X\le x)$$ and the PDF as $$f_X(x)$$. Let $$\bar F_X(x) = P(X>x) = 1-F_X(x)$$.

Question:
Let $$X\sim U(0,1)$$, $$Y\sim U(0,1)$$, and $$X$$ & $$Y$$ be independent.
Define $$Z\equiv \text{cos}(2\pi Y)\left[-2\text{ln}(X)\right]^2$$

What is the distribution of $$Z$$? Goal is to get PDF.

My first attempt:

\begin{align} F_Z(z) &\equiv P(Z\le z) = P(\text{cos}(2\pi Y)\left[-2\text{ln}(X)\right]^2\le z) \\ &=\int_0^1 P(\text{cos}(2\pi Y)\left[-2\text{ln}(X)\right]^2\le z|Y = y)f_Y(y)dy \\ &=\int_0^1 P\left(X \ge \text{e}^{\frac{1}{2}\sqrt{\frac{z}{\text{cos}(2\pi y)}}}\right)dy \\ &\vdots \\ &(\text{Algebra}) \\ &\vdots \\ &= \int_0^1 \bar F_X\left(\text{e}^{\frac{1}{2}\sqrt{\frac{z}{\text{cos}(2\pi y)}}} \right)dy \\ &= \int_0^1 1-\text{e}^{\frac{1}{2}\sqrt{\frac{z}{\text{cos}(2\pi y)}}} dy \end{align}

I was unable to resolve this. My next attempt will condition on $$X=x$$ to see if that simplifies any better. I've added the self-study tag since this is for my curiosity (this is not for an assignment).

Update:
On suggestion from helpful commenters, I'm trying the Jacobian Determinant approach based on p. 5-7 here and the last page here. Never seen this approach before, but here goes...

Set $$W = Y$$ and we know $$X = \text{e}^{-\frac{1}{2}\sqrt{\frac{Z}{\text{cos}(2\pi Y)}}}= \text{e}^{-\frac{1}{2}\sqrt{\frac{Z}{\text{cos}(2\pi W)}}}$$.

The method gives the joint density $$f_{Z,W}(z,w)= \frac{f_{X,Y}(x,y)}{|\mathbf{J}|}$$ where $$\mathbf{J}= \left[ {\begin{array}{c c} \partial z/ \partial x & \partial z/ \partial y \\ \partial w/ \partial x & \partial w/ \partial y \end{array} }\right] = \left[ {\begin{array}{c c} \frac{8\text{ln}(x)\text{cos}(2 \pi y)}{x} & -8\pi \text{ln}^2(x)\text{sin}(2 \pi y) \\ 0 & 1 \end{array} }\right]$$ so $$|\mathbf{J}| = \frac{8\text{ln}(x)\text{cos}(2 \pi y)}{x}$$.

Now this gives us \begin{align} f_{Z,W}(z,w) &= \frac{f_X\left(\text{e}^{-\frac{1}{2}\sqrt{\frac{z}{\text{cos}(2\pi y)}}}\right)f_Y(w)x}{8\text{ln}(x)\text{cos}(2 \pi y)} \\ \\ &=\frac{f_X\left(\text{e}^{-\frac{1}{2}\sqrt{\frac{z}{\text{cos}(2\pi w)}}}\right)\text{e}^{-\frac{1}{2}\sqrt{\frac{z}{\text{cos}(2\pi w)}}}f_Y(w)}{8\text{ln}\left(\text{e}^{-\frac{1}{2}\sqrt{\frac{z}{\text{cos}(2\pi w)}}}\right)\text{cos}(2 \pi w)} \end{align} But we know $$f_X(x) = x$$ for $$x\in [0,1]$$ and similarly with $$f_Y(y)$$. Then $$f_{Z,W}(z,w) =\frac{w\,\text{e}^{-\sqrt{\frac{z}{\text{cos}(2\pi w)}}}}{8\text{ln}\left(\text{e}^{-\frac{1}{2}\sqrt{\frac{z}{\text{cos}(2\pi w)}}}\right)\text{cos}(2 \pi w)}$$

for $$w\in [0,1]$$. Now to find the marginal distribution $$f_Z(z)$$ from \begin{align}f_Z(z)&= \int_{-\infty}^\infty f_{Z,W}(z,w)dw \\ &=\int_0^1 f_{Z,W}(z,w)dw \end{align}

This will take me some time.

• Did you try the Jacobian Determinant method? – user158565 Oct 19 '18 at 22:42
• No I haven't heard of that method but I'll look it up. Thank you for the suggestion. – SecretAgentMan Oct 20 '18 at 0:57
• See here, last page, maybe it is useful for your case. stat.washington.edu/~nehemyl/files/… – user158565 Oct 20 '18 at 1:24
• Consider $2\pi Y$ to be a random angle, and the other term to be a radius. Then you're computing one component of a conversion to Cartesian co-ordinates. If the second term was to the power of 1/2 rather than 2 it's very easy, but if that power is definitely 2 you should still be able to get there; the second term in the product is plainly the square of a chi-squared(2) variate. – Glen_b Oct 20 '18 at 4:22
• mathworld.wolfram.com/Box-MullerTransformation.html – Glen_b Oct 20 '18 at 22:33