Let $X$ follows Bernoulli(1/3), $Y$ independent of $X$ follows Bernoulli(2/3).
$$Z=\begin{cases}X &\text{if $Y=1$}\\ 1-X &\text{if $Y=0$} \end{cases}$$ Find the conditional distribution of $X=1$ given $Z=1$.
I was applying ${P(X=1,Z=1)\over P(Z=1)}$ but not being able to calculate the denominator and numerator help
I am getting $P(Z=1)=4/9 $ And the numerator as $2/9$
