Can a random variable be a deterministic function of other random variables yet be independent of them? I was confused by what it means when a Random variable is a deterministic function of another Random variable yet is independent of it? How is this possible?
Here's the question: Consider three random variables $X,Y$ and $Z$ such that $Z$ is independent of $X$ and of $Y$ and is a deterministic function of $(X,Y)$. Is $H(Z)=0$? If so prove it; if not, give a counter example. 
 A: A non trivial univariate real random variable that is a deterministic function of another random variable is not independent of it (see Mark L. Stone's answer for an example with a constant random variable). However, when more than two random variables are involved independence shows counterintuitive behaviours.
I'll give an example of $Z$ deterministic function of $X$ and $Y$ but independent from $X$ and $Y$.
Let $X$ and $Y$ be independent Bernouilli variables with $p=0.5$ (for example, $X$ and $Y$ are the results of tossing a coin each).
Let $f(X,Y)$ equal $1$ if $X=Y$ and $0$ if $X$ is different from $Y$.
Let $Z=f(X,Y)$.
You can easily see that $P(X=0)=0.5=P(X=0\mid Z=1)=P(X=0\mid Z=0)$ and that $P(X=1)=0.5=P(X=1\mid Z=1)=P(X=1\mid Z=0)$, proving that $X$ and $Z$ are independent, or using another definition of independence:
\begin{align*}P(x=0\text{ and }Z=0) &= P(X=0\text{ and }X \text{ different from }Y) 
\\
&= 
P(X=0\text{ and }Y=1)
\\
&= 0.5 \cdot 0.5 = 0.25
\\\\
P(X=0) \cdot P(Z=0) &= 0.5 \cdot 0.5 = 0.25
\end{align*}
The same operation can be done for all values of $X$ and $Z$, thus proving that $P(X=a\text{ and }Z=b) = P(X=a)\cdot P(Z=b)$ for every value of $a$ and $b$.
Furthermore, the same proof holds for $Y$, therefore proving that $Y$ and $Z$ are independent and $X$ and $Z$ are independent. In fact, $X$, $Y$ and $Z$ are pairwise independent while $X$, $Y$ and $Z$ are not independent considered as a whole (not jointly independent). Interestingly, $Z$ is not independent of $(X, Y)$.
A: A random variable which is a constant with probability 1 is independent of itself. I leave the trivial proof to you as an exercise.
Consider the deterministic function f(x) = x, applied to the random variable $Y$, which equals a constant, say $e^\pi$, with probability one. Therefore, the random variable $f(Y)$ is independent of $Y$. If you don't like that example because $f(Y)$ is the same as $Y$, then use the function $f(x) = 2x$. Same conclusion.
This provides a counterexample to the incorrect statement "An univariate real random variable that is a deterministic function of another random variable is not independent of it." in the first paragraph by the answer by @Pere . 
