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

Mastering Piecewise Probability Density Functions | 掌握分段概率密度函数

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

📚 Mastering Piecewise Probability Density Functions | 掌握分段概率密度函数

In A-Level Edexcel Statistics, continuous random variables are often described by probability density functions (PDFs). A particularly important skill is working with piecewise-defined PDFs – those built by joining different functional rules over adjacent intervals. These 'PDF joiner' scenarios appear frequently in exam questions, requiring you to determine constants, construct cumulative distribution functions, and find measures of central tendency and spread. This article breaks down every essential technique, from first principles to full worked examples, ensuring you can handle any piecewise PDF with confidence.

在爱德思 A-Level 统计中,连续随机变量通常由概率密度函数(PDF)描述。一项特别重要的技能是处理分段定义的 PDF——也就是将不同函数规则在相邻区间上进行“拼接”而得到的概率密度函数。这类“PDF 拼接”情境常出现在考试中,要求我们求出常数、构建累积分布函数,并确定中心趋势和离散程度的度量。本文将从基本原理到完整例题精讲,帮助你扎实掌握分段概率密度函数的每一项核心技巧。

1. What is a Probability Density Function (PDF)? | 什么是概率密度函数?

For any valid PDF, two conditions must hold: f(x) ≥ 0 for all x, and the total area under the curve equals 1, i.e. ∫ f(x) dx = 1 over the whole domain. The probability that X lies in an interval [a, b] is given by the definite integral ∫ₐᵇ f(x) dx.

概率密度函数 f(x) 是描述连续随机变量 X 取某一特定值的相对可能性的函数。对于任何有效的 PDF,必须满足两个条件:f(x) ≥ 0 对所有 x 成立,以及整个定义域上的曲线下总面积等于 1,即 ∫ f(x) dx = 1。X 落在区间 [a, b] 内的概率由定积分 ∫ₐᵇ f(x) dx 给出。


2. Defining a Piecewise PDF | 定义分段概率密度函数

given by different algebraic expressions on different subintervals of the random variable' = kx for 0 ≤ x ≤ 2, f(x) = k(4 − x) for 2 ≤ x ≤ 4, and f(x) = 0 otherwise. The function is 'joined' o form a triangular or trapezoidal shape, but the piecewise structure can be more general.

分段 PDF 是在随机变量定义域的不同子区间上由不同的代数表达式给出的。例如,随机变量 X 的 PDF 可以定义为:当 0 ≤ x ≤ 2 时 f(x) = kx,当 2 ≤ x ≤ 4 时 f(x) = k(4 − x),其余地方 f(x) = 0。函数在 x = 2 处“拼接”,常数 k 必须选择使得总面积等于 1。在考试情境中,这些函数常常会构成三角形或梯形的形状,但分段结构可以更加一般化。


3. Finding the Constant k | 求常数 k

F above, we split the integral at the join point: ∫₀² kx dx + ∫₂⁴ k(4 − x) dx = 1. Compute each integral separately, solve for k, and simplify. In this case, ∫₀² kx dx = k [½ x²]₀² = k (2) = 2k, and ∫₂⁴ k(4 − x) dx = k [4x − ½ x²]₂⁴ = k [(16 − 8) − (8 − 2)] = k (8 − 6) = 2k. The sum is 4k, so 4k = 1 ⇒ k = ¼.

为了求出未知常数 k,我们要利用总概率条件:f(x) 在整个定义域上的积分必须等于 1。对上述分段 PDF,我们在拼接点处将积分分开:∫₀² kx dx + ∫₂⁴ k(4 − x) dx = 1。分别计算每个积分,解出 k 并化简。在本题中,∫₀² kx dx = k [½ x²]₀² = k (2) = 2k,∫₂⁴ k(4 − x) dx = k [4x − ½ x²]₂⁴ = k [(16 − 8) − (8 − 2)] = k (8 − 6) = 2k。总和为 4k,因此 4k = 1 ⇒ k = ¼。

