<s>[INST] Find $P(XY+Z-XZ=2)$ when $Z$~$N(0,1)$, $Y$~$B(3, \frac{1}{2})$, $X$~$B(1, \frac{1}{3})$ Let $X,Y,Z$ be independent variables such that: \begin{gather*}
Z \sim N(0,1) \,\text{(normal distribution)},\\
Y \sim B(3, \frac{1}{2}) \,\text{(binomial distribution)},\\ 
X \sim B(1, \frac{1}{3}) \,\text{(binomial distribution)}.
\end{gather*}
We define $W=XY+(1-X)Z$. I need to calculate $P(X=1|W=2)$ , so\begin{align*}
P(X=1|W=2)&=P(X=1|XY+Z-XZ=2)\\
&=\frac{P(XY+Z-XZ=2 \cap X=1)}{P(XY+Z-XZ=2)}\\
&= \frac{P(Y=2)}{P(XY+Z-XZ=2)}.
\end{align*}
And I got stuck in calculating $P(XY+Z-XZ=2)$. Any help would be appreciated.
 [/INST] \begin{align*}
P(XY + Z - XZ = 2) &= P(XY + Z - XZ = 2 \mid X = 0) + P(XY + Z - XZ = 2 \mid X = 1)\\
&= P(Z = 2 \mid X = 0) + P(Y = 2 \mid X = 1)\\
&= P(Z = 2) P(X = 0) + P(Y = 2)P(X = 1)\\
&= 0 \cdot \frac{2}{3} + \frac{3}{8} \cdot \frac{1}{3} = \frac{1}{8}.
\end{align*}
</s>