📚 PDF资源导航

Bayes’ Theorem: Derivation and Applications in IB Mathematics | 贝叶斯定理的推导与应用

📚 Bayes’ Theorem: Derivation and Applications in IB Mathematics | 贝叶斯定理的推导与应用

Bayes’ Theorem is one of the most powerful and elegant results in probability theory. It allows us to revise our beliefs in light of new evidence, making it essential for IB Mathematics Analysis and Approaches (AA) and Applications and Interpretation (AI) students. In this article, we will derive the theorem step by step and explore its practical applications.

贝叶斯定理是概率论中最强大且最优美的结果之一。它使我们在获得新证据时能够修正原有的信念,是 IB 数学分析与方法(AA)以及应用与解释(AI)学生必须掌握的内容。本文将逐步推导该定理,并探讨它的实际应用。


1. Conditional Probability | 条件概率

Before deriving Bayes’ Theorem, we must recall the definition of conditional probability. For two events A and B, the conditional probability of A given B is written as P(A|B) and is defined as follows, provided P(B) > 0:

在推导贝叶斯定理之前,我们必须回顾条件概率的定义。对于两个事件 A 和 B,在给定 B 的条件下 A 的条件概率记为 P(A|B),其定义如下(要求 P(B) > 0):

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

This formula answers the question: “If we know that B has happened, what is the probability that A also happened?”

这个公式回答的问题是:“如果我们已知 B 发生了,那么 A 也发生的概率是多少?”


2. The Multiplication Rule | 乘法法则

Rearranging the definition of conditional probability gives the multiplication rule. It allows us to express the probability of both A and B occurring in two equivalent ways:

对条件概率的定义进行变形,可以得到乘法法则。它允许我们用两种等价的方式表示 A 和 B 同时发生的概率:

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

= P(A) × P(B|A)

Notice that the intersection is symmetric: A ∩ B is the same as B ∩ A. Equating these two expressions will form the heart of Bayes’ Theorem.

注意交集是对称的:A ∩ B 与 B ∩ A 相同。将两个表达式相等,就构成了贝叶斯定理的核心。


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

Suppose the sample space is partitioned into mutually exclusive events A₁, A₂, …, Aₙ. This means the events do not overlap and together they cover every possible outcome. For any event B, the law of total probability states:

假设样本空间被分割为互斥事件 A₁, A₂, …, Aₙ。这意味着这些事件互不重叠,并且合起来覆盖了所有可能的结果。对于任意事件 B,全概率公式表述为:

P(B) = Σᵢ P(Aᵢ) × P(B|Aᵢ)

Intuitively, we are finding the total probability of B by weighting each “path” to B through each Aᵢ.

直观上,我们通过每个 Aᵢ 到 B 的“路径”进行加权,从而求出 B 的总概率。


4. Deriving Bayes’ Theorem | 推导贝叶斯定理

We start from the two equivalent forms of the multiplication rule:

我们从乘法法则的两种等价形式出发:

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

Divide both sides by P(B), assuming P(B) > 0. This gives the simplest form of Bayes’ Theorem:

假设 P(B) > 0,在等式两边同时除以 P(B),得到贝叶斯定理的最简形式:

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

If we need a more detailed version, we replace P(B) using the law of total probability. Let {A₁, A₂, …, Aₙ} be a partition of the sample space, and let B be any event. Then for any particular Aₖ:

如果需要更详细的形式,我们可以用全概率公式替换 P(B)。设 {A₁, A₂, …, Aₙ} 是样本空间的一个分割,B 是任意事件。那么对于任意特定的 Aₖ:

P(Aₖ|B) = P(Aₖ) × P(B|Aₖ) / [ Σᵢ P(Aᵢ) × P(B|Aᵢ) ]

This is the complete form of Bayes’ Theorem. It updates the prior probability P(Aₖ) to the posterior probability P(Aₖ|B) after observing evidence B.

这就是贝叶斯定理的完整形式。它在观察到证据 B 后,将先验概率 P(Aₖ) 更新为后验概率 P(Aₖ|B)。


5. Terms: Prior, Likelihood, and Posterior | 先验概率、似然和后验概率

Bayes’ Theorem is often explained using three key terms:

