# Normal distribution mixed with discrete variable

I'm working on this exercise and after spending the last couple of days reading about probability (not my strong suit), I'm still not sure if I'm doing it right. The exercise goes as follows:

You're given a liquid and you have to determine whether it's liquid A or B. You know that liquid A contains 14.5ml/l and liquid B contains 13.8ml/l of alcohol. You decide to measure the alcohol in the given liquid, however due to measurement noise the measurement will not be correct. The noise will be distributed according to normal distribution with standard deviation of 0.36.

1) After measuring it the first time, you get the result: 14.2ml/l. What's the probability that the given liquid is A?

2) You measure it second time, this time it results into: 14.1ml/l. What's the probability now? How does the probability change with N measurements?

I defined a random variable $X$: $X \sim$ liquid is either A or B

We additionally know that $A \sim N(14.5, 0.36)$ and $B \sim N(13.8, 0.36)$.

1) I calculated the probability for both liquids as:

$P(A) = P(14.2 \le A \le 14.8)$

$P(B) = P(13.2 \le B \le 14.2)$

So to answer the first question I believe the final probability should be $\frac{P(A)}{P(A)+P(B)}$. However I'm not sure since $P(A)+P(B)$ is larger than 1 and I might be mixing up something here. I kinda just forced the value in $[0,1]$ range. Another way that pops into my head is that I would take the original $P(A)$ probability and then multiply it with $1-P(B)$ since that event didn't occur, but that looks sketchy as well.

2) This is where I'm lost. My current attempt is (note that $m_i$ means $i$th measurement) to take conditional probabilities of all the measurements we've seen before:

$P(X=A|m_1, m_2) = \frac{P(X=A, m_2, m_1)}{P(m_2, m_1)}$ but this is mixing apples and pears. I'm not sure how to evaluate the top part since X is discrete and $m_i$ is continuous variable. What would $P(m_i)$ even mean though. Would this just be a probability to have this measurement based on A distribution and $P(X=A)$ chance to be A on both distributions A and B (like in the first question)?

If anyone could shed some light, I'd be utmost grateful!

• This problem is incomplete because it does not specify (i) The a-priori probability the liquid is type A (is it 1/2?), (ii) The mean of the noise (is it 0?). You likely should assume $P[A]=P[B]=1/2$ and the noise is mean 0. Then $$f_{Y|A}(y|A) = \frac{2\pi(.36)^2}e^{-\frac{(y-14.5)^2}{2(.36)^2}} \quad , \forall y \in \mathbb{R}$$ It is not correct to say $P(A)=P[14.2\leq A\leq 14.8]$ because this assumes $A$ is both an event and a random variable, and it does not consider a-priori probabilities. – Michael Oct 29 '16 at 21:27
• You want to use Baye's rule in its "mixed" form. Assume $Y$ is the measurement. So the first parts want you to compute $$P[A|Y=14.2]=\frac{f_{Y|A}(14.2|A)P[A]}{f_{Y}(14.2)}$$ where $f_{Y}(14.2) = f_{Y|A}(14.2|A)P[A] + f_{Y|B}(14.2|B)P[B]$. – Michael Oct 29 '16 at 21:29
• (i) There's no such data, only that liquid can A or B. (ii)I believe the author meant that noise is around the liquid's proper value - for A = 14.5 +- 0.36. – probably Oct 29 '16 at 21:34
• The first part of the problem cannot be answered unless a-priori probabilities for $A$ and $B$ are given (of course, $P[B]=1-P[A]$). I suspect the author intended them to be $1/2$. I observe that my latex fraction got rearranged in the first comment, I was intending that to be Gaussian $$f_{Y|A}(y|A)=\frac{1}{2\pi(.36)^2}e^{-\frac{(y-14.5)^2}{2(.36)^2}}$$ – Michael Oct 29 '16 at 21:45
• Woah that's pretty awesome! The first part is clear as a day, thank you very much! – probably Oct 29 '16 at 22:19