Given the random variables $X: \Omega \to \mathbb R$ and $D: \Omega \to \{-1,1 \}$, and the (measurable) function $f: \mathbb R \times \{-1, 1 \} \to \mathbb R$.
Show that if
$$ X = f(X,-1)P[D =-1|X] + f(X,1)P[D =1|X], $$
then
$$ \frac{X - f(X, -1)}{f(X, 1) - f(X, -1)} = P[D = 1 |X]. $$
All I can see is the immediate algebraic manipulation
$$ \frac{X - f(X, -1)P[D=-1|X]}{f(X, 1)} = P[D = 1|X] ,$$
but then I am perplexed how to proceed.
Most grateful for any help provided!
Using the definition of $X$, we can write, \begin{align*} X - f(X,-1) & = f(X, -1)P[D = -1|X] - f(X, -1)+ f(X, 1)P[D = 1|X] \\ & = f(X, -1)(P[D = -1|X] - 1)+ f(X, 1)P[D = 1|X] \\ & = -f(X, -1)P[D = 1|X] + f(X, 1)P[D = 1|X] \\ & = P[D = 1|X](f(X, 1)-f(X, -1)) \\ \end{align*}
On rearranging, we get the required expression.