# How can I get the probability given the Bayesian table?

Consider that $$A \rightarrow B$$. And A has two states 0 and 1 respectively with probability of $$0.6$$ and $$0.4$$. $$\mbox{And for}\ B: \left\{\begin{array}{rcl} Pr\left(B = 1 \mid A = 1\right)} & =} & 0.3} \\[1mm] Pr\left(B = 1 \mid A = 0\right)} & =} & 0.2} \\[1mm] Pr\left(B = 0 \mid A = 1\right)} & =} & 0.7} \\[1mm] Pr\left(B = 0 \mid A = 0\right)} & =} & 0.8} \end{array}\right.$$

What I want to get is $$Pr(B=1)$$, and I know the result is $$\frac{0.3+0.2}{0.3+0.2+0.7+0.8}$$. But my question is how can I get the result provided the two tables?

My reduction:

\begin{align} Pr(B=1) &= \frac{Pr(B=1|A)}{Pr(B=1|A) + Pr(B=0|A)}\\ & = \frac{\frac{Pr(B=1,A)}{Pr(A)}}{\frac{Pr(B=1,A)}{Pr(A)}+\frac{Pr(B=0,A)}{Pr(A)}} \\ & = \frac{Pr(B=1, A=0) + Pr(B=1, A=1)}{Pr(B=1, A=0) + Pr(B=1, A=1) + Pr(B=0, A=0) + Pr(B=0, A=1)} \end{align}

Am I right?

Any hints or suggestions would be highly appreciated. Thank you!

• $Pr(B = 1) = \frac{Pr(B=1}{\sum\limits_{i=0}^{1}Pr(B = i)}$. Its essentially the "area" of $B = 1$ divided by the entire "area". Note that you need to take into account both cases $A = 0$ and $A = 1$ when computing $Pr(B = i)$ – David Jan 15 at 13:50

I know the result is $$\frac{0.3+0.2}{0.3+0.2+0.7+0.8}$$
It is not right and it must be: \begin{align}P(B=1)=&P(B=1,A=0)+P(B=1,A=1)=\\ =&P(A=0)\cdot P(B=1|A=0)+P(A=1)\cdot P(B=1|A=1)=\\ =&0.6\cdot 0.2+0.4\cdot 0.3=\\ =&0.24.\end{align}
• You are right. I have read the textbook and find this: The joint distribution of two random variables has to be consistent with the marginal distribution, in that $P(x)=\sum_y P(x, y)$. It seems very intuitive. What I was thinking was totally of non-sense. I was just applying the equations mechanically and unfortunately wrongly. – Lerner Zhang Jan 17 at 6:43