# Several questions about conditional probability

Suppose I have 2 variables

$A$:
$P(A) =$ 0.01
$P( \lnot A) =$ 0.99

And $B$ that depends on $A$:

$P(B|A) =$ 0.05
$P( \lnot B|A) =$ 0.95
$P(B| \lnot A) =$ 0.01
$P( \lnot B| \lnot A) =$ 0.99

Applying: $$P(B)=\sum_{A}^{ } P(B|A)P(A)$$

we get $P(B)=(0.01)(0.05)+(0.99)(0.01)=0.0104$

Ok, my question is the following:

If I set the probability of $P(B)=1$
How do I get the values of $P(A)$?

As $B$ depends on $A$, how are all the probabilities affected?
How to compute
$P(A)$ ?
$P(B|A)$?

• if $P(B)=1$ then $P(B|A)$ should be $1$ also (except, maybe if $P(A)=0$) ? Mar 29, 2011 at 7:22
• $P(B)=1$, $P( \lnot B)=0$, $P(B|A)=1$, $P(B|\lnot A )$ ? $P(A)$? Mar 29, 2011 at 7:28
• somehow the question feels incomplete, have you posted all the probabilities? Mar 29, 2011 at 8:40

When you set $Pr(B)=1$ other things will change, though some can remain the same. So you have to decide what is remaining the same.

For example, in the first part, you could have worked out $Pr(A|B)$, $Pr( \lnot A|B)$, $Pr(A| \lnot B)$ and $Pr( \lnot A| \lnot B)$. So $Pr(A|B) = \frac{Pr(B|A)Pr(A)}{Pr(B)} = \frac{0.0005}{0.0104} \approx 0.0480769\ldots$

If you assume $Pr(A|B)$ stays the same into the second part of the question then $Pr(B)=1$ would give $Pr(A)=\approx 0.0480769\ldots$

• So lets say instead of $P(B)=1$ I observe $P( \lnot B)=1$, so this changes the whole thing as you say, How do you apply Bayes in this case, I will use $Pr(A | \lnot B)$ right? Mar 29, 2011 at 15:30
• @darkcminor: You might previously have calculated $Pr(A| \lnot B) = \frac{Pr(\lnot B|A)Pr(A)}{Pr(\lnot B)}$ in much the same way. Mar 29, 2011 at 15:33
• So I will have something like: when $P(\lnot B)=$1, I have $P(\lnot A| \lnot T)= \frac{0.99*0.99}{1-0.0104} \approx 0.99040016$, and doing the same $P(\lnot A)= \approx 0.99040016$ is this correct? Mar 29, 2011 at 15:41
• Apart from the $T$ instead of $B$, this looks sensible. You can also write this as $\frac{0.99\times 0.99}{0.99\times 0.99 + 0.01\times 0.95}$ Mar 29, 2011 at 23:09

Using subjective probabilities adding the “information that $P(B)=1$ to the model as an equation” is no different from adding the “data that $B$ is observed to be true”. So you can use the Bayes theorem:

$P_{prior} = \begin{smallmatrix} 0.05 \cdot 0.01 & 0.01 \cdot 0.99 \\ 0.95 \cdot 0.01 & 0.99 \cdot 0.99 \end{smallmatrix}$

$P_{posterior} = \begin{smallmatrix} 0.05 \cdot 0.01 & 0.01 \cdot 0.99 \\ 0 & 0 \end{smallmatrix} \cdot constant = \begin{smallmatrix} 0.0480769230769 & 0.9519230769231 \\ 0 & 0 \end{smallmatrix}$

Thus

$P_{posterior}(A)={0.05 \cdot 0.01} / ({0.05 \cdot 0.01 + 0.01 \cdot 0.99}) = 0.0480769230769$

• This answer seems to use unconventional notation. What do these matrices mean?
– whuber
Mar 29, 2011 at 16:01
• Two by two tables of prior and posterior probabilities. $\begin{smallmatrix} & \mathbf{A} & \mathbf{\lnot A} \\ \mathbf{B} & P(A \cdot B) & P(\lnot A \cdot B) \\ \mathbf{\lnot B} & P(A \cdot \lnot B) & P(\lnot A \cdot \lnot B) \end{smallmatrix}$ Sum of the elements is 1. I'm not sure about the conventional notation, feel free to rewrite. Mar 29, 2011 at 18:00