📚 Finding the Cumulative Probability Function | 求解累积概率函数
In statistics, the cumulative distribution function (CDF), also called the cumulative probability function, gives the probability that a random variable X takes a value less than or equal to a given x. Understanding how to find the CDF from a probability mass function (PMF) or a probability density function (PDF) is a fundamental skill in the IB and Cambridge A-level mathematics curriculum. This article guides you through the core concepts, step-by-step methods, and common pitfalls when working with cumulative probability functions.
在统计学中,累积分布函数(CDF),也称为累积概率函数,给出了随机变量 X 取值小于或等于某个给定 x 的概率。理解如何从概率质量函数(PMF)或概率密度函数(PDF)求出累积分布函数,是 IB 和剑桥 A-level 数学课程的一项基本技能。本文将指引你掌握累积概率函数的核心概念、逐步方法以及常见错误。
1. What is a Cumulative Distribution Function? | 什么是累积分布函数?
hes 1 as x → ∞. The CDF fully describes the probability distribution of a random variable.
随机变量 X 的累积分布函数 F(x) 定义为 F(x) = P(X ≤ x)。它将概率从左端可能的取值一直累加到 x。对于任意实数 x,F(x) 是一个非递减函数,从 0 开始,并当 x → ∞ 时趋近于 1。CDF 完整地描述了一个随机变量的概率分布。
2. Discrete vs Continuous CDFs: Key Differences | 离散与连续 CDF 的关键区别
les, the CDF is a smooth curve obtained by integrating the probability density function from the lower bound to x. The table below summarises the main differences.
对于离散随机变量,CDF 是一个阶跃函数,通过将所有 ≤ x 的结果概率相加来计算。对于连续随机变量,CDF 是一条光滑的曲线,通过从下限到 x 对概率密度函数积分得到。下表总结了主要区别。
| Property | Discrete CDF | Continuous CDF |
|---|---|---|
| Definition | F(x) = Σ P(X = xᵢ) for all xᵢ ≤ x | F(x) = ∫₋∞ˣ f(t) dt |
| Appearance | Step function with jumps | Continuous non-decreasing curve |
| Derivative | Not directly (PMF is difference) | f(x) = F'(x) almost everywhere |
| Probability of interval | P(a < X ≤ b) = F(b) − F(a) | P(a < X ≤ b) = F(b) − F(a) |
3. CDF for Discrete Random Variables: Summation Method | 离散随机变量的 CDF:求和法
ints and jumps at each value xᵢ by an amount equal to P(X = xᵢ). Always express F(x) as a piecewise function.
给定所有可能取值的概率质量函数 P(X = x),将取值按升序排列:x₁ < x₂ < x₃ < ... 。那么对于 x < x₁,F(x) = 0;在相邻取值之间的每个区间,F(x) 等于截至该点的概率之和。CDF 在离散点之间保持不变,并在每个取值 xᵢ 处跳跃,跳跃量为 P(X = xᵢ)。务必用分段函数来表示 F(x)。
For example, suppose a discrete random variable X has the following distribution:
例如,假设一个离散随机变量 X 具有如下分布:
| x | 1 | 2 | 3 |
|---|---|---|---|
| P(X=x) | 0.2 | 0.5 | 0.3 |
Then the CDF is:
那么 CDF 为:
F(x) = 0, x < 1
F(x) = 0.2, 1 ≤ x < 2
F(x) = 0.7, 2 ≤ x < 3
F(x) = 1, x ≥ 3
oint x=2, F(2)=0.7. In IB and Cambridge exams, clarity on the inequality signs is crucial.
注意闭区间和开区间的约定很重要:通常 F(x) = P(X ≤ x),所以在点 x=2 处,F(2)=0.7。在 IB 和剑桥考试中,不等号写清楚至关重要。
4. CDF for Continuous Random Variables: Integration Method | 连续随机变量的 CDF:积分法
e cumulative distribution function is obtained by integrating f(t) from the lower limit up to x. That is, for any x in [a, b]:
当你给定一个定义在区间 [a, b] 上的概率密度函数 f(x)(其他地方 f(x)=0),累积分布函数可以通过将 f(t) 从下限积分到 x 得到。即对于 [a, b] 中的任意 x:
F(x) = ∫ₐˣ f(t) dt
s essential to handle the piecewise nature carefully: integrate f(t) over the region where it is non-zero, and then combine conditions to write F(x) as a single piecewise function.
对于 x < a,F(x) = 0;对于 x > b,F(x) = 1。仔细处理分段性质至关重要:在 f(t) 非零的区域内积分,然后合并条件,将 F(x) 写成一个完整的分段函数。
(x) is continuous and non-decreasing. If f(x) is defined in separate subintervals, break the integral accordingly.
务必验证 F(b) = 1,并且 F(x) 连续且非递减。如果 f(x) 定义在多个子区间内,需相应地分段积分。
5. Step-by-Step: From PDF to CDF | 逐步操作:从 PDF 到 CDF
Follow this reliable routine to avoid errors when finding F(x) from f(x):
遵循以下可靠流程,以避免从 f(x) 求 F(x) 时出错:
- Step 1: Identify the domain where f(x) > 0. Record the lower bound (often a constant a).
步骤1:确定 f(x) > 0 的定义域,记录下限(通常为常数 a)。 - Step 2: For x in the main domain, write F(x) = ∫ₐˣ d perform the integration. Use a dummy variable t to avoid confusion with the upper limit.
步骤2:对于主定义域内的 x,写出 F(x) = ∫ₐˣ f(t) dt 并执行积分。使用哑变量 t 以避免与上限混淆。 - Step 3: For x below the main domain, F(x) = 0. For x above it, F(x) = 1.
步骤3:对于主定义域以下的 x,F(x) = 0;对于之上的 x,F(x) = 1。 - Step 4: If f(x) has multiple non-zero pieces, integrate each segment separately and ensure continuity at the boundaries. The total probability must be 1.
步骤4:如果 f(x) 有多个非零分段,分别积分每一段,并确保边界处连续。总概率必须为 1。 - Step 5: Write the final answer as a clearly labeled piecewise function with correct inequality boundaries.
步骤5:将最终答案写成一个标注清晰、不等式边界正确的分段函数。
Example: f(x) = 3x² for 0 < x < 1. Then for 0 < x < 1, F(x) = ∫₀ˣ 3t² dt = [t³]₀ˣ = x³. So F(x) = 0 for x ≤ 0, x³ for 0 < x < 1, and 1 for x ≥ 1.
例子:f(x) = 3x²,0 < x < 1。那么对于 0 < x < 1,F(x) = ∫₀ˣ 3t² dt = [t³]₀ˣ = x³。因此当 x ≤ 0 时 F(x)=0,当 0 < x < 1 时 F(x)=x³,当 x ≥ 1 时 F(x)=1。
6. Handling Piecewise PDFs | 处理分段 PDF
< 2; 0 otherwise }. To find F(x) for x in [1,2), you first integrate f(t) from 0 to 1, then add the integral from 1 to x. The cumulative probability up to 1 forms the baseline for the second piece.
当 f(x) 在两个或更多子区间上定义不同时,你必须分阶段积分。例如,假设 f(x) = { ½ 当 0 ≤ x < 1;(x/2) + ½ 当 1 ≤ x < 2;否则为 0 }。要求 x 在 [1,2) 内的 F(x),你先对 f(t) 从 0 到 1 积分,再加上从 1 到 x 的积分。截至 1 的累积概率构成第二段的基准。
Always calculate the accumulated probability at each breakpoint to ensure the CDF matches. Do not forget to evaluate the constant of integration correctly when using indefinite integrals: the CDF must be zero at the lower bound of the entire domain.
始终计算每个断点处的累积概率,以确保 CDF 对齐。使用不定积分时,不要忘记正确计算积分常数:在整个定义域的下限处,CDF 必须为零。
7. Properties of a Valid CDF | 有效 CDF 的性质
Every cumulative distribution function F(x) must satisfy these requirements:
每个累积分布函数 F(x) 必须满足以下要求:
- Limits: limₓ→₋∞ F(x) = 0 and limₓ→∞ F(x) = 1.
极限:limₓ→₋∞ F(x) = 0 且 limₓ→∞ F(x) = 1。 - Non-decreasing: If x₁ < x₂, then F(x₁) ≤ F(x₂).
非递减性:若 x₁ < x₂,则 F(x₁) ≤ F(x₂)。 - Right-continuous: ) = limₜ→ₓ⁺ F(t). This is especially important for discrete CDFs where the function jumps.
右连续:对每个 x,F(x) = limₜ→ₓ⁺ F(t)。这对于有跳跃的离散型 CDF 尤其重要。 - Probability of an interval: P(a < X ≤ b) = F(b) − F(a). For continuous variables, P(a < X < b) = F(b) − F(a).
区间概率:P(a < X ≤ b) = F(b) − F(a)。对于连续变量,P(a < X < b) = F(b) − F(a)。
Actively checking these properties serves as a powerful validation tool, especially in exam settings.
主动检查这些性质是强有力的验证工具,尤其在考试中。
8. Finding the PDF from the CDF (Differentiation) | 从 CDF 求 PDF(微分)
re the CDF is differentiable, the probability density function is the derivative: f(x) = F' rences: P(X = xᵢ) = F(xᵢ) − F(xᵢ⁻). Knowing both directions solidifies your understanding.
在 CDF 可微之处,概率密度函数就是其导数:f(x) = F'(x)。对于分段 CDF,在每个开区间内分别微分。在 F(x) 有折点或跳跃处(离散情形),导数不存在或不能直接得到 PDF;对于离散变量,概率质量通过求差得到:P(X = xᵢ) = F(xᵢ) − F(xᵢ⁻)。掌握双向推导能够巩固你的理解。
9. Worked Example: Discrete Random Variable | 例题解析:离散随机变量
A biased die has faces 1, 2, 3 with probabilities 0.1, 0.3, 0.6 respectively. Find the cumulative probability function F(x).
一枚不均匀的骰子有 1、2、3 三个面,概率依次为 0.1、0.3、0.6。求累积概率函数 F(x)。
2 ≤ x < 3; F(x) = 0.1+0.3+0.6 = 1 for x ≥ 3. Always write the piecewise definition neatly.
解答:将取值排序:x = 1,2,3。当 x < 1 时 F(x)=0;1 ≤ x < 2 时 F(x)=0.1;2 ≤ x < 3 时 F(x)=0.4;x ≥ 3 时 F(x)=1。务必工整地写出分段定义。
10. Worked Example: Continuous Random Variable with Two Pieces | 例题解析:双段连续随机变量
Given f(x) = { kx for 0 ≤ x < 2; k(4-x) for 2 ≤ x ≤ 4; 0 otherwise }.
已知 f(x) = { kx 当 0 ≤ x < 2;k(4-x) 当 2 ≤ x ≤ 4;否则为 0 }。
First find k by ensuring total area =1. Then derive F(x) for each interval.
首先通过确保总面积为 1 求出 k。然后对每个区间推导 F(x)。
Area = ½×2×2k + ½×2×2k = 2k + 2k = 4k = 1 → k = ¼. Now, For 0 ≤ x < 2: F(x) = ∫₀ˣ (t/4) dt = x²/8. For 2 ≤ x ≤ 4: F(x) = F(2) + ∫₂ˣ (4−t)/4 dt = ½ + [t − t²/8]₂ˣ ck: F(4)=1. So final CDF: F(x)=0 for x<0; x²/8 for 0≤x<2; 1−(4−x)²/8 for 2≤x≤4; 1 for x>4.
面积 = ½×2×2k + ½×2×2k = 4k = 1 → k = ¼。当 0 ≤ x < 2:F(x) = ∫₀ˣ (t/4) dt = x²/8。当 2 ≤ x ≤ 4:F(x) = F(2) + ∫₂ˣ (4−t)/4 dt = ½ + [t − t²/8]₂ˣ = … 化简为 1 − (4−x)²/8。检验:F(4)=1。因此最终 CDF:x<0 时 F(x)=0;0≤x<2 时 F(x)=x²/8;2≤x≤4 时 F(x)=1−(4−x)²/8;x>4 时 F(x)=1。
11. Using CDF to Find Median and Quartiles | 利用 CDF 求中位数和四分位数
ous variables, you often solve a polynomial or transcendental equation within the relevant domain. Make sure the solution lies in the interval where that piece of F(x) is defined.
中位数 m 满足 F(m) = 0.5。下四分位数 Q₁ 满足 F(Q₁) = 0.25,上四分位数 Q₃ 满足 F(Q₃) = 0.75。对于所需的 p,解方程 F(x) = p。对于连续变量,你通常需要在相关定义域内求解多项式或超越方程。确保解落在 F(x) 那段定义所在的区间内。
Example: For the PDF f(x)=2x/9 for 0
例子:对于 PDF f(x)=2x/9(0
12. Common Mistakes and Exam Tips | 常见错误与考试提示
Many students lose marks by not writing F(x) as a piecewise function, omitting the "0 otherwise" For discrete CDFs, remember that F(x) is defined for all real x, not just the mass points.
许多学生因未将 F(x) 写成分段函数、遗漏“否则为 0”的部分,或混淆不等号而失分。在连续情形中,忘记检查边界连续性会导致无效的 CDF。务必复核 F(上界) = 1。对于离散 CDF,切记 F(x) 对所有实数 x 都有定义,而不仅仅是概率质点。
exponential distribution), handle limits correctly: F(x) = 0 for x < 0, and F(x) = 1 − e⁻λˣ for x ≥ 0.
同样,绝不要将 F(x) 写成 ∫ f(x) dx 且内外变量相同;应使用哑变量 t。当 PDF 含参数 k 时,首先利用总面积为 1 求出 k,然后在积分中使用该 k。当定义域无界时(如指数分布),正确处理极限:x<0 时 F(x)=0,x≥0 时 F(x) = 1 − e⁻λˣ。
Finally, practice reading CDF graphs: a horizontal segment means probability zero in that interval, a jump means a point mass.
最后,请练习阅读 CDF 图形:水平段意味着该区间概率为零,跳跃意味着概率质点。
Published by TutorHao | Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图