Suppose $Y\_1,Y\_2,\ldots, Y\_n$ are independent, where $Y\_i$ is a continuous valued random variable with a density $p\_{Y\_i}(y\_i)$ on its domain $\mathcal{D}\_i\subseteq \mathbb{R}.$ Can one show that for any continuous function $f:\mathbb{R}^n\to\mathbb{R},$ that is non-constant on $\mathcal{D}\_1\times \mathcal{D}\_2\times\ldots \times \mathcal{D}\_n,$ we must have that $f(Y\_1,Y\_2,\ldots, Y\_n)$ is not independent of $Y\_i$ for at least one $i$?


Note: It is possible that $f(Y\_1,Y\_2,\ldots, Y\_n)$ is independent of $Y\_i$ for some $i.$ For instance, if $Y\_1$ is distributed uniformly on $[0,1]$ and $Y\_2,Y\_3$ are normally distributed with mean 0 and variance 1, then $Z:=f(Y\_1,Y\_2,Y\_3) = Y\_1\cdot Y\_2+\sqrt{1-Y\_1^2}\cdot Y\_3$ is independent of $Y\_1.$


Note 2: One can construct counterexamples if $Y\_1,Y\_2,\ldots, Y\_n$ are allowed to be discrete valued. For instance, if $Y\_i$ is a Bernoulli random variables with parameter $\frac{1}{2},$ then $f(Y\_1,Y\_2,\ldots, Y\_n)$ defined as the XOR of all the $Y\_i$'s is independent of each $Y\_i.$



Function of independent random variables cannot be independent of each variable?
First define $f:[0,1]\rightarrow [0,1]$ as follows:


$$f(x,y)=2(y-x)-1 \hbox{ if } 1\ge y-x \ge 1/2$$
$$f(x,y)=-2(y-x)+1 \hbox{ if } 1/2\ge y-x \ge 0$$
$$f(x,y)=2(y-x)+1 \hbox{ if } 0\ge y-x \ge -1/2$$
$$f(x,y)=-2(y-x)-1 \hbox{ if } -1/2\ge y-x \ge -1$$


Then let $X$ and $Y$ be uniformly (and independently) distributed on $[0,1]$. It's easy to check that $f(X,Y)$ is independent of both $X$ and $Y$.