Always check that f(x) remains non-negative over the given intervals with the found k. Since k > 0 and the expressions kx and k(4 − x) are non-negative on their respective intervals, the condition is satisfied.

求出 k 后务必检查在给定区间上 f(x) 是否保持非负。由于 k > 0,且表达式 kx 与 k(4 − x) 在各自的区间上均非负,因此该条件已满足。


4. Checking Validity of a Piecewise PDF | 检验分段PDF的有效性

sity function. What matters is that the total area is 1 and that the function does not dip below zero. For the example above, f(2) = ½ from both sides, so it is even continuous, but continuity is not required. If a PDF consists of multiple constant segments, it is still valid as long as the area sum is 1. Always sketch the graph to visualise the shape and confirm consistency.

除了积分为 1 和非负性之外,有些分段 PDF 在拼接点可能存在间断,这对密度函数来说完全没问题。重要的是总面积为 1 且函数值不会降到零以下。对于上例,左右两侧的 f(2) 均为 ½,因此它甚至是连续的,但连续性并非必要条件。如果 PDF 由多个常数段组成,只要面积总和为 1 就仍然有效。建议始终绘制草图以直观看出形状并确认一致性。


5. Constructing the Cumulative Distribution Function (CDF) | 构建累积分布函数

we must define F(x) piecewise on the same intervals. For x < 0, F(x) = 0. For 0 ≤ x ≤ 2, F(x) = ∫₀ˣ dummy variable t. With k = ¼, F(x) = ¼ × ½ x² = ⅛ x². For 2 ≤ x ≤ 4, F(x) = P(X ≤ 2) + ∫₂ˣ t. Since P(X ≤ 2) = F(2) = ⅛ × 4 = ½, we add the integral to get F(x) = ½ + ¼ [4t − ½ t²]₂ˣ − 6). Simplify to obtain F(x) = ¼(4x − ½ x² − 6) + ½ = x − ⅛ x² − 1. For x > 4, F(x) = 1.

累积分布函数 F(x) = P(X ≤ x) 通过对 PDF 从定义域下界积分到 x 而得到。对于分段 PDF,必须在相同区间上分段定义 F(x)。当 x < 0 时,F(x) = 0。当 0 ≤ x ≤ 2 时,F(x) = ∫₀ˣ kt dt(使用哑变量 t)。代入 k = ¼,得到 F(x) = ¼ × ½ x² = ⅛ x²。当 2 ≤ x ≤ 4 时,F(x) = P(X ≤ 2) + ∫₂ˣ k(4 − t) dt。由于 P(X ≤ 2) = F(2) = ⅛ × 4 = ½,加上积分可得 F(x) = ½ + ¼ [4t − ½ t²]₂ˣ = ½ + ¼[(4x − ½ x²) − (8 − 2)] = ½ + ¼(4x − ½ x² − 6)。化简后得到 F(x) = ¼(4x − ½ x² − 6) + ½ = x − ⅛ x² − 1。当 x > 4 时,F(x) = 1。

ves 2 − ⅛ × 4 − 1 = 2 − 0.5 − 1 = 0.5. The smooth transition confirms correct integration.

务必检查分段 CDF 表达式在拼接点 x = 2 处的连续性:左侧极限为 ⅛ × 4 = 0.5,右侧公式给出 2 − ⅛ × 4 − 1 = 2 − 0.5 − 1 = 0.5。平滑过渡说明积分正确。


广告 / Sponsored

6. Calculating Probabilities Using Piecewise PDF | 使用分段PDF计算概率

. For example, P(1 < X < 3) splits across the join at x = 2: P(1 < X < 2) + P(2 < X < 3). Using the CDF, this is [F(2) − F(1)] + [F(3) − F(2)] = F(3) − F(1). Compute F(3) = 3 − ⅛ × 9 − 1 = 3 − 1.125 − 1 = 0.875, and F(1) = ⅛ × 1 = 0.125, so the probability is 0.75. Direct integration yields the same result.

