조건부확률

정의[편집 | 원본 편집]

사건 [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{ B_1,B_2,\cdots,B_n }[/math]이 서로소이고 이들 중 하나만 반드시 발생한다고 하자. 그러면

[math]\displaystyle{ A=\bigcup_{i=1}^n (A\cap B_i) }[/math]

이고 [math]\displaystyle{ A\cap B_1, A\cap B_2,\cdots, A\cap B_n }[/math]은 서로소이므로 다음 식이 성립한다.

[math]\displaystyle{ \begin{align} P(A)&=\sum_{i=1}^n P(A\cap B_i)\\ &=\sum_{i=1}^n P(A|B_i)P(B_i) \end{align} }[/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]

이다.

예시[편집 | 원본 편집]

  • 4명이 순서대로 제비를 뽑아 그 중 두 명이 당첨된다고 하자. 그러면 어느 순서에 있는 것이 가장 유리할까?

이 문제를 조건부확률을 이용해 풀어보자. i번째 사람이 당첨되는 사건을 [math]\displaystyle{ W_i }[/math]라고 하자. 그러면

[math]\displaystyle{ P(W_1)=\frac{2}{4}=\frac{1}{2} }[/math]
[math]\displaystyle{ P(W_2)=P(W_2|W_1)P(W_1)+P(W_2|W_1^c)P(W_1^c)=\frac{1}{3}\frac{1}{2}+\frac{2}{3}\frac{1}{2}=\frac{1}{2} }[/math]
[math]\displaystyle{ \begin{align} P(W_3)&=P(W_3\cap W_2)+P(W_3\cap W_2^c)\\ &=P(W_3\cap W_2|W_1)P(W_1)+P(W_3\cap W_2|W_1^c)P(W_1^c)+P(W_3\cap W_2^c|W_1)P(W_1)+P(W_3\cap W_2^c|W_1^c)P(W_1^c)\\ &=0+\frac{2}{3}\frac{1}{2}\frac{1}{2}+\frac{2}{3}\frac{1}{2}\frac{1}{2}+\frac{1}{3}\frac{1}{1}\frac{1}{2}\\ &=\frac{1}{2} \end{align} }[/math]
[math]\displaystyle{ \begin{align} P(W_4)&=P(W_4\cap W_3)+P(W_4\cap W_3^c)\\ &=P(W_4\cap W_3\cap W_2)+P(W_4\cap W_3\cap W_2^c)+P(W_4\cap W_3^c\cap W_2)+P(W_4\cap W_3\cap W_2^c)\\ &=0+P(W_4\cap W_3\cap W_2^c|W_1)P(W_1)+P(W_4\cap W_3\cap W_2^c|W_1^c)P(W_1^c)+P(W_4\cap W_3^c\cap W_2|W_1)P(W_1)\\ &\quad+P(W_4\cap W_3^c\cap W_2|W_1^c)P(W_1^c)+P(W_4\cap W_3\cap W_2^c|W_1)P(W_1)+P(W_4\cap W_3\cap W_2^c|W_1^c)P(W_1^c)\\ &=0+\frac{1}{3}\frac{1}{1}\frac{1}{1}\frac{1}{2}+0+\frac{2}{3}\frac{1}{2}\frac{1}{1}\frac{1}{2}+0+\frac{1}{3}\frac{1}{1}\frac{1}{1}\frac{1}{2}\\ &=\frac{1}{2} \end{align} }[/math]

이므로 어느 순서에 있든 당첨될 확률은 같다. 일반적으로 n명이 순서대로 제비를 뽑아 그 중 m명이 당첨된다면, 어느 순서에 있더라도 당첨될 확률은

[math]\displaystyle{ P(W_i)=\frac{m}{n} }[/math]

으로 동일하다.

독립사건[편집 | 원본 편집]

사건 [math]\displaystyle{ A,B }[/math]에 대해 다음 식

[math]\displaystyle{ P(A\cap B)=P(A)P(B) }[/math]

이 성립하면 AB는 서로 독립(independent)이라고 한다. 만약 AB가 독립이 아니면 종속(dependent)이라고 한다. 조건부확률의 정의에 의해 [math]\displaystyle{ A,B }[/math]가 독립일 필요충분조건은 다음과 같다.

[math]\displaystyle{ P(A|B)=P(A) }[/math]
[math]\displaystyle{ P(B|A)=P(B) }[/math]

조건확률분포[편집 | 원본 편집]

이산확률분포[편집 | 원본 편집]

확률변수 [math]\displaystyle{ X,Y }[/math]의 결합확률질량함수(joint probability mass function)가 [math]\displaystyle{ p(x,y) }[/math]이고 Y의 주변확률질량함수(marginal probability mass function)를 [math]\displaystyle{ p_Y(y) }[/math]로 두면,

[math]\displaystyle{ \begin{align} p_{X|Y}(x|y)&=P(X=x|Y=y)\\ &=\frac{P(X=x,Y=y)}{P(Y=y)}\\ &=\frac{p(x,y)}{p_Y(y)} \end{align} }[/math]

이다.

연속확률분포[편집 | 원본 편집]

확률변수 [math]\displaystyle{ X,Y }[/math]의 결합확률밀도함수(joint probability density function)가 [math]\displaystyle{ f(x,y) }[/math]이고 Y의 주변확률밀도함수(marginal probability density function)를 [math]\displaystyle{ f_Y(y) }[/math]로 두면,

[math]\displaystyle{ f_{X|Y}(x|y)=\frac{f(x,y)}{f_Y(y)} }[/math]

이다.

같이 보기[편집 | 원본 편집]