# 条件概率

## 定义

P(A|B) = |A∩B|/|B|

$P(A|B) = \frac{P(A \cap B)}{P(B)}$

## 统计独立性

$P(A \cap B) \ = \ P(A) P(B)$

$P(A|B) \ = \ P(A)$

$P(B|A) \ = \ P(B)$

## 互斥性

$P(A \cap B) = 0$

$P(A) \ne 0$$P(B) \ne 0$

$P(A\mid B) = 0$
$P(B\mid A) = 0$

## 其它

• 如果事件$B$的概率$P(B) > 0$，那么$Q(A) = P(A|B)$在所有事件$A$上所定义的函数$Q$就是概率测度
• 如果$P(B)=0$$P(A|B)$没有定义。
• 条件概率可以用决策树进行计算。

## 形式定义

PX|A(E)=PX(A∩E)/PX(E)。

## 条件概率谬论

PA|B）與PB|A）的關係如下所示：

$P(B|A) = P(A|B) \frac{P(B)}{P(A)}.$

$P(\text{disease})=1%=0.01$$P(\text{well})=99%=0.99$

$P(\text{positive}|\text{well})=1%$，而且$P(\text{negative}|\text{well})=99%$

$P(\text{negative}|\text{disease})=1%$$P(\text{positive}|\text{disease})=99%$

$P(\text{well}\cap\text{negative})=P(\text{well})\times P(\text{negative}|\text{well})=99%\times99%=98.01%$

$P(\text{disease}\cap\text{positive})=P(\text{disease})\times P(\text{positive}|\text{disease})=1%\times99%=0.99%$

$P(\text{well}\cap\text{positive})=P(\text{well})\times P(\text{positive}|\text{well})=99%\times1%=0.99%$

$P(\text{disease}\cap\text{negative})=P(\text{disease})\times P(\text{negative}|\text{disease})=1%\times1%=0.01%$

$P(\text{positive})=P(\text{well}\cap\text{positive})+P(\text{disease}\cap\text{positive})=0.99%+0.99%=1.98%$

$\scriptstyle P(\text{disease}|\text{positive})=\frac{P(\text{disease}\cap\text{positive})}{P(\text{positive})}=\frac{0.99%}{1.98%}=50%$