← 返回资讯屏轩教育 · 行业资讯

Bayes' Theorem: Derivation and Typical Applications | 贝叶斯定理的推导与典型应用

2026-08-30 18:11 · 本文部分内容由AI辅助创作

📚 Bayes' Theorem: Derivation and Typical Applications | 贝叶斯定理的推导与典型应用

Bayes' Theorem is one of the most powerful and counter-intuitive results in probability theory. It tells us how to update our beliefs when new evidence arrives. In the IB Mathematics curriculum, Bayes' Theorem appears in both Analysis and Approaches (AA) and Applications and Interpretation (AI), often in the context of conditional probability and statistical inference.

贝叶斯定理是概率论中最强大也最反直觉的结果之一。它告诉我们当新证据出现时,如何更新我们的信念。在IB数学课程中,贝叶斯定理出现在分析与方法(AA)以及应用与解释(AI)中,通常出现在条件概率和统计推断的背景下。


1. Conditional Probability Revisited | 条件概率回顾

Before deriving Bayes' Theorem, we must recall the definition of conditional probability. For two events A and B, the probability of A given that B has occurred is written as P(A|B), and is defined by

在推导贝叶斯定理之前,我们必须回顾条件概率的定义。对于两个事件A和B,在B已经发生的条件下A发生的概率记为P(A|B),定义为

P(A|B) = P(A ∩ B) / P(B), provided P(B) > 0

This formula gives us a way to update the probability of A when we know that B is true. The intersection P(A ∩ B) represents the part of B that also belongs to A.

这个公式给出了当我们知道B为真时更新A的概率的方法。交集P(A ∩ B)表示B中同时也属于A的部分。

Rearranging the definition gives the multiplication rule: P(A ∩ B) = P(A|B) × P(B). Equivalently, P(B ∩ A) = P(B|A) × P(A). These two expressions will be the key to deriving Bayes' Theorem.

重新排列该定义得到乘法法则:P(A ∩ B) = P(A|B) × P(B)。等价地,P(B ∩ A) = P(B|A) × P(A)。这两个表达式将是推导贝叶斯定理的关键。


2. The Law of Total Probability | 全概率公式

Suppose that the sample space can be partitioned into mutually exclusive events A₁, A₂, ..., Aₙ. This means that the events do not overlap and together cover the entire sample space. Then for any event B,

假设样本空间可以被划分为互斥事件A₁, A₂, ..., Aₙ。这意味着这些事件两两不重叠且共同覆盖整个样本空间。那么对于任意事件B,

P(B) = P(B|A₁)P(A₁) + P(B|A₂)P(A₂) + ... + P(B|Aₙ)P(Aₙ)

This is the law of total probability. It allows us to compute the marginal probability of B by considering all possible "causes" Aᵢ that could lead to B.

这就是全概率公式。它允许我们通过考虑所有可能导致B的“原因”Aᵢ来计算B的边缘概率。

For example, if A₁ = "student studies hard" and A₂ = "student does not study hard" ting the pass rates under each study habit by the proportion of students in each category.

例如,如果A₁ = “学生努力学习”,A₂ = “学生不努力学习”,那么通过考试B的概率可以通过将每种学习习惯下的通过率乘以该类学生的比例来求得。


3. Deriving Bayes' Theorem | 推导贝叶斯定理

We now derive Bayes' Theorem from the definition of conditional probability. Start with the two forms of the multiplication rule for the same intersection A ∩ B:

我们现在从条件概率的定义出发推导贝叶斯定理。首先写出同一个交集A ∩ B的两种乘法法则形式:

P(A ∩ B) = P(A|B) P(B) = P(B|A) P(A)

Setting the two expressions equal gives P(A|B) P(B) = P(B|A) P(A). Dividing both sides by P(B) yields

将两个表达式相等得到P(A|B) P(B) = P(B|A) P(A)。两边同时除以P(B)得到

P(A|B) = P(B|A) P(A) / P(B)

