I'm very stuck in a problem that includes the following relationship:
$P(Y \in G|a=0) = P(Y \in G|a=1) \cdot \frac{\frac{P(a=0|Y \in G)}{P(a=1|Y \in G)}}{\frac{P(a=0)}{P(a=1)}}$
here $a$ denotes a variable that can only take values 0 and 1 and $G$ is an arbitrary measurable set. How can one derive this formula? How is this reasoned properly? I'm very confused. This is done in order to compute a conditional distribution where $a=0$ is given.
Every probability here is conditioned on $x$, so for simplicity we can drop $x$ from everywhere (all the computations will be valid and proceed in the same way if they are all conditioned on $x$). So, you have
\begin{eqnarray*} P\left(a=0\,|\,Y\in G\right) &=& \frac{P\left(Y\in G, a=0\right)}{P\left(Y\in G\right)},\\ P\left(a=1\,|\,Y\in G\right) &=& \frac{P\left(Y\in G, a=1\right)}{P\left(Y\in G\right)}. \end{eqnarray*}
Dividing the first line by the second yields
$$\frac{P\left(a=0\,|\,Y\in G\right)}{P\left(a=1\,|\,Y\in G\right)} = \frac{P\left(Y\in G, a=0\right)}{P\left(Y\in G, a=1\right)}$$
Multiplying this quantity by $P\left(Y\in G\,|\,a=1\right)$ yields $\frac{P\left(Y\in G, a=0\right)}{P\left(a=1\right)}$. Dividing by $\frac{P\left(a=0\right)}{P\left(a=1\right)}$ replaces the denominator by $P\left(a=0\right)$, which gives you $P\left(Y\in G\,|\,a=0\right)$, as required.