贝叶斯定理通常通过三个关键术语来解释:

  • Prior probability P(Aₖ): the probability of event Aₖ before seeing the evidence.
  • Likelihood P(B|Aₖ): the probability of observing the evidence B given that Aₖ is true.
  • Posterior probability P(Aₖ|B): the updated probability of Aₖ after seeing the evidence.
  • 先验概率 P(Aₖ):在见到证据之前事件 Aₖ 的概率。
  • 似然 P(B|Aₖ):在 Aₖ 为真的条件下观察到证据 B 的概率。
  • 后验概率 P(Aₖ|B):在见到证据之后 Aₖ 被更新后的概率。

This terminology helps students understand that Bayes’ Theorem is a systematic method for learning from data.

这些术语帮助学生理解,贝叶斯定理是一种从数据中系统性学习的工具。


6. A Tree Diagram View | 树形图视角

Bayes’ Theorem can be visualised using a two-stage tree diagram. The first stage represents the prior partition A₁, A₂, …, Aₙ. The second stage represents the likelihood of B given each Aᵢ. To find P(Aₖ|B), we take the branch probability through Aₖ and B, and divide it by the sum of all branch probabilities that lead to B.

贝叶斯定理可以用两阶段树形图来直观展示。第一阶段表示先验分割 A₁, A₂, …, Aₙ,第二阶段表示在给定每个 Aᵢ 时 B 的似然。要求 P(Aₖ|B),我们取经过 Aₖ 和 B 的分支概率,再除以所有通向 B 的分支概率之和。

P(Aₖ|B) = (branch through Aₖ and B) / (sum of all branches reaching B)

This visual method often appears in IB exam questions, especially in paper 1 for AI and AA.

这种可视化方法经常出现在 IB 考试题目中,尤其是 AI 和 AA 的 Paper 1。


7. Application: Medical Testing | 应用:医学检测

Consider a disease that affects 1% of a population. A test for the disease has a 95% true positive rate and a 90% true negative rate. Let D mean “has the disease” and T+ mean “tests positive.” Then:

考虑一种影响 1% 人群的疾病。针对该疾病的检测具有 95% 的真阳性率和 90% 的真阴性率。设 D 表示“患病”,T+ 表示“检测结果呈阳性”。那么:

P(D) = 0.01, P(T+|D) = 0.95, P(T-|not D) = 0.90

We want to find P(D|T+), the probability that a person actually has the disease given a positive test result. First find P(T+) using the law of total probability:

我们要求 P(D|T+),即在检测结果呈阳性的条件下,此人真正患病的概率。首先用全概率公式求出 P(T+):

P(T+) = P(D)P(T+|D) + P(not D)P(T+|not D)

= 0.01 × 0.95 + 0.99 × 0.10 = 0.0095 + 0.099 = 0.1085

Now apply Bayes’ Theorem:

现在应用贝叶斯定理:

P(D|T+) = 0.01 × 0.95 / 0.1085 ≈ 0.0876

Surprisingly, only about 8.8% of positive test results are actually correct. This counterintuitive result is a classic example of Bayes’ Theorem at work.

令人惊讶的是,在阳性检测结果中,真正准确的只有约 8.8%。这个反直觉的结果是贝叶斯定理作用的经典例子。


8. Application: Spam Filtering | 应用:垃圾邮件过滤

Bayes’ Theorem is widely used in email spam filters. Suppose that 2% of all emails are spam, and the word “prize” appears in 80% of spam emails but only in 5% of non-spam emails. If an email contains the word “prize,” what is the probability that it is spam?

贝叶斯定理被广泛应用于电子邮件垃圾过滤器。假设 2% 的邮件是垃圾邮件,而单词“prize”出现在 80% 的垃圾邮件中,但只出现在 5% 的正常邮件中。如果一封邮件包含单词“prize”,那么它是垃圾邮件的概率是多少?

P(spam|prize) = P(spam)P(prize|spam) / [ P(spam)P(prize|spam) + P(normal)P(prize|normal) ]

Substituting the values:

代入数值:

P(spam|prize) = 0.02 × 0.80 / (0.02 × 0.80 + 0.98 × 0.05)

= 0.016 / (0.016 + 0.049) = 0.016 / 0.065 ≈ 0.246

Thus, even with the word “prize,” the email is still more likely to be legitimate. Real spam filters combine many words to improve accuracy.