This is the simplest form of Bayes' Theorem. If we use the law of total probability to expand P(B), we obtain the more general version. Suppose A₁, A₂, ..., Aₙ form a partition of the sample space, and we want P(Aᵢ|B) for a particular i. Then

这就是贝叶斯定理的最简形式。如果我们使用全概率公式展开P(B),就得到更一般的版本。假设A₁, A₂, ..., Aₙ构成样本空间的一个划分,我们想要计算某个特定的P(Aᵢ|B),那么

P(Aᵢ|B) = P(B|Aᵢ) P(Aᵢ) / Σⱼ P(B|Aⱼ) P(Aⱼ)

Notice that the numerator is the contribution of Aᵢ to the total probability of B, while the denominator is the sum of contributions from all possible Aⱼ. This is why Bayes' Theorem is often described as "the probability of a cause given its effect".

注意,分子是Aᵢ对B的总概率的贡献,而分母是所有可能的Aⱼ的贡献之和。这就是为什么贝叶斯定理常被描述为“已知结果求原因的概率”。


4. Prior and Posterior Probabilities | 先验概率与后验概率

In Bayesian terminology, P(A) is called the prior probability of A: it represents our initial degree of belief in A before observing any evidence B. After observing B, we update to the posterior probability P(A|B).

在贝叶斯术语中,P(A)称为A的先验概率:它代表我们在观察到证据B之前对A的初始信念程度。在观察到B之后,我们更新为后验概率P(A|B)。

Bayes' Theorem therefore provides a formal mechanism for learning from data. The likelihood P(B|A) measures how probable the evidence is if A were true, and the denominator acts as a normalising constant that ensures the posterior probabilities sum to 1.

因此,贝叶斯定理为从数据中学习提供了一种形式化的机制。似然P(B|A)度量了如果A为真那么证据B有多大的可能性,而分母充当归一化常数,确保后验概率之和为1。

For example, if a doctor initially believes that a patient has a rare disease with probability 0.01 (the prior), and a test comes back positive, Bayes' Theorem allows the doctor to combine the test's accuracy with the prior to compute the updated probability of disease (the posterior).

例如,如果医生最初认为患者患某种罕见病的概率为0.01(先验),而检测结果呈阳性,贝叶斯定理允许医生将检测的准确性与先验结合,计算更新后的患病概率(后验)。


5. Typical Application: Medical Testing | 典型应用:医疗检测

assic example is the interpretation of a positive test result. Suppose a disease affects 1% of a population. A diagnostic test has a sensitivity (true positive rate) of 95%, meaning P(Positive | Disease) = 0.95, and a specificity of 90%, meaning P(Negative | No disease) = 0.90, so P(Positive | No disease) = 0.10.

一个经典例子是解读阳性检测结果。假设某种疾病影响1%的人群。一种诊断检测的灵敏度(真阳性率)为95%,即P(阳性 | 患病) = 0.95,特异度为90%,即P(阴性 | 未患病) = 0.90,因此P(阳性 | 未患病) = 0.10。

What is the probability that a person who tests positive actually has the disease? Let A be "has disease" and B be "tests positive". We want P(A|B).

一个检测结果为阳性的人实际上患病的概率是多少?设A为“患病”,B为“检测阳性”。我们要求P(A|B)。

Using Bayes' Theorem:

使用贝叶斯定理:

P(A|B) = P(B|A)P(A) / [P(B|A)P(A) + P(B|Aᶜ)P(Aᶜ)]

Substituting values: P(A) = 0.01, P(Aᶜ) = 0.99, P(B|A) = 0.95, P(B|Aᶜ) = 0.10. Then

代入数值:P(A) = 0.01,P(Aᶜ) = 0.99,P(B|A) = 0.95,P(B|Aᶜ) = 0.10。那么

P(A|B) = (0.95 × 0.01) / (0.95 × 0.01 + 0.10 × 0.99) = 0.0095 / (0.0095 + 0.099) ≈ 0.0876

So even with a positive test, the probability of actually having the disease is only about 8.8%. This surprising result arises because the disease is rare and the false positive rate, though seemingly low, produces many false positives in a large healthy population.