要计算 X 落在某特定区间的概率,既可以直接对该区间上的 PDF 求积分,也可以通过 F(b) − F(a) 利用 CDF。例如,P(1 < X < 3) 在 x = 2 的拼接处分割为 P(1 < X < 2) + P(2 < X < 3)。利用 CDF,等于 [F(2) − F(1)] + [F(3) − F(2)] = F(3) − F(1)。计算 F(3) = 3 − ⅛ × 9 − 1 = 3 − 1.125 − 1 = 0.875,F(1) = ⅛ × 1 = 0.125,因此概率为 0.75。直接积分会得到相同结果。


7. Finding the Median and Quartiles | 求中位数和四分位数

dian m satisfies F(m) = 0.5. From the CDF, we know that F(2) = 0.5, so m = 2 is the median – y setting the piecewise CDF expression equal to 0.5 and solving for m. The lower quartile Q₁ satisfies F(Q₁) = 0.25; in our example, using 0 ≤ x ≤ 2 segment, ⅛ x² = 0.25 ⇒ x² = 2 ⇒ x = √2 pper quartile Q₃ satisfies F(Q₃) = 0.75; on the segment 2 ≤ x ≤ 4, set x − ⅛ x² − 1 = 0.75 ⇒ x − ⅛ x² = 1.75 ⇒ multiply by 8: 8x − x² = 14 ⇒ x² − 8x + 14 = 0, solving gives x = 4 − √2 ≈ 2.586 (taking the root within [2,4]).

中位数 m 满足 F(m) = 0.5。根据 CDF,F(2) = 0.5,因此 m = 2 即为中位数——由于该三角 PDF 的对称性,这是一个很整洁的结果。对于非对称分段 PDF,则必须在相应区间上令分段 CDF 表达式等于 0.5 并求解 m。下四分位数 Q₁ 满足 F(Q₁) = 0.25;在本例中,使用 0 ≤ x ≤ 2 段,⅛ x² = 0.25 ⇒ x² = 2 ⇒ x = √2 ≈ 1.414。上四分位数 Q₃ 满足 F(Q₃) = 0.75;在 2 ≤ x ≤ 4 段,令 x − ⅛ x² − 1 = 0.75 ⇒ x − ⅛ x² = 1.75 ⇒ 两边乘以 8:8x − x² = 14 ⇒ x² − 8x + 14 = 0,解得 x = 4 − √2 ≈ 2.586(取 [2,4] 内的根)。


8. Expectation and Variance of a Piecewise Random Variable | 分段随机变量的期望与方差

) dx + ∫₂⁴ x·(¼(4 − x)) dx. The first integral gives ¼ ∫₀² x² dx = ¼ [⅓ x³]₀² = ¼ × 8/3 = ⅔. The second: ¼ ∫₂⁴ x(4 − x) dx = ¼ ∫₂⁴ (4x − x²) dx = ¼ [2x² − ⅓ x³]₂⁴ = ¼[(32 − 64/3) − (8 − 8/3)] = ¼[(96/3 − 64/3) − (24/3 − 8/3)] = ¼[(32/3) − (16/3)] = ¼ × 16/3 = 4/3. Thus E(X) = ⅔ + 4/3 = 2, which matches the median due to symmetry.

均值或期望值 E(X) 通过对整个定义域计算 ∫ x f(x) dx 得到,同样在任何拼接点处分开积分。对本例,E(X) = ∫₀² x·(¼ x) dx + ∫₂⁴ x·(¼(4 − x)) dx。第一个积分给出 ¼ ∫₀² x² dx = ¼ [⅓ x³]₀² = ¼ × 8/3 = ⅔。第二个: 64/3) − (8 − 8/3)] = ¼[(96/3 − 64/3) − (24/3 − 8/3)] = ¼[(32/3) − (16/3)] = ¼ × 16/3 = 4/3。因此 E(X) = ⅔ + 4/3 = 2,与中位数一致,源于对称性。

