Probability – Conditional Probability Combining Discrete and Continuous Variables

conditional probabilityprobability

Let $A$ and $B$ be some continuous random variables. We proceed as follows: we take a coin with bias $b$ and flip it. If heads, we inspect $A$, if tails we inspect $B$. Call this resulting random variable $C$.

Now say I can observe $C$ and want to figure out if the coin was heads or tails, i.e. I want to compute $\Pr[$head$|C = c]$

Everywhere I have looked, the definition is either for purely discrete or purely continuous random variables, I have not found a rigorous way of combining the two types of variables.

One thought I had was to approximate the coin toss with a continuous random variable $K$ with pdf:

$k(x) = b, \mbox{ for } x \in [-1, 0] $

$k(x) = 1-b, \mbox{ for } x \in [0,1]$

Then one could compute the joint density function for $K$ and $C$ and compute $\Pr[K < 0 | C = c]$ from there. But this looks clunky and ugly. Is there a better way?

Best Answer

To expand slightly on the great answer by @Did, if $p$ and $q$ are probabilities of $C$ being $A$ and $B$ respectively, then $$ p \int_D f_A = p\int_D g\cdot f_A + q\int_D g\cdot f_B = \int_D g\cdot (p\cdot f_A+q\cdot f_B) $$ so by identification $$ g = \frac{p\cdot f_A}{p\cdot f_A + q\cdot f_B} $$