Let $X$ and $Y$ be two random variables that are uniformly distributed in the square of vertices $(1,0), (0,1), (-1,0)$ and $(0,-1).$ Are they independent?
My thinking: To answer the question I must see whether or not the joint density function is the product of the marginal distributions which can be found once I have written the joint pdf.
I check for the area of the square in which they are uniformly distributed (so I can do simple substitution and find my joint pdf), I find this area is $2$. Now my joint pdf is:
\begin{align} &\begin{aligned} f_{X,Y}(x,y) = \begin{cases} 1/2, & \text{if } (x,y)\in D \\ 0, & \text{otherwise} \end{cases} \end{aligned} \end{align} where $D$ is my square.
Off to find $f_Y(y)$ and $f_X(x)$. By definition, $f_Y(y)=\int_{-\infty}^{\infty} f_{X,Y}(x,y)\text{d}x$. So I see that $-1<x<1$ and therefore $f_Y(y)=\int_{-1}^{1} (1/2) \text{d}x = (1/2)[x]_{-1}^{1}=(1/2)\cdot 2 = 1$. And due to similar arguments I'd get $f_X(x)=1$. So $f_X(x)\cdot f_Y(y)\neq f_{X,Y}(x,y)$, which goes against what those well versed in probability and statistics know, and it's that they indeed are independent.
Page four of ('https://www.math.arizona.edu/~tgk/464_f14/chap6.pdf') says: "Suppose that $X$ and $Y$ have a joint density function that is uniform on the square $[a,b]\times[c,d]$, then they are independent."
So naturally the question arises, what am I doing wrong?