¼ x⁴]₂⁴ = ¼[(256/3 − 64) − (32/3 − 4)] = ¼[(256/3 − 192/3) − (32/3 − 12/3)] = ¼[(64/3) − (20/3)] = ¼ × 44/3 = 11/3. So E(X²) = 1 + 11/3 = 14/3. Then Var(X) = E(X²) − [E(X)]² = 14/3 − 4 = 2/3.

为求方差,先计算 E(X²):E(X²) = ∫₀² x²·(¼ x) dx + ∫₂⁴ x²·(¼(4 − x)) dx。第一部分:¼ ∫₀² x³ dx = ¼ × ¼ × 16 = 1。第二部分: − (32/3 − 4)] = ¼[(256/3 − 192/3) − (32/3 − 12/3)] = ¼[(64/3) − (20/3)] = ¼ × 44/3 = 11/3。因此 E(X²) = 1 + 11/3 = 14/3,于是 Var(X) = E(X²) − [E(X)]² = 14/3 − 4 = 2/3。


9. Mode of a Piecewise Distribution | 分段分布的众数

um occurs at the join x = 2, where f(2) = ½. In more complex piecewise PDFs, the mode could lie inside one interval; then you differentiate the respective expression, set derivative to zero, and check the second derivative to confirm a maximum. Always compare the PDF values at any interval boundaries and at stationary points to determine the global maximum.

众数是使概率密度函数 f(x) 最大的 x 值。对于我们这个三角 PDF,f(x) 在 [0,2] 上线性增加,在 [2,4] 上线性减小,因此最大值出现在拼接点 x = 2 处,此处 f(2) = ½。在更复杂的分段 PDF 中,众数可能位于某个区间内部;此时需对相应表达式求导,令导数为零,并检查二阶导数以确认极大值。务必比较区间边界点以及任何驻点处的 PDF 取值,以确定全局最大值。


10. Worked Example – Edexcel Exam Style | Edexcel 典型例题详解

Here is a fully worked problem that mirrors the style seen in Edexcel A-Level Statistics exams.

以下是一道完整体现爱德思 A-Level 统计考试风格的例题详解。

A continuous random variable X has probability density function given by:

f(x) = { k(3x − x²) for 0 ≤ x ≤ 3, 0 otherwise }

Though not piecewise in the strict sense of multiple non-zero segments, this function can be analysed with the same tools. (a) Find the value of k. (b) Specify fully the cumulative distribution function F(x). (c) Calculate the median. (d) Find P(1 < X < 2).

虽然这并非严格意义上的多段非零分段函数,但可以使用相同的工具进行分析。(a) 求 k 的值。(b) 完整地给出累积分布函数 F(x)。(c) 计算中位数。(d) 求 P(1 < X < 2)。

rate: k [3/2 x² − ⅓ x³]₀³ = k [27/2 − 27/3] = k [27/2 − 9] = k [27/2 − 18/2] = k × 9/2 = 1 ⇒ k = 2/9.

(a) 利用 ∫₀³ k(3x − x²) dx = 1。积分:k [3/2 x² − ⅓ x³]₀³ = k [27/2 − 27/3] = k [27/2 − 9] = k [27/2 − 18/2] = k × 9/2 = 1 ⇒ k = 2/9。

(b) For 0 ≤ x ≤ 3, F(x) = ∫₀ˣ (2/9)(3t − t²) dt = (2/9) [3/2 t² − ⅓ t³]₀ˣ /27. Thus F(x) = 0 for x < 0, F(x) = (9x² − 2x³)/27 for 0 ≤ x ≤ 3, and F(x) = 1 for x > 3.

(b) 当 0 ≤ x ≤ 3 时,F(x) = ∫₀ˣ (2/9)(3t − t²) dt = (2/9) [3/2 t² −

Published by TutorHao | A-Level Mathematics Revision Series | aleveler.com

广告 / Sponsored
官网正版 机械制图及计算机绘图习题集 徐文胜 普通高等教育十三五规划教材 9787111505105 机械工业出版社 …
计算机 备考教辅 · 正版现货 · 与本文同科同级别
查看详情 / View on Taobao参考价 ¥37.7

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

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