Independence of Random Variables $X, Y$ and $Z$ Let X be uniformly distributed on the unit interval $[0,1]$. Let Y be the indicator of the event "X is a rational number". Let Z be the indicator for the event "X is a dyadic rational number". Are X and Y independent? Are Y and Y independent? Are X and X independent?
As far as I know, two random variables are independent if knowing the value of one RV does not change the probability of another one. So by that logic, if is choose X to be irrational then the value of Y will be zero.So the value of X affects the value taken by Y. So, are X and Y dependent?
 A: You cannot use intuition alone to decide on independence. You have to understand the technicalities involved in the definition of independent random variables.
In this case $Y$ almost surely $0$ so  $Y$ is independent of any random variable including itself. This answers the first two parts. For the last part you have to note that $X$ is independent of itself if and only if it is almost surely constant. That is not the case here so $X$ and $X$ are not independent.
A: First, let's deal with the question if $Y$ is independent of $Y$. This is true if and only if $P(Y) = P(Y \cap Y) = P(Y) P(Y)$, which reduces to $P(Y)$ is 0 or 1, i.e., $Y$ either happens, or doesn't happen, a.s.
Since there are countable number of rationals, $P(Y) = 0$, or $Y^c$ a.s.. One way to think about this is that, since there are only a countable (although countably infinite) number of rationals, and an infinite number of irrationals, infinite always wins and we are almost surely going to draw an irrational. Therefore, since $P(Y)=0$, $Y$ is independent of itself.
Is $X$ and $Y$ independent? Probably not, and you can try to construct a simple counterexample to show $P(X \cap Y) \neq P(X)P(Y)$. But intuitively since $Y$ depends on $X$, they aren't independent.
