跳到主要内容

東京大学 情報理工学系研究科 コンピュータ科学専攻 2019年8月実施 専門科目II 問題5

Author

祭音Myyura (co-authored with GPT 5.6 SOL)

Description

Suppose that f(x)f(x) is a real function defined on a closed interval from aa to bb (a<b)(a < b). Suppose that nn is an integer that is no less than 2, and define h=(ba)/nh = (b - a)/n. Then, for each integer i=0,1,,ni = 0, 1, \ldots, n, define xi=a+ihx_i = a + ih and fi=f(xi)f_i = f(x_i), respectively. Namely, x0,,xnx_0, \ldots, x_n are the points that divide the interval from aa to bb into nn equal parts, and fif_i is the value of the function f(x)f(x) at x=xix = x_i.

Next, define J=abf(x)dxJ = \int_a^b f(x) \, \mathrm{d}x, and define JnJ_n as the approximate value calculated by the composite trapezoid rule applied on JJ using the points which divide the interval from aa to bb into nn equal parts.

Answer the following questions.

(1) Assume that f(x)f(x) is a four times continuously differentiable function. Let kk be an integer such that 0<k<n0 < k < n and define fkf_k'' as the second order differential of f(x)f(x) at xkx_k. Express an approximate value of fkf_k'' whose error is O(h2)O(h^2), as a linear combination of fk1,fkf_{k-1}, f_k, and fk+1f_{k+1}.

(2) The approximation obtained by question (1) seems to become accurate when hh approaches zero. Answer, with a reason, whether this is correct or not in the calculation with the IEEE 754 double precision floating point operations.

(3) Express JnJ_n using n,hn, h, and fif_i (i=0,,n)(i = 0, \ldots, n).

(4) Assume that f(x)f(x) can be expressed by a quadratic function in each interval formed by the division into nn equal parts. Then, define J2nJ_{2n} similarly using the division into 2n2n equal parts composed of the division of each original part into two halves. Express En=JnJE_n = J_n - J using J2nJ_{2n} and JnJ_n.

题目描述

设实函数 f(x)f(x) 定义在闭区间 [a,b][a,b] 上,a<ba<b。取整数 n2n\ge2, 令 h=(ba)/nh=(b-a)/n;对 i=0,1,,ni=0,1,\ldots,n,定义 xi=a+ihx_i=a+ihfi=f(xi)f_i=f(x_i)。于是 x0,,xnx_0,\ldots,x_n 将区间等分为 nn 份。再令

J=abf(x)dx,J=\int_a^b f(x)\,\mathrm dx,

并以 JnJ_n 表示在这些等分点上使用复合梯形公式得到的近似值。回答下列问题。

(1)假设 ff 四阶连续可微。对整数 0<k<n0<k<n,用 fk1,fk,fk+1f_{k-1},f_k,f_{k+1} 的线性组合给出 f(xk)f''(x_k) 的一个误差为 O(h2)O(h^2) 的近似式。

(2)第(1)问的近似看似会在 h0h\to0 时不断变精确。说明在 IEEE 754 双精度浮点运算中这一说法是否正确,并给出理由。

(3)用 n,hn,h 以及 fi (i=0,,n)f_i\ (i=0,\ldots,n) 表示复合梯形近似 JnJ_n

(4)假设 ff 在每个原等分小区间上均可由二次函数表示。把每一小区间再二等分,类似定义使用 2n2n 等分的 J2nJ_{2n}。用 J2nJ_{2n}JnJ_n 表示误差 En=JnJE_n=J_n-J

Kai

(1)

xkx_k 两侧作 Taylor 展开并相加,奇数阶项抵消,得

fk12fk+fk+1=h2f(xk)+O(h4).f_{k-1}-2f_k+f_{k+1}=h^2f''(x_k)+O(h^4).

所以所求近似为

f(xk)=fk12fk+fk+1h2+O(h2).\boxed{f''(x_k)=\frac{f_{k-1}-2f_k+f_{k+1}}{h^2}+O(h^2).}

(2)

不一定。三项相消后的分子只有 O(h2)O(h^2),而函数值的浮点舍入误差经除以 h2h^2 被放大。典型总误差为

O(h2)+O(uF/h2),O(h^2)+O(uF/h^2),

其中 uu 是单位舍入误差,FF 表示函数值的尺度。hh 过小时舍入误差可能占主导,甚至 xk±hx_k\pm h 被舍入成 xkx_k,因此不能无限减小 hh 来提高精度。

(3)

Jn=h2(f0+2i=1n1fi+fn).\boxed{J_n=\frac h2\left(f_0+2\sum_{i=1}^{n-1}f_i+f_n\right).}

(4)

对每段二次函数,梯形公式的单段误差为 fh3/12f''h^3/12;二等分后两段误差之和为原来的 1/41/4。逐段相加得 E2n=En/4E_{2n}=E_n/4,因此

JnJ2n=EnE2n=34En,En=43(JnJ2n).J_n-J_{2n}=E_n-E_{2n}=\frac34E_n, \qquad \boxed{E_n=\frac43(J_n-J_{2n}).}

在题设“每段为二次函数”的条件下,这是精确等式。