Problem:
Let $X \sim \text{Uniform}(0,1)$. Let $0 < a < b < 1$. Let
$$ Y = \begin{cases} 1 & 0 < X < b \\ 0 & \text{otherwise} \end{cases} $$
and let
$$ Z = \begin{cases} 1 & a < X < 1 \\ 0 & \text{otherwise} \end{cases} $$
Question 1: How does one determine if $Y$ and $Z$ are independent?
I can see that $Y$ and $Z$ are independent for all $x \notin [0,1]$. Things are less clear otherwise.
Question 2: How does one compute $\mathbb{E}(Y \mid Z = z)$?
Of course, I know that if $Z$, $Y$ are independent then $\mathbb{E}(Y \mid Z = z) = \mathbb{E}(Y)$
It's obvious that $Y$ and $Z$ cannot be independent. If you observe $Y = 1$, then you know $X \in (0,b)$, and intuitively, this information affects the probability of observing $Z = 1$. Formally, $$\Pr[Z = 1 \mid Y = 1] = \frac{\Pr[(Z = 1) \cap (Y = 1)]}{\Pr[Y = 1]} = \frac{b-a}{b},$$ but $$\Pr[Z = 1] = 1-a \ne 1 - \frac{a}{b}$$ if $b \ne 1$.