【條件概率和貝葉斯定理(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.

用 AI 逐步解條件概率和貝葉斯定理題目 Solve it with AI

DSE 數學 AI 導師 · DSE Math AI Tutor

用於貝葉斯定理的 GeoGebra 樹形圖:甲機 0.6、乙機 0.4,其後分為次品與良品 GeoGebra tree diagram with branches for machine A 0.6 and machine B 0.4, then defective and not defective, used for Bayes theorem
例題 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)
↑ 返回頁頂 Back to top

條件概率和貝葉斯定理例題詳解 Worked Examples

例題 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.

  1. P(A ∩ D) = 0.6 × 0.02 = 0.012
  2. P(B ∩ D) = 0.4 × 0.05 = 0.020
  3. P(D) = 0.012 + 0.020 = 0.032
  4. 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.

  1. P(A ∩ B) = P(A) + P(B) − P(A ∪ B) = 0.5 + 0.4 − 0.7 = 0.2
  2. P(A) × P(B) = 0.5 × 0.4 = 0.2
  3. 兩者相等,所以 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).

↑ 返回頁頂 Back to top

💡 應試陷阱與秘訣 Exam Traps & Secrets

⚠️ 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.
↑ 返回頁頂 Back to top

✏️ 自我測試:互動練習 Self-Test: Interactive Practice

溫習方法:點擊以下任何題目,即時在坐標網格載入並核對計算步驟。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).
↑ 返回頁頂 Back to top

常見問題 Frequently Asked Questions

↑ 返回頁頂 Back to top

相關主題 Related Topics

離散隨機變量:期望值和方差 Discrete Random Variables: Expectation and Variance二項分佈 The Binomial Distribution二項分佈還是泊松分佈?如何選擇 Binomial or Poisson? Choosing the DistributionDSE M1 全部課題 DSE M1: all topicsDSE M1 公式表 DSE M1 formula sheetM1 與 M2 的分別 M1 vs M2DSE M2 筆記 DSE M2 notesHKDSE 數學全部課題 HKDSE Math: all topics
條件概率和貝葉斯定理 DSE 練習題 Try a DSE Practice Question