因此,即使包含单词“prize”,该邮件仍然更可能是正常邮件。真实的垃圾邮件过滤器会结合大量词语来提高准确性。


9. Application: Hypothesis Updating | 应用:假设更新

In statistics, Bayes’ Theorem provides a framework for updating our belief in a hypothesis as more data becomes available. If H is a hypothesis and E is new evidence, then:

在统计学中,贝叶斯定理为随着更多数据出现而更新我们对某个假设的信念提供了一个框架。如果 H 是假设,E 是新证据,那么:

P(H|E) = P(H) × P(E|H) / P(E)

Here P(H) is the prior belief, P(E|H) is the likelihood of observing E if H is true, and P(H|E) is the posterior belief after seeing E.

这里 P(H) 是先验信念,P(E|H) 是在 H 为真时观察到 E 的似然,P(H|E) 是在看到 E 之后的后验信念。

This idea is central to Bayesian statistics, a growing field in IB AI statistics topics.

这个思想是贝叶斯统计的核心,也是 IB AI 统计主题中逐渐扩展的领域。


10. Common Mistakes and How to Avoid Them | 常见错误与避免方法

Many IB students confuse P(A|B) with P(B|A). For example, P(positive test | disease) is not the same as P(disease | positive test). Always check which event is the conditioning event.

许多 IB 学生混淆 P(A|B) 与 P(B|A)。例如,P(检测阳性 | 患病) 并不等于 P(患病 | 检测阳性)。始终要检查哪个事件是条件事件。

Another common mistake is forgetting to use the law of total probability for the denominator. You must include all possible ways that B can occur, not just one branch.

另一个常见错误是忘记使用全概率公式计算分母。你必须包含 B 发生的所有可能途径,而不仅仅是一个分支。

A good strategy is to draw a tree diagram, write down the probabilities on each branch, and label clearly before substituting into Bayes’ formula.

一个好的策略是先画出树形图,在每个分支上写出概率,并在代入贝叶斯公式前清楚地标记。


11. Worked Example from IB Style | IB 风格例题

In a certain school, 60% of students are female and 40% are male. Among female students, 30% study Mathematics HL; among male students, 20% study Mathematics HL. A student is chosen at random and is found to study Mathematics HL. Find the probability that this student is female.

某所学校有 60% 的学生是女生,40% 是男生。在女生中,30% 学习数学 HL;在男生中,20% 学习数学 HL。随机选择一名学生,发现其学习数学 HL。求这名学生是女生的概率。

Let F be “female,” M be “male,” and H be “studies Mathematics HL.” We want P(F|H). Using Bayes’ Theorem:

设 F 表示“女生”,M 表示“男生”,H 表示“学习数学 HL”。我们要求 P(F|H)。利用贝叶斯定理:

P(F|H) = P(F)P(H|F) / [ P(F)P(H|F) + P(M)P(H|M) ]

= 0.60 × 0.30 / (0.60 × 0.30 + 0.40 × 0.20)

= 0.18 / (0.18 + 0.08) = 0.18 / 0.26 ≈ 0.692

Thus about 69.2% of Mathematics HL students in this school are female.

因此,这所学校大约 69.2% 的数学 HL 学生是女生。


12. Summary and Exam Tips | 总结与考试建议

Bayes’ Theorem is a direct consequence of the definition of conditional probability and the law of total probability. It allows us to reverse the direction of conditioning:

贝叶斯定理是条件概率定义与全概率公式的直接推论。它允许我们逆转条件方向:

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

In IB exams, always write down the formula, show your substitution clearly, and check whether the answer makes sense. If a probability is unexpectedly low, revisit your calculations.

在 IB 考试中,始终写出公式,清楚地展示代入过程,并检查答案是否合理。如果概率低得出乎意料,请重新检查你的计算。

Mastering Bayes’ Theorem will give you a deeper understanding of probability and prepare you for both Paper 1 and Paper 2 questions, as well as the internal assessment (IA) if you choose a Bayesian topic.

掌握贝叶斯定理将让你对概率有更深刻的理解,并为 Paper 1 和 Paper 2 的题目以及内部评估(IA)做好准备,如果你选择贝叶斯相关课题的话。


Published by TutorHao | Mathematics Revision Series | aleveler.com

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

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version