Bayesian Probability question -- Pointwise Probability I am stuck in this question:
if $a = 1$ then $m \sim U(0.2,1)$ else if $a=0$ then $m \sim U(0,0.5)$. The question is if $m$ is $0.3$ what is the probability that $a$ equals to 1? 
My thought is to compute $p(a=1\mid m=0.3)$ and $p(a=0\mid m=0.3)$ and whichever class gives the higher probability then it is the answer. However, when I am executing this thought I have a problem of computing $p(m=0.3\mid a=1)$ which is supposed to be zero since it follows $U(0.2,1)$. I feel like I can use the density function to compute this probability but I am not sure why?
 A: Instead of Bayes rule, we should look closely at the definition of conditional probability, as Bayes rule is simply a small transformation of the definition of conditional probability. 
With discrete probabilities, it is simple to define
$$P(A = a \mid B = b) = \frac{P(A = a\cap B = b)}{P(B = b)}$$
As you pointed out, this would be ill-defined if both $A$ and $B$ were continuous, as it would result $0/0.$
Instead, let's think about $P(A \in a \pm \varepsilon \mid B \in b \pm \varepsilon)$ for a continuous distribution. Then the value 
$$ \frac{P(A \in a \pm \varepsilon \cap B \in b \pm \varepsilon)}{P(B \in b \pm \varepsilon) }$$
is properly defined for all $\epsilon$, as long as $\int_{b - \varepsilon}^{b + \varepsilon} f_b(x) \, dx > 0 $. Finally, we just define the conditional distribution of $A|B$ as
$$\lim_{\varepsilon \rightarrow 0} \frac{P(A \in a \pm \varepsilon \cap B \in b \pm \varepsilon) / \varepsilon}{P(B \in b \pm \varepsilon) / \varepsilon } $$
By definition, this is 
$$\frac{ f_{A, B}(a, b) }{ f_B(b)}$$
A: If $a=1$ then the density function of $m$ is $\displaystyle f_m(x) = \begin{cases} 1/(1-0.2) = 1.25 & \text{if } 0.2\le x\le 1, \\ 0 & \text{if } x<0.2 \text{ or } x>1. \end{cases}$
If $a=0,$ it is $\displaystyle f_m(x) = \begin{cases} 1/(0.5-0) = 2 & \text{if } 0\le x\le0.5, \\ 0 & \text{if } x<0 \text{ or } x>0.5. \end{cases}$
Thus the likelihood function is
$$
\begin{cases} L( 1 \mid m=0.3) = 1.25, \\ L(0 \mid m=0.3) = 2. \end{cases}
$$
Hence the posterior probability distribution is
$$
\begin{cases} \Pr(a=1\mid m=0.3) = c\times 1.25\times\Pr(a=1), \\[5pt] \Pr(a=0\mid m = 0.3) = c\times 2 \times \Pr(a=0). \end{cases} \tag 1
$$
The normalizing constant is
$$
c = \frac 1 {1.25\Pr(a=1) + 2\Pr(a=0)}
$$
(that is what $c$ must be to make the sum of the two probabilities in line $(1)$ above equal to $1.$)
So for example, if $\Pr(a=1)=\Pr(a=0) = \dfrac 1 2$ then $\Pr(a=1\mid m=0.3) = \dfrac 5 {13}.$
A: The answer given by Michael Hardy is correct. I just want to post a different interpretation of the same answer in case anyone finds it easier to follow:
I would like to compute the probability of $p(a=1|m=3)$:
$p(a=1|m=3) = \frac{p(m=3|a=1)p(a=1)}{p(m=3)}$. 
In this equation, $p(a=1)$ is a discrete probability which I can compute. The problem is computing $p(m=3)$ and $p(m=3|a=1)p(a=1)$ since $m$ is a continous random variable. Here is the solution:
For any contious variable, $f_X(x)$, we can write the probability of $x$ being equal to any constant c as follows:
$f_x(x=c) = f_x(c)dx$ which is the infinitely small area that amounts to the probability that we want to compute. 
Applying this logic to above given equations, we:
$p(m=3|a=1) = f_m(m=3)dm p(a=1)$ and $f_m(m=3) = f_m(m=3)dm p(a=1) + f_m(m=3)dm p(a=0)$.
After putting everything together:
$p(a=1|m=3) = \frac{p(m=3|a=1)p(a=1)}{p(m=3)} = \frac{f_m(m=3)dm p(a=1)}{f_m(m=3)dm p(a=1) + f_m(m=3)dm p(a=0)} = \frac{f_m(m=3)p(a=1)}{f_m(m=3)p(a=1) + f_m(m=3)p(a=0)}$ 
As seen this answer equals to the answer given by Michael Hardy.