因此,即使检测呈阳性,实际患病概率也只有约8.8%。这个令人惊讶的结果源于疾病罕见,而假阳性率虽然看起来不高,但在庞大的健康人群中会产生大量假阳性。


广告 / Sponsored

6. Typical Application: Spam Filtering | 典型应用:垃圾邮件过滤

Bayes' Theorem is widely used in spam filters. Let S be the event that an email is spam and W be the event that the email contains a particular word, such as "lottery". We want to compute P(S|W), the probability that an email is spam given that it contains the word.

贝叶斯定理被广泛应用于垃圾邮件过滤器。设S为邮件是垃圾邮件的事件,W为邮件包含某个特定单词(如“lottery”)的事件。我们要计算P(S|W),即已知邮件包含该单词时它是垃圾邮件的概率。

From historical data, we can estimate P(S), the overall spam rate, P(W|S), the probability that a spam email contains the word, and P(W|not S), the probability that a legitimate email contains the word. Then

根据历史数据,我们可以估计P(S)(整体垃圾邮件率)、P(W|S)(垃圾邮件包含该单词的概率)以及P(W|非S)(正常邮件包含该单词的概率)。那么

P(S|W) = P(W|S)P(S) / [P(W|S)P(S) + P(W|not S)P(not S)]

For example, if 20% of all emails are spam, 80% of spam emails contain "lottery", and only 5% of legitimate emails contain "lottery", then

例如,如果所有邮件中有20%是垃圾邮件,80%的垃圾邮件包含“lottery”,而只有5%的正常邮件包含“lottery”,那么

P(S|W) = (0.80 × 0.20) / (0.80 × 0.20 + 0.05 × 0.80) = 0.16 / 0.20 = 0.80

Thus an email containing "lottery" has an 80% probability of being spam. Modern filters combine many such words using a naive Bayes approach, treating each word as an independent piece of evidence.

因此,包含“lottery”的邮件有80%的概率是垃圾邮件。现代过滤器使用朴素贝叶斯方法结合许多这样的单词,将每个单词视为独立的证据。


7. Typical Application: Monty Hall Problem | 典型应用:蒙提霍尔问题

Bayes' Theorem also illuminates the famous Monty Hall problem. There are three doors: one has a car and two have goats. You pick a door, say Door 1. The host, who knows where the car is, opens another door, say Door 3, revealing a goat. Should you switch to Door 2?

贝叶斯定理也能阐明著名的蒙提霍尔问题。有三扇门:一扇后面有汽车,两扇后面是山羊。你选择一扇门,比如1号门。知道汽车位置的主持人打开另一扇门,比如3号门,露出一只山羊。你是否应该换到2号门?

Let Cᵢ be the event that the car is behind Door i, and let H₃ be the event that the host opens Door 3. We assume the host always opens a door with a goat, and if he has a choice, he chooses randomly. We want P(C₂|H₃).

设Cᵢ为汽车在i号门后面的事件,H₃为主持人打开3号门的事件。我们假设主持人总是打开一扇有山羊的门,并且如果他有选择,他会随机选择。我们要求P(C₂|H₃)。

Our prior is P(C₁) = P(C₂) = P(C₃) = 1/3. The host's opening probabilities are: P(H₃|C₁) = 1/2 (he could open Door 2 or 3), P(H₃|C₂) = 1 (he must open Door 3 because Door 2 has the car), and P(H₃|C₃) = 0 (he cannot open the door with the car).

先验是P(C₁) = P(C₂) = P(C₃) = 1/3。主持人打开门的概率为:P(H₃|C₁) = 1/2(他可以打开2号或3号门),P(H₃|C₂) = 1(因为2号门后有汽车,他必须打开3号门),P(H₃|C₃) = 0(他不能打开有汽车的门)。

By Bayes' Theorem:

由贝叶斯定理:

P(C₂|H₃) = P(H₃|C₂)P(C₂) / [P(H₃|C₁)P(C₁) + P(H₃|C₂)P(C₂) + P(H₃|C₃)P(C₃)]

