Probability Exercise. Find a joint distribution. I have been working on some exercises for probability. There is a problem that I cannot even figure out where to start. So, here is the question.


*

*Let $T$ be drawn from a uniform distribution on the interval $\left[0, \,\sqrt{\,{2}\,}\, - 1\right]$.

*Accept $T$ with probability
$1/\left(1 + T^{2}\right)$, otherwise start over. 

*Let $S = 2T/\left(1 + T^{2}\right)$ and
$C = 1 - ST$.

*Now with probability $1/2$ switch $S$ and $C$. 

*Then with probability $1/2$ for each, independently, change the signs of $S$ and $C$.

*What is the joint distribution of $S$ and $C$ ?.


Any comments would be appreciated. Thanks in advance !.

OK, let's go by steps.
First, for $T$, there is some rejection sampling happening. Noticing that and recalling the Cauchy distribution, we see that $T$ is drawn from a truncated Cauchy distribution -- i.e. $T$ has the distribution of a standard Cauchy random variable, conditioned on lying in the interval $[0,\sqrt{2}-1]$.
What that ends up meaning is that $T$ has density $f_T$ equal to 0 outside of $[0,\sqrt{2}-1]$ and otherwise equal to \[
f_T(x)=\frac{1}{Z} \frac{1}{1 + x^2}
\] where \[
Z = \int_0^{\sqrt{2} - 1} \frac{1}{1 + x^2} \, dx = \frac{\pi}{8}
\] thankfully -- someone has been nice with the constants. So $f_T(x)=\frac{8}{\pi}\frac{1}{1+x^2}$.
Now for $S$. What is this thing? If $g(x)=2\frac{x}{1+x^2}$ then $S=g(T)$. $g$ is a smooth invertible (in fact strictly increasing) function on the domain we care about (the values that $T$ can take, which are $[0,\sqrt{2}-1]$), so we can use a change of variables formula to compute the density $f_S$ of $S$ as follows.
First, since $g(0)=0$ and $g(\sqrt{2}-1)=\sqrt{2}^{-1}$ (again we have been blessed by someone here), we see that the probability that $S$ lies outside the interval $[0,\sqrt{2}^{-1}]$ is 0, so that $f_S$ is equal to 0 outside that interval, and inside of it we have\[
f_S(x)=f_T(g^{-1}(x)) g^{-1}{'}(x).
\]
On our region of interest, $g^{-1}(x)=\frac{1-\sqrt{1-x^2}}{x}$, which has derivative\[
g^{-1}{'}(x)=\frac{1}{x^2\sqrt{1-x^2}} - \frac{1}{x^2}.
\]
OK, so it's a bit of a pain, but \[
f_S(x)=\frac{8}{\pi}\frac{x^2}{(\sqrt{1-x^2}-x-1)^2}\bigg(\frac{1}{x^2\sqrt{1-x^2}} - \frac{1}{x^2}\bigg)=\frac{4}{\pi}\frac{1}{(x+1)\sqrt{1-x^2}},
\]
which isn't so bad in the end.
OK, so we have now the distribution of $S$. Let's find that of $C$, noticing that if $h(x)=1-g(x)x$, then $C=h(T)$. But wait -- simplifying $h$ we see that $h(x)=\frac{1}{1+x^2}$. (Who made this problem, and why? Haha.) On the interval we care about,\[ h^{-1}(x)=\frac{\sqrt{1-x}}{\sqrt{x}}, \] with derivative \[h^{-1}{'}(x)=-\frac{1}{2 x \sqrt{x}\sqrt{1-x}},\]
so that\[
f_C(x)=f_T(h^{-1}(x)) h^{-1}{'}(x) = ...
\]
OK, I have to go offline for a while, but this might get you started...
