I'm working on the following practice problem and am struggling in intuitively identifying if X1 and X2 are independent. Here is the problem:
When plotting this function, it is essentially a symmetrical exponential decay function.
When determining if two variables are independent, I ask myself if one random variable value affects the probability of the other. Looking at the plot, it seems like the value of X1 would change the probability knowledge of X2. For example, if X1 = 0, then X2 appears to have low variance. If X1 is far away from zero, it appears that X2 has higher variance.
However, I know this isn't true. If you calculate the marginal probability distributions for X1 and X2, you will find that P(X1)*P(X2) = P(X1, X2). This suggests that the X1 and X2 are independent.
So my question: why does the plot make it look like X1 and X2 are dependent when in reality they're not?
While $f_{X,Y}(x,y)$ (your plot) is a joint pdf (2-variable pdf), taking slices e.g.
$g(y) = f_{X,Y}(0,y)$, or,
$h(y) = f_{X,Y}(1,y)$,
these $g(y)$ and $h(y)$ are not (single-variable) pdf. The simplest proof is that $\int g(y) \neq 1$. After all, in your example, from the joint pdf formula it is clear that $g(y) = e \cdot h(y)$, so $\int g(y) dy \neq \int h(y) dy$ and they cannot both $=1$.
If you rescale $g(y), h(y)$ correctly, they can become the conditional distributions of $Y$, conditioned on $X=0, X=1$ respectively. (The rescaling factors are in fact the marginal density values $f_X(0), f_X(1)$, I'm pretty sure.) However, if the variables are independent, then they will look the same after the correct rescaling is done to each. Even in your plot you can kind of see that happening - if you rescale the $h(y)$ slice by a factor of $e$, it'd look exactly like the $g(y)$ slice, and then you wouldn't think their variances are different.