= (1 × 1/3) / (1/2 × 1/3 + 1 × 1/3 + 0 × 1/3) = (1/3) / (1/6 + 1/3) = 2/3

Therefore switching to Door 2 gives a 2/3 chance of winning the car, while staying gives only 1/3. The host's action provides information that updates the probability.

因此换到2号门有2/3的概率赢得汽车,而坚持原选择只有1/3。主持人的行为提供了更新概率的信息。


8. Common Misconceptions and Pitfalls | 常见误解与易错点

One common mistake is confusing P(A|B) with P(B|A). In the medical example, many people think that a 95% sensitivity means a positive test implies a 95% chance of disease. This ignores the prior probability and the false positive rate.

一个常见错误是混淆P(A|B)与P(B|A)。在医疗例子中,许多人认为95%的灵敏度意味着检测阳性意味着95%的患病概率。这忽略了先验概率和假阳性率。

Another pitfall is forgetting to use the total probability in the denominator. Bayes' Theorem requires the denominator to be the sum of all possible ways B can occur, not just the numerator. Omitting any branch of the partition leads to incorrect answers.

另一个易错点是忘记在分母中使用全概率。贝叶斯定理要求分母是B发生的所有可能方式之和,而不仅仅是分子。省略划分的任何一支都会导致错误答案。

Students should also be careful with notation. Always define events clearly, check that the partition events are mutually exclusive and exhaustive, and verify that probabilities sum to 1. Drawing a tree diagram or a two-way table can help organise the information.

学生还应小心符号。始终明确定义事件,检查划分事件是否互斥且完备,并验证概率之和为1。画树状图或二维表有助于整理信息。


9. Exam Tips and Worked Structure | 考试技巧与答题结构

In IB exams, Bayes' Theorem questions often provide probabilities in words or tables. A reliable method is to convert the information into a tree diagram with the partition events as the first branches and the evidence event as the second branches.

在IB考试中,贝叶斯定理问题通常以文字或表格形式给出概率。一个可靠的方法是将信息转化为树状图,以划分事件为第一层分支,以证据事件为第二层分支。

When writing a solution, follow this structure:

写解答时,遵循以下结构:

Remember that the denominator is often the most challenging part. Always include it explicitly, even if you are using a calculator. This shows the examiner that you understand the underlying reasoning.

记住,分母通常是最具挑战性的部分。始终明确写出它,即使使用计算器也要写出。这向考官表明你理解了背后的推理。


10. Why Bayes' Theorem Matters | 贝叶斯定理的重要性

Bayes' Theorem is not just an abstract formula; it is the foundation of modern machine learning, medical diagnosis, financial risk assessment, and scientific reasoning. It formalises the idea that beliefs should be updated in light of evidence.

贝叶斯定理不仅仅是一个抽象公式;它是现代机器学习、医学诊断、金融风险评估和科学推理的基础。它将“信念应随证据更新”这一思想形式化。

In the IB syllabus, understanding the derivation from conditional probability and the law of total probability is essential, not just memorising the formula. This deep understanding allows you to adapt the theorem to a wide range of contexts, from genetics to economics.

在IB课程大纲中,理解从条件概率和全概率公式的推导是必要的,而不仅仅是记住公式。这种深入理解使你能够将定理应用于从遗传学到经济学的各种情境。

Practice with tree diagrams, tables, and real-world examples. The more you use Bayes' Theorem, the more intuitive it becomes. And the next time you see a surprising statistical claim, ask yourself: what is the prior, and what is the evidence?

多练习树状图、表格和现实世界例子。你越多使用贝叶斯定理,它就越直观。下次你再看到令人惊讶的统计说法时,问问自己:什么是先验,什么是证据?


Published by TutorHao | IB Mathematics Revision Series | aleveler.com

广告 / Sponsored
官网正版 国际课程数学核心词汇 唯寻国际教育 全英 学科 GCSE A Level IB MYP IB IBDP 美高…
数学 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥19.7

更多咨询请联系16621398022(同微信)

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao