【條件概率和貝葉斯定理(DSE M1)】Conditional Probability and Bayes’ Theorem (DSE M1)
SketchMath 數學團隊 SketchMath Maths Team | 更新 Updated 2026-10-20
在 B 已發生的條件下,A 的條件概率是 P(A | B) = P(A ∩ B) / P(B)。貝葉斯定理把條件倒轉:P(B | D) = P(B)P(D | B) / P(D),其中 P(D) 是樹形圖中所有以 D 結束的分支的概率總和。The conditional probability of A given B is P(A | B) = P(A ∩ B) / P(B). Bayes’ theorem reverses the condition: P(B | D) = P(B)P(D | B) / P(D), where P(D) is the total over every branch of a tree diagram that ends in D.
例題 1 的樹形圖。兩條紅色分支以次品結束;乙機所佔的比例為 0.020 / 0.032 = 0.625。 The tree diagram for Example 1. The two red branches end in a defective item; machine B’s share of them is 0.020 / 0.032 = 0.625. 自己試試 → Try it yourself →
條件概率公式 Conditional Probability Formulas
條件概率Conditional probabilityP(A | B) = P(A ∩ B) / P(B)
乘法定律Multiplication ruleP(A ∩ B) = P(A) P(B | A)
全概率Total probabilityP(D) = P(A)P(D | A) + P(B)P(D | B)
貝葉斯定理Bayes’ theoremP(B | D) = P(B)P(D | B) / [P(A)P(D | A) + P(B)P(D | B)]
獨立事件Independent eventsP(A ∩ B) = P(A)P(B) ⟺ P(A | B) = P(A)
例題 1 Example 1:用樹形圖應用貝葉斯定理 Bayes’ theorem with a tree diagram
某工廠有甲、乙兩部機器,分別生產 60% 及 40% 的產品。甲機的次品率為 2%,乙機的次品率為 5%。隨機抽出一件產品,發現是次品。求它由乙機生產的概率。A factory has two machines. Machine A makes 60% of the items and machine B makes 40%. 2% of the items from A and 5% of the items from B are defective. An item chosen at random is defective. Find the probability that it was made by machine B.
P(A ∩ D) = 0.6 × 0.02 = 0.012
P(B ∩ D) = 0.4 × 0.05 = 0.020
P(D) = 0.012 + 0.020 = 0.032
P(B | D) = 0.020 / 0.032 = 0.625
答案: Answer: 0.625
例題 2 Example 2:判別兩事件是否獨立 Testing whether two events are independent
已知 P(A) = 0.5、P(B) = 0.4 及 P(A ∪ B) = 0.7,判別 A 與 B 是否獨立。Given P(A) = 0.5, P(B) = 0.4 and P(A ∪ B) = 0.7, determine whether A and B are independent.
P(A ∩ B) = P(A) + P(B) − P(A ∪ B) = 0.5 + 0.4 − 0.7 = 0.2
P(A) × P(B) = 0.5 × 0.4 = 0.2
兩者相等,所以 A 與 B 獨立。The two are equal, so A and B are independent.
答案: Answer: 獨立,因為 P(A ∩ B) = P(A)P(B)。Independent, since P(A ∩ B) = P(A)P(B).
⚠️ P(B | D) 不等於 P(D | B) P(B | D) is not P(D | B)在例題 1 中,P(D | B) = 0.05,但 P(B | D) = 0.625。要看清楚哪個事件是已知發生的:它寫在豎線之後,並放在分母。In Example 1, P(D | B) = 0.05 but P(B | D) = 0.625. Read which event is known to have happened: that one goes after the bar and in the denominator.
⚠️ 獨立不等於互斥 Independent is not mutually exclusive互斥事件不能同時發生,所以 P(A ∩ B) = 0。獨立事件則可以同時發生,只是其中一個不影響另一個的概率。Mutually exclusive events cannot happen together, so P(A ∩ B) = 0. Independent events can; one simply does not change the probability of the other.
溫習方法:點擊以下任何題目,即時在坐標網格載入並核對計算步驟。How to study: click any question to load it on the coordinate grid and check your steps.
(貝葉斯定理 Bayes’ theorem)某測試檢出疾病的概率為 0.95,誤報陽性的概率為 0.02,而 1% 的人患有該病。求測試呈陽性的人確實患病的概率。A test detects a disease with probability 0.95 and gives a false positive with probability 0.02. 1% of people have the disease. Find the probability that a person who tests positive has the disease.
(樹形圖 Tree diagram)X 袋有 3 個紅球及 2 個藍球,Y 袋有 1 個紅球及 4 個藍球。隨機選一個袋並抽出一個紅球,求它來自 X 袋的概率。Bag X has 3 red and 2 blue balls; bag Y has 1 red and 4 blue. A bag is chosen at random and a red ball is drawn. Find the probability it came from bag X.
(獨立事件 Independence)若 A、B 獨立,P(A) = 0.3 及 P(B) = 0.6,求 P(A ∪ B) 及 P(A′ ∩ B)。If A and B are independent with P(A) = 0.3 and P(B) = 0.6, find P(A ∪ B) and P(A′ ∩ B).
它用來求「已觀察到結果」的情況下某個原因的概率。沿樹形圖中每條通往該結果的分支相乘,再把所需分支除以所有這類分支的總和。
It finds the probability of a cause given that an effect has been observed. Multiply along each branch of the tree that leads to the effect, then divide the branch you want by the total of all such branches.
並非硬性規定,但課程說明建議在結果數目有限的問題中使用,而且它能把所需的概率一目了然地列出。
It is not compulsory, but the curriculum notes recommend it for problems with a finite number of outcomes, and it makes every probability you need visible in one place.
是。若 A 與 B 獨立,則 A′ 與 B、A 與 B′、A′ 與 B′ 亦各自獨立。M1 要求認識這一點。
Yes. If A and B are independent then so are A′ and B, A and B′, and A′ and B′. M1 expects you to recognise this.