정의
사건 [math]\displaystyle{ A,B }[/math]가 주어졌다고 하자. [math]\displaystyle{ P(B)\gt 0 }[/math]일 때, B가 발생했을 때 A가 발생할 조건부확률(conditional probability)을 다음과 같이 정의한다.
- [math]\displaystyle{ P(A|B)=\frac{P(A\cap B)}{P(B)} }[/math]
조건부확률은 확률인가
조건부확률은 확률이다.
- 임의의 사건 [math]\displaystyle{ A,B }[/math]에 대해 [math]\displaystyle{ 0\le P(A|B)\le 1 }[/math]이다.
- [math]\displaystyle{ P(A|B)=\frac{P(A\cap B)}{P(B)} }[/math]
이고 임의의 사건 X에 대해 [math]\displaystyle{ P(X)\ge 0 }[/math]이므로,
- [math]\displaystyle{ \frac{P(A\cap B)}{P(B)}\ge 0 }[/math]
임은 자명하다. 한편 [math]\displaystyle{ A\cap B\subseteq B }[/math]이므로
- [math]\displaystyle{ P(A\cap B)\le P(B) }[/math]
이고, 그러므로
- [math]\displaystyle{ \frac{P(A\cap B)}{P(B)}\le 1 }[/math]
이다. 따라서 원하는 결론을 얻는다.
- 표본공간을 S라 하면, [math]\displaystyle{ P(S|B)=1 }[/math]이다.
[math]\displaystyle{ S\cap B=B }[/math]이므로
- [math]\displaystyle{ P(S|B)=\frac{P(S\cap B)}{P(B)}=\frac{P(B)}{P(B)}=1 }[/math]
이다.
- [math]\displaystyle{ A_1,A_2,\cdots,A_n }[/math]이 서로소일 때, [math]\displaystyle{ P\left(\bigcup_{n=1}^{\infty} A_i | B \right)=\sum_{n=1}^{\infty}P(A_i|B) }[/math]이다.
- [math]\displaystyle{ \begin{align} P\left(\bigcup_{n=1}^{\infty} A_i | B \right)&=\frac{P((\bigcup_{n=1}^{\infty}A_i) \cap B )}{P(B)}\\ &=\frac{P(\bigcup_{n=1}^{\infty}(A_i \cap B)) }{P(B)}\\ &=\frac{\sum_{n=1}^{\infty}(A_i\cap B)}{P(B)}\\ &=\sum_{n=1}^{\infty}P(A_i|B) \end{align} }[/math]
이므로 원하는 결론을 얻는다.
관련 공식
곱의 법칙
사건 [math]\displaystyle{ A_1,A_2,\cdots,A_n }[/math]에 대해 다음 식이 성립한다.
- [math]\displaystyle{ P(A_1\cap A_2\cap\cdots\cap A_n)=P(A_1)P(A_2|A_1)P(A_3|A_1\cap A_2)\cdots P(A_n|A_1\cap A_2\cap \cdots A_{n-1}) }[/math]
증명은 수학적 귀납법으로 쉽게 할 수 있다. 먼저
- [math]\displaystyle{ P(A_1)=P(A_1) }[/math]
- [math]\displaystyle{ P(A_1\cap A_2)=P(A_1)P(A_2|A_1) }[/math]
임은 조건부확률의 정의에 의해 자명하다. 이제
- [math]\displaystyle{ P(A_1\cap A_2\cap\cdots\cap A_n)=P(A_1)P(A_2|A_1)P(A_3|A_1\cap A_2)\cdots P(A_n|A_1\cap A_2\cap \cdots A_{n-1}) }[/math]
이 참이라고 하자. 그러면
- [math]\displaystyle{ \begin{align} P(A_1\cap A_2\cap\cdots\cap A_{n+1})&=P(A_1\cap A_2\cap\cdots\cap A_n)P(A_{n+1}|A_1\cap A_2 \cap\cdots\cap A_n)\\ &=P(A_1)P(A_2|A_1)P(A_3|A_1\cap A_2)\cdots P(A_n|A_1\cap A_2\cap \cdots A_{n-1})P(A_{n+1}|A_1\cap A_2 \cap\cdots\cap A_n) \end{align} }[/math]
이므로 원하는 결과를 얻는다.
전확률의 법칙
사건 [math]\displaystyle{ A,B_1,B_2,\cdots,B_n }[/math]에 대해 다음 식이 성립한다.
- [math]\displaystyle{ P(A)=\sum_{i=1}^n P(A|B_i)P(B_i) }[/math]
베이즈 정리
사건 [math]\displaystyle{ A,B }[/math]에 대해 다음 식이 성립한다.
- [math]\displaystyle{ P(A|B)=\frac{P(B|A)P(A)}{P(B)} }[/math]
일반적으로, 사건 [math]\displaystyle{ A_1,A_2,\cdots,A_n }[/math]가 서로소이고 이들 중 단 하나만 발생한다면, 전확률의 법칙에 의해
- [math]\displaystyle{ P(A_j|B)=\frac{P(B|A_j)P(A_j)}{\sum_{i=1}^n P(B|A_i)P(A_i)} }[/math]
이다.
사건의 독립
사건 [math]\displaystyle{ A,B }[/math]에 대해 다음 식
- [math]\displaystyle{ P(A\cap B)=P(A)P(B) }[/math]
이 성립하면 A와 B는 서로 독립(independent)이라고 한다. 만약 A와 B가 독립이 아니면 종속(dependent)이라고 한다.