# Show dependence of unity of unit squares

Let $$(X_1, X_2)$$ be a pair of uniform distributed random coordinates on $$S:=([-1,0]\times[-1,0])\;\cup\; [0,1]\times[0,1])$$. Are $$X_1, X_2$$ independent? Are $$X_1, X_2$$ uncorrelated?

If you draw the picture you can see they're obviously dependent are positively correlated. If I know $$X_1$$ is negative, then by all means $$X_2$$ is negative as well, and vice versa. Also, they occur in the same "direction". So positively correlated. The intuition is quite obvious. Here is my formal approach:

Show that $$f_{X,Y}(x,y)\not= f_X(x)f_Y(y)$$.

We know that $$f_{X,Y}(x,y)=\frac{1}{2}\left(\mathbf{1}_{[-1,0]^2}(x,y)+\mathbf{1}_{[0,1]^2}(x,y)\right)$$ and we use $$1/2$$ because when we integrate the above it needs to equal 1. To obtain $$f_X(x)$$ we integrate over $$y$$ and analogous for $$f_Y(y)$$. $$f_X(x)=\int_{\mathbb{R}}f_{X,Y}(x,y)dy=\int_{\mathbb{R}}\frac{1}{2}\left(\mathbf{1}_{[-1,0]^2}(x,y)+\mathbf{1}_{[0,1]^2}(x,y)\right)dy$$ $$=\frac{1}{2}\int_{\mathbb{R}}\mathbf{1}_{[-1,0]^2}(x,y)dy+\frac{1}{2}\int_{\mathbb{R}}\mathbf{1}_{[0,1]^2}(x,y)dy$$ $$=\frac{1}{2}\mathbf{1}_{[-1,0]}\int_{0}^1dy+\frac{1}{2}\mathbf{1}_{[0,1]}\int_{0}^1dy$$ $$=\frac{1}{2}\left(\mathbf{1}_{[-1,0]}+\mathbf{1}_{[0,1]}\right)$$

For $$f_Y$$ I will obtain the exact same thing. So what remains to be shown is $$\frac{1}{2}\left(\mathbf{1}_{[-1,0]^2}(x,y)+\mathbf{1}_{[0,1]^2}(x,y)\right)\not=\frac{1}{2}\left(\mathbf{1}_{[-1,0]}+\mathbf{1}_{[0,1]}\right)\cdot\frac{1}{2}\left(\mathbf{1}_{[-1,0]}+\mathbf{1}_{[0,1]}\right)$$

I tried this by integrating over $$x$$ and $$y$$ but I will be left with an identity saying $$1=1$$. But I know they are not independent. Where is my error?

• Why are you integrating at the end? Two functions can be different but have the same integral... – Eric Wofsey Dec 5 '19 at 21:31
• I thought this way I can show they are not equal. Using the pdf. – Marc Dec 5 '19 at 21:39
• If you integrate, you are just computing the total probability of the whole space with respect to each density function, which of course is going to be $1$ for both of them. – Eric Wofsey Dec 5 '19 at 21:40
• Does this approach make sense at all? Because now looking at my last equation, on the left side I have my indicator variable with two arguments and on the right side they are just constants.. I'm really confused on this. – Marc Dec 5 '19 at 21:47

Two things to note about that last equation you wrote. First, observe that the indicator functions on the right should carry variable inputs with them -- i.e. $$\mathbf 1_{[-1, 0]}(x)$$, etc. Also, note that $$\mathbf 1_{[-1, 0]}(x) + \mathbf 1_{[0, 1]}(x) = \mathbf 1_{[-1, 1]}(x).$$ (This isn't actually quite right because the function should evaluate to $$2$$ at $$x = 0$$, but that's just a single point and we can safely ignore it.)
Hence, that last equation should actually be: $$\frac{1}{2}\left(\mathbf{1}_{[-1,0]^2}(x,y)+\mathbf{1}_{[0,1]^2}(x,y)\right)\not=\frac{1}{2}\left(\mathbf{1}_{[-1,1]}(x)\right)\cdot\frac{1}{2}\left(\mathbf{1}_{[-1,1]}(y)\right)$$ and your task is now to find a region on the plane with positive measure for which this equation does not hold. Can you take it from here?
• Well, for the same reason that you can ignore $x=0$, it's also not enough to find a single pair $(x,y)$ where the two sides are not equal. Rather you need a set of positive Lebesgue measure of such points. – Eric Wofsey Dec 5 '19 at 21:50
• Okay, I'm not sure about the Lebesgue measure. I tried reading into it, but it seems a little too technical for me. What I'm doing now is: For all $x,y \in [0.5,1]$ it holds that the right side is $1/4$. For the left side it's $0$ because the indicator variable is only 1 when $x,y \in [-1,0]$. So the whole left part of the left equation leaves everything with 0. Is that correct? – Marc Dec 5 '19 at 22:17
• I just noticed. I don't have product there, that's why you asked again. It's a sum.. but still it holds (luckily) since $1/2 \not = 1/4$. – Marc Dec 5 '19 at 23:36