獨立性與條件獨立
Independence and Conditional Independence
上一篇的結尾提到,資訊的流入對某件事情發生的機率,影響可能為正、也可能為負;而比較特別的情況,是某一事件的資訊流入對另一事件毫無影響,這種狀況便是兩事件彼此獨立。本篇就從這個概念的正式定義說起。
獨立事件
令 $(S,\mathcal{F},\mathbb{P})$ 為一機率空間,$A,B\in\mathcal{F}$。$A$ 與 $B$ 獨立 (independent),記為 $A\indep B$,與以下條件等價:
(1) 在 $\mathbb{P}(A)>0$ 之下,皆有
\[\mathbb{P}(B\mid A)=\mathbb{P}(B)\](2) 在 $\mathbb{P}(B)>0$ 之下,皆有
\[\mathbb{P}(A\mid B)=\mathbb{P}(A)\](3) 皆有
\[\mathbb{P}(A\cap B)=\mathbb{P}(A)\,\mathbb{P}(B)\]上述的條件其實都是在說,給定發生 $A$ (或 $B$) 的條件之下,發生 $B$ (或 $A$) 的條件機率,與沒有給定此條件時相同;換言之,即發生 $A$ (或 $B$) 並不影響 $B$ (或 $A$) 發生的機率,這個概念即為二者獨立。
由條件機率的定義及乘法原理可知,若 (1) 或 (2) 成立,我們當然能夠順勢得到 (3)。
判斷兩事件是否為獨立事件 (independent events) 時,最常採用條件 (3)。因為條件 (1) 與 (2) 須分別假設 $\mathbb{P}(A)>0$ 或 $\mathbb{P}(B)>0$ 方能使條件機率有定義;條件 (3) 則不涉及條件機率,即使 $\mathbb{P}(A)=0$ 或 $\mathbb{P}(B)=0$,仍可直接作為判定事件獨立的準則。
In a survey on computer ownership, $73.4\%$ of the respondents said they own a PC, $21.8\%$ said they own both a PC and a Mac, and $80.1\%$ said they own at least one of the two. Let $P$ be the event that a randomly chosen respondent owns a PC, and let $M$ be the event that the respondent owns a Mac.
(1) What is the probability that a respondent owns a Mac?
(2) Are $P$ and $M$ mutually exclusive? Justify your answer with probabilities.
(3) Given that a respondent owns a PC, what is the conditional probability that the respondent also owns a Mac?
(4) Are $P$ and $M$ independent? Justify your answer with probabilities.
以下依序求解。
(1) 依題意知
則由加法原理可知
移項可得
(2) 由 $\mathbb{P}(P\cap M)=0.218\neq 0$ 可知 $P\cap M\neq\varnothing$,故 $P$ 與 $M$ 不為互斥事件。
(3) 所求為
(4) 由 (1) 已知 $\mathbb{P}(M)=0.285$,故
故 $P$ 與 $M$ 不獨立。
令 $(S,\mathcal{F},\mathbb{P})$ 為一機率空間,$A,B\in\mathcal{F}$,且滿足 $\mathbb{P}(A)=0.2$、$\mathbb{P}(B)=0.5$ 與 $\mathbb{P}(A\cup B)=0.5$,則以下敘述何者為真?
以下依序求解。
(1) 由加法原理可知
且 $\mathbb{P}(A)\,\mathbb{P}(B)=0.1$,故 $\mathbb{P}(A\cap B)\neq\mathbb{P}(A)\,\mathbb{P}(B)$,$A$ 與 $B$ 不獨立,此敘述為假。
(2) 由 $\mathbb{P}(A\cap B)=0.2\neq 0$ 可知 $A\cap B\neq\varnothing$,故 $A$ 與 $B$ 不互斥,此敘述為假。
(3) 由
可知 $A$ 與 $S$ 獨立,此敘述為真。
(4) 由
\[\mathbb{P}(B\cap\varnothing)=\mathbb{P}(\varnothing)=0=\mathbb{P}(B)\,\mathbb{P}(\varnothing)\]可知 $B$ 與 $\varnothing$ 獨立,此敘述為真。
(5) 由 $B\cap S=B\neq\varnothing$ 可知 $B$ 與 $S$ 不互斥,此敘述為假。
(6) 由
\[\mathbb{P}(S\cap\varnothing)=\mathbb{P}(\varnothing)=0=\mathbb{P}(S)\,\mathbb{P}(\varnothing)\]可知 $S$ 與 $\varnothing$ 獨立,此敘述為真。
由 Example 1.19 可見,任何樣本空間的兩個顯然事件 $S$ 與 $\varnothing$ 皆與所有事件獨立。直觀而言,$S$ 必然發生而 $\varnothing$ 絕不發生,兩者皆不會帶來任何額外資訊,自然與任何事件都獨立。
互斥與獨立
如前文介紹互斥時所述,獨立與互斥屬於不同層次的定義,其中獨立須使用機率函數,互斥則僅就集合有無交集來界定。
多數情況下,互斥事件並不獨立;因為兩事件互斥代表必定不會同時發生,在機率上通常具有強烈的互相影響關係。
然而在零機率的邊界情況下,互斥事件仍可能獨立。以下參照 Mittelhammer (1996,頁 31;完整書目見文末參考文獻),將互斥與獨立的對應關係整理如下:
| 情況 | $A\cap B=\varnothing$,即 $\mathbb{P}(A\cap B)=0$ | $A\cap B\neq\varnothing$,即 $\mathbb{P}(A\cap B)\geqslant 0$ |
|---|---|---|
| $\mathbb{P}(A)>0$ 且 $\mathbb{P}(B)>0$ | $A$ 與 $B$ 不獨立 | 若 $\mathbb{P}(A\cap B)=\mathbb{P}(A)\,\mathbb{P}(B)$ 則獨立,否則不獨立 |
| $\mathbb{P}(A)=0$ 或 $\mathbb{P}(B)=0$ | $A$ 與 $B$ 獨立 | $A$ 與 $B$ 獨立 (因為 $\mathbb{P}(A\cap B)=0$) |
- 當 $\mathbb{P}(A)>0$ 且 $\mathbb{P}(B)>0$:
若 $A\cap B=\varnothing$,則 $A$ 與 $B$ 不獨立;若 $A\cap B\neq\varnothing$,則視 $\mathbb{P}(A\cap B)=\mathbb{P}(A)\,\mathbb{P}(B)$ 是否成立,判斷獨立與否。 - 當 $\mathbb{P}(A)=0$ 或 $\mathbb{P}(B)=0$:
無論兩事件是否互斥,$A$ 與 $B$ 皆獨立,因為此時必有 $\mathbb{P}(A\cap B)=0$。
Prove the following two statements, assuming that every conditioning event has positive probability.
(1) If $\mathbb{P}(B)=1$, then $\mathbb{P}(A\mid B)=\mathbb{P}(A)$ for every event $A$.
(2) Suppose that $\mathbb{P}(A)>0$ and $\mathbb{P}(B)>0$. If $A$ and $B$ are independent, then they cannot be mutually exclusive. Conversely, if they are mutually exclusive, then they cannot be independent.
以下依序求解。
(1) 由全機率定理可知
\[\mathbb{P}(A\cap B)=\mathbb{P}(A)-\mathbb{P}(A\cap B^{\prime})\]且由於 $\mathbb{P}(B)=1$,故知 $\mathbb{P}(B^{\prime})=1-\mathbb{P}(B)=0$。由單調性可知
\[\mathbb{P}(A\cap B^{\prime})\leqslant\mathbb{P}(B^{\prime})=0\]故知 $\mathbb{P}(A\cap B^{\prime})=0$,因此
由條件機率定義知,對所有 $A\in\mathcal{F}$ 皆有
(2) 由 $\mathbb{P}(A)>0$ 及 $\mathbb{P}(B)>0$,分兩個方向證明。
若 $A$ 與 $B$ 獨立,則可知
\[\mathbb{P}(A\cap B)=\mathbb{P}(A)\,\mathbb{P}(B)>0\]故 $A\cap B\neq\varnothing$,即 $A$ 與 $B$ 不互斥。
若 $A\cap B=\varnothing$,則可知
\[\mathbb{P}(A\cap B)=0\neq\mathbb{P}(A)\,\mathbb{P}(B)>0\]故 $A$ 與 $B$ 不獨立。
On a field trip to Guatemala, you study a population of handsome fungus beetles. Females make up $70\%$ of the population and males $30\%$. The population also has two color morphs, with $60\%$ of the beetles dull brown and $40\%$ bronze. Half of all the beetles are dull brown females. Is the event that a beetle is male independent of the event that a beetle is dull brown?
令 $A$ 表其顏色為 dull brown 之事件,$M$ 表其性別為 male 之事件,由題目敘述可以列出以下之機率列聯表:
| $A$ | $A^{\prime}$ | 總和 | |
|---|---|---|---|
| $M$ | $0.1$ | $0.2$ | $0.3$ |
| $M^{\prime}$ | $0.5$ | $0.2$ | $0.7$ |
| 總和 | $0.6$ | $0.4$ | $1$ |
因此
故 $A$ 與 $M$ 不獨立,其顏色為 dull brown 與其性別為 male 此二事件不獨立。
Example 1.21 中,我們將昆蟲群體依照其顏色與性別兩組互斥且合起來涵蓋整個母體的分類方式 (即稍後將正式介紹的分割 (partition)) 進行分類,並列成表格,這種表格稱為列聯表 (contingency table)。其型態如下表:
| $A_1$ | $A_2$ | $A_3$ | 總和 | |
|---|---|---|---|---|
| $B_1$ | $\mathbb{P}(A_1\cap B_1)$ | $\mathbb{P}(A_2\cap B_1)$ | $\mathbb{P}(A_3\cap B_1)$ | $\mathbb{P}(B_1)$ |
| $B_2$ | $\mathbb{P}(A_1\cap B_2)$ | $\mathbb{P}(A_2\cap B_2)$ | $\mathbb{P}(A_3\cap B_2)$ | $\mathbb{P}(B_2)$ |
| $B_3$ | $\mathbb{P}(A_1\cap B_3)$ | $\mathbb{P}(A_2\cap B_3)$ | $\mathbb{P}(A_3\cap B_3)$ | $\mathbb{P}(B_3)$ |
| 總和 | $\mathbb{P}(A_1)$ | $\mathbb{P}(A_2)$ | $\mathbb{P}(A_3)$ | $1$ |
| $A_1$ | $A_2$ | 總和 | |
|---|---|---|---|
| $B_1$ | $\mathbb{P}(A_1\cap B_1)$ | $\mathbb{P}(A_2\cap B_1)$ | $\mathbb{P}(B_1)$ |
| $B_2$ | $\mathbb{P}(A_1\cap B_2)$ | $\mathbb{P}(A_2\cap B_2)$ | $\mathbb{P}(B_2)$ |
| 總和 | $\mathbb{P}(A_1)$ | $\mathbb{P}(A_2)$ | $1$ |
在上述表格中,表內的機率如 $\mathbb{P}(A_1\cap B_1)$ 等,稱作聯合機率 (joint probability),而表邊的機率如 $\mathbb{P}(A_1)$ 等,稱作邊際機率 (marginal probability),這二者的概念與分割及全機率定理具有非常高度的相關,我們將在後續主題與章節詳細討論。
獨立事件的餘事件
令 $(S,\mathcal{F},\mathbb{P})$ 為一機率空間,$A,B\in\mathcal{F}$,且 $A\indep B$,則以下敘述亦成立:
Proof.
(1) 由 $A\indep B$ 可知 $\mathbb{P}(A\cap B)=\mathbb{P}(A)\,\mathbb{P}(B)$ 成立。
又由全機率定理可知
且由 $\mathbb{P}(B^{\prime})=1-\mathbb{P}(B)$ 知 $\mathbb{P}(A\cap B^{\prime})=\mathbb{P}(A)\,\mathbb{P}(B^{\prime})$,故 $A\indep B^{\prime}$。
(2) 由 $A\indep B$ 可知 $\mathbb{P}(A\cap B)=\mathbb{P}(A)\,\mathbb{P}(B)$ 成立。
又由全機率定理可知
且由 $\mathbb{P}(A^{\prime})=1-\mathbb{P}(A)$ 知 $\mathbb{P}(A^{\prime}\cap B)=\mathbb{P}(A^{\prime})\,\mathbb{P}(B)$,故 $A^{\prime}\indep B$。
(3) 由 $A\indep B$ 可知 $\mathbb{P}(A\cap B)=\mathbb{P}(A)\,\mathbb{P}(B)$ 成立。
又由狄摩根律與餘事件公式可知
故 $A^{\prime}\indep B^{\prime}$。 $\square$
此定理說明,若某事件是否發生不能給另一事件帶來任何資訊,則該事件「是否不發生」同樣不會提供任何資訊;因為得知某事件「發生」與得知其「不發生」,兩者的資訊完全等價。
完全獨立與成對獨立
令 $(S,\mathcal{F},\mathbb{P})$ 為一機率空間。若 $A,B,C\in\mathcal{F}$ 滿足以下條件,則稱 $A,B,C$ 完全獨立 (mutually independent):
(1) 三事件兩兩獨立,即
\[\begin{gathered} \mathbb{P}(A\cap B)=\mathbb{P}(A)\,\mathbb{P}(B)\\[0.4em] \mathbb{P}(B\cap C)=\mathbb{P}(B)\,\mathbb{P}(C)\\[0.4em] \mathbb{P}(A\cap C)=\mathbb{P}(A)\,\mathbb{P}(C) \end{gathered}\](2) 交集機率等於各自機率相乘,即
\[\mathbb{P}(A\cap B\cap C)=\mathbb{P}(A)\,\mathbb{P}(B)\,\mathbb{P}(C)\]完全獨立不僅要求三事件的交集機率等於各自機率相乘,還須滿足兩兩事件彼此獨立;若僅滿足條件 (1) 而不滿足條件 (2),則稱為成對獨立 (pairwise independent)。
將此定義推廣至任意 $n$ 個事件時,須要求從這 $n$ 個事件中任取 $k$ 個事件 ($k=2,3,\ldots,n$) 皆滿足「交集機率等於各自機率相乘」;以四個事件為例,其中任意兩個、任意三個以及全部四個事件皆須滿足此條件。
回顧兩事件獨立的定義,其核心在於「條件機率等於邊際機率」,說明事件間互不影響。此觀點在三個或以上的事件中依然適用,對應等價條件如下:
其中
\[\begin{gathered} \mathbb{P}(A\mid B,C)=\mathbb{P}(A\mid B\cap C)\\[0.4em] \mathbb{P}(B\mid A,C)=\mathbb{P}(B\mid A\cap C)\\[0.4em] \mathbb{P}(C\mid A,B)=\mathbb{P}(C\mid A\cap B) \end{gathered}\]且 $\mathbb{P}(A)$、$\mathbb{P}(B)$、$\mathbb{P}(C)$、$\mathbb{P}(A\cap B)$、$\mathbb{P}(A\cap C)$、$\mathbb{P}(B\cap C)$ 皆大於 $0$。
當各機率皆為正時,上式與 Definition 1.21 等價,其中 Definition 1.21 的條件 (1) 與 (2) 必須同時成立,方能推得上述所有條件機率等式;反之亦然。
Four cards are labeled with the numbers $1$, $2$, $3$, and $123$, one number per card. One card is drawn at random, and for $i=1,2,3$ let $A_i$ be the event that the number on the drawn card contains the digit $i$. Show that the three events $A_1,A_2,A_3$ are pairwise independent but not mutually independent.
依題意可知 $A_1=\lbrace 1,123\rbrace$、$A_2=\lbrace 2,123\rbrace$、$A_3=\lbrace 3,123\rbrace$,則
依題意可知
\[\begin{gathered} A_1=\lbrace 1,123\rbrace\\[0.4em] A_2=\lbrace 2,123\rbrace\\[0.4em] A_3=\lbrace 3,123\rbrace \end{gathered}\]則
又由
可知 $A_1,A_2,A_3$ 為成對獨立事件,然而
故知道 $A_1,A_2,A_3$ 為成對獨立事件但不為完全獨立之事件。
可靠度與串並聯系統
在獨立假設下,許多複雜系統的機率計算得以大幅簡化,工程與統計中常見的「可靠度問題」(因實際上常探討系統維持運作的壽命,又稱「系統壽命問題」) 即為典型例子。正因其分析上的便利性,處理現實世界的複雜問題時,往往會先簡化假設各部分彼此獨立,以進行初步分析。
系統的可靠度 (reliability) 是指系統能夠成功運作的機率。一般可靠度問題皆可透過子系統拆解,化約為串聯與並聯兩種最基本的系統結構。首先假設兩個獨立運作的元件,並令 $A$ 與 $B$ 分別表示第一個與第二個元件順利運作的事件,以下分別推導兩種系統的可靠度。
串聯系統
這種系統若要成功運作,表示兩個元件皆必須要可以運作,即 $A$ 事件與 $B$ 事件之交集,故整個系統的可靠度為
\[\mathbb{P}(A\cap B)=\mathbb{P}(A)\,\mathbb{P}(B)\]推廣至 $n$ 個元件的串聯系統,可靠度為
\[\mathbb{P}\left(\bigcap_{i=1}^{n}A_i\right)=\prod_{i=1}^{n}\mathbb{P}(A_i)\]並聯系統
這種系統若要成功運作,表示兩個元件有其一可以運作即可,即 $A$ 事件與 $B$ 事件之聯集,故整個系統的可靠度為
此可靠度亦即全部機率扣掉兩個元件都不運作之機率。
推廣至 $n$ 個元件的並聯系統,可靠度為
\[\mathbb{P}\left(\bigcup_{i=1}^{n}A_i\right)=1-\prod_{i=1}^{n}\big(1-\mathbb{P}(A_i)\big)\]A system consists of three components $1$, $2$, and $3$, arranged as in the figure below. Each component fails with probability $0.1$.
(1) If the three components work independently, what is the probability that the system works?
(2) Suppose instead that component $1$ works independently of components $2$ and $3$, and that the conditional probability that component $2$ fails given that component $3$ fails is $0.4$, and vice versa. What is the probability that the system works?
以下依序求解。
(1) 令 $A_i$,$i=1,2,3$ 表示元件 $i$ 可以順利運作的事件。元件 $2$ 與 $3$ 可視為一簡單串聯子系統,由 $A_2\indep A_3$ 可知其順利運作之機率為
又該子系統與元件 $1$ 並聯,故整個系統順利運作的機率為
(2) 依題意知 $\mathbb{P}(A_2^{\prime}\mid A_3^{\prime})=\mathbb{P}(A_3^{\prime}\mid A_2^{\prime})=0.4$,故由乘法原理可知
再由狄摩根律可知
\[\mathbb{P}(A_2\cup A_3)=1-\mathbb{P}(A_2^{\prime}\cap A_3^{\prime})=0.96\]且由加法原理可知
又元件 $1$ 與元件 $2$ 及元件 $3$ 皆獨立,故整個系統的可靠度為
Consider the power transmission system composed of the components shown in the figure below, where the number in each block is the probability that the component operates. Find the probability that the whole system operates.
假設本題中,所有元件之可運作事件彼此獨立。由圖可知,題目為三個子系統的串聯,分別為
此三個子系統可運作的事件分別令為 $E_1,E_2,E_3$,則可知
所求為
條件獨立
討論多個事件時,有時兩事件在整體樣本空間中並不獨立,但在給定某個背景事件 $C$ 發生之後,彼此便不再互相影響。這種建立在條件機率之上的獨立關係稱為條件獨立。
令 $A,B,C\in\mathcal{F}$,且 $\mathbb{P}(C)>0$。若
\[\mathbb{P}(A\cap B\mid C) =\mathbb{P}(A\mid C)\,\mathbb{P}(B\mid C)\]則稱 $A$ 與 $B$ 在給定 $C$ 後條件獨立 (conditionally independent)。
條件獨立的關鍵在於先給定事件 $C$。固定條件 $C$ 後,若 $\mathbb{P}(A\mid C)>0$ 且 $\mathbb{P}(B\mid C)>0$ 成立,上式同樣表示 $A$ 是否發生不改變 $B$ 在給定 $C$ 下的條件機率,反之亦然。
醫學上的重複檢測便是常見的例子。令 $D$ 表示受檢者確實罹病的事件,$T_1$ 與 $T_2$ 分別表示第一次與第二次檢測呈陽性的事件。若假設在真實罹病與否確定之後,兩次檢測的誤差彼此獨立,則有
\[\mathbb{P}(T_1\cap T_2\mid D) =\mathbb{P}(T_1\mid D)\,\mathbb{P}(T_2\mid D)\]也有
\[\mathbb{P}(T_1\cap T_2\mid D^{\prime}) =\mathbb{P}(T_1\mid D^{\prime})\,\mathbb{P}(T_2\mid D^{\prime})\]但這並不代表 $T_1$ 與 $T_2$ 在未給定真實狀態時也會獨立。一旦第一次檢測呈陽性,我們對受檢者罹病的機率評估便會提高,進而提高第二次檢測也呈陽性的機率;因此,在未給定 $D$ 或 $D^{\prime}$ 的情況下,$T_1$ 與 $T_2$ 通常並不獨立。
若固定每一種條件狀態後,$A$ 與 $B$ 都條件獨立,能不能推出 $A$ 與 $B$ 本身獨立?答案是否定的。
令 $C_1$ 與 $C_2$ 互斥且 $C_1\cup C_2=S$,且
\[\mathbb{P}(C_1)=\mathbb{P}(C_2)=\frac{1}{2}\]假設在 $C_1$ 下,$A$ 與 $B$ 各自發生的條件機率都是 $9/10$;在 $C_2$ 下,$A$ 與 $B$ 各自發生的條件機率都是 $1/10$。再假設在 $C_1$ 與 $C_2$ 下,$A$ 與 $B$ 都條件獨立。
於是由全機率定理可得
\[\mathbb{P}(A)=\mathbb{P}(B) = \frac{1}{2}\cdot\frac{9}{10} + \frac{1}{2}\cdot\frac{1}{10} = \frac{1}{2}\]但若要計算 $A\cap B$ 的機率,由全機率定理可先寫為
再由乘法原理與條件獨立性可得
而
\[\mathbb{P}(A)\,\mathbb{P}(B)=\frac{1}{4}\]因此 $A$ 與 $B$ 在各條件狀態下都條件獨立,混合回整體後卻不獨立。原因是未給定條件狀態時,$A$ 的發生會改變我們對落在 $C_1$ 或 $C_2$ 的判斷,使 $B$ 的發生機率隨之改變。此共同來源便在整體中留下相依關聯。
這個例子也提醒我們,條件獨立與整體獨立不能互相替代。條件資訊若沒有被明確放進模型,混合後的整體關係可能完全不同。
本篇小結
本篇由獨立的定義出發,依序整理下列結果:
| 結果 | 內容 |
|---|---|
| Definition 1.20 | 獨立事件 (三個等價條件) |
| Theorem 1.15 | 獨立事件之餘事件仍獨立 |
| Definition 1.21 | 完全獨立與成對獨立 |
| 可靠度 | 串聯與並聯系統的成功機率 |
| Definition 1.22 | 條件獨立 |
下一篇將介紹樣本空間的分割與全機率定理,說明當樣本空間被一組兩兩互斥且聯集為 $S$ 的事件切開時,如何將一個事件的機率拆成各個互斥部分再加總。
參考文獻與延伸閱讀
- 黃文璋,2010,《機率論》,二版,華泰文化。
- Sheldon Ross. 2019. A First Course in Probability. 10th ed. Pearson.
- Joseph K. Blitzstein and Jessica Hwang. 2019. Introduction to Probability. 2nd ed. Chapman and Hall/CRC.
- Morris H. DeGroot and Mark J. Schervish. 2012. Probability and Statistics. 4th ed. Pearson.
- Ron C. Mittelhammer. 1996. Mathematical Statistics for Economics and Business. Springer New York.
- A. Philip Dawid. 1979. “Conditional Independence in Statistical Theory.” Journal of the Royal Statistical Society, Series B 41 (1): 1–15.