TITLE: If a random variable is independent from the two components of a random vector, are the random vector and the random variable independent?
QUESTION [5 upvotes]: in my probability class I was asked this seemingly very tricky question dealing with random variables and vectors:

Let $ X,Y,Z $ be random variables with PDFs (continuous) such that we know that Z and X are independent and the variables Z and Y are independent. We are asked to prove or disprove (give a counterexample) that the random vector $ (X,Y) $ and $ Z $ are independent.

I have tried to prove it just with the basic identities and definitions but got nothing so maybe it is false and we must give a counterexample? I do not even know how to deal with this, so I really need the help. Thanks all helpers.

REPLY [2 votes]: Another example: Toss a fair die twice. Let $X$ be the number showing on the first toss, and $Y$ the number showing on the second toss. Let $Z$ be the indicator of the event that $X+Y$ is even. Then $X$ and $Z$ are independent, $Y$ and $Z$ are independent, but $Z$ is clearly a non-random function of $(X,Y)$ and so $Z$ is not independent of $(X,Y)$.