 # The process to generate the two RVs is as follows. We first draw T from Uniform(0,1). Zoagliaj 2022-07-16 Answered
The process to generate the two RVs is as follows. We first draw T from $Uniform\left(0,1\right)$ . If $T\le 0.5$ we take $X=T$ and draw Y from $Uniform\left(0,1\right)$ . Otherwise if $T>0.5$ , we take $Y=T$ and draw X from $Uniform\left(0,1\right)$ . Running a simulation it seems like X and Y are positively correlated, though intuitively it seems like they should have no effect on each other. What is the explanation?
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it minotaurafe
Step 1
Let's compute $E\left[XY\right]-E\left[X\right]E\left[Y\right]$ . We have $E\left[Y\right]=\frac{1}{2}\left(E\left[Y\mid T\le 0.5\right]+E\left[Y\mid T>0.5\right]\right)=\frac{0.5+0.75}{2}$ . Similarly, we have $E\left[X\right]=\frac{1}{2}\left(E\left[X\mid T\le 0.5\right]+E\left[X\mid T>0.5\right]\right)=\frac{0.25+0.5}{2}$ .
Then, we have $E\left[XY\right]=\frac{1}{2}\left(E\left[XY\mid T\le 0.5\right]+E\left[XY\mid T>0.5\right]\right)$ . If $T\le 0.5$ , Y is independent from X, so $E\left[XY\mid T\le 0.5\right]=0.25\cdot 0.5$ . Similarly, when $T>0.5$ , Y is indepdent from X, so $E\left[XY\mid T>0.5\right]=0.5\cdot 0.75$ . Thus, we have $\mathrm{cov}\left(X,Y\right)=\frac{1}{2}\left(0.125+0.375\right)-\frac{1.25\cdot 0.75}{4}\approx 0.0156$ , indicating a positive correlation.
###### Not exactly what you’re looking for? Darian Hubbard
Step 1
Of course they are correlated. For one thing they are not independent (as X can only be bigger than 0.5 if $Y>0.5$ and conversely Y can only be smaller than 0.5 if $X\le 0.5$ ).
But in fact they are positively correlated, as the cases with $X>0.5$ , $Y<0.5$ cannot happen.
Let’s calculate this:
$\mathbb{E}\left(X\right)={\int }_{0}^{0.5}x\phantom{\rule{thinmathspace}{0ex}}dx+0.5{\int }_{0}^{1}x\phantom{\rule{thinmathspace}{0ex}}dx=\left({0.5}^{2}+0.5\right)/2=0.75/2=0.375$
and
$\mathbb{E}\left(Y\right)=0.5{\int }_{0}^{1}x\phantom{\rule{thinmathspace}{0ex}}dx+{\int }_{0.5}^{1}x\phantom{\rule{thinmathspace}{0ex}}dx=\left(0.5+\left(1-{0.5}^{2}\right)\right)/2=0.625$
Then
$\mathbb{E}\left(\left(X-0.375\right)\left(Y-0.625\right)\right)={\int }_{0}^{0.5}\left(x-0.375\right){\int }_{0}^{1}\left(y-0.625\right)\phantom{\rule{thinmathspace}{0ex}}dy\phantom{\rule{thinmathspace}{0ex}}dx+{\int }_{0}^{1}\left(x-0.375\right){\int }_{0.5}^{1}\left(y-0.625\right)\phantom{\rule{thinmathspace}{0ex}}dy\phantom{\rule{thinmathspace}{0ex}}dx$
which amounts to $1/64$ for the covariance. So the correlation is positive. We’d still need to calculate the variance of X, Y (which is the same) for the correlation:
$\mathbb{E}\left({X}^{2}\right)={\int }_{0}^{0.5}{x}^{2}\phantom{\rule{thinmathspace}{0ex}}dx+0.5{\int }_{0}^{1}{x}^{2}\phantom{\rule{thinmathspace}{0ex}}dx=\left({0.5}^{3}+0.5\right)/3=\left(5/8\right)/3=5/24$
so
$\mathrm{V}\mathrm{a}\mathrm{r}X=5/24-\left(3/8{\right)}^{2}=13/192$
so we get a correlation of
$\left(1/64\right)/\left(13/192\right)=3/13\approx 0.23$