计算方法引论课后答案

合集下载

计算方法_课后习题答案

计算方法_课后习题答案

(4.5)(0.01172)

0.00879
(2)采用 Newton 插值多项式 y x N2(x) 根据题意作差商表:
i
xi
0
4
1
6.25
f (xi ) 2 2.5
一阶差商 2 9
2
9
3
2 11
二阶差商 4 495
N2 (7) 2 29 (7 4) ( 4 495) (7 4) (7 6.25) 2.6484848

1
e2
则根据二次Lagrange插值公式得:
L2 (x)

(x ( x0

x1)(x x2 ) x1)(x0 x2 )
y0

(x ( x1

x0 )(x x2 ) x0 )(x1 x2 )
y1

(x ( x2

x0 )(x x1) x0 )(x2 x1)
y2
2(x 1)(x 0.5) 2x(x 0.5)e1 4x(x 1)e0.5
8. 求作 f x xn1 关于节点 xi i 0,1, , n 的 Lagrange 插值多项式,并利用
插值余项定理证明
n
n
xin1li 0 1n xi
i0
i0
式中 li x 为关于节点 xi i 0,1, , n 的 Lagrange 插值基函数。
2 02 12 4 23 4 04 14 2 3
1 x2 3x 2 x 4 3x x2 6x 8 23 x x2 5x 4 1 x x2 3x 2
8
4
8

计算方法第三章习题答案

计算方法第三章习题答案

计算方法第三章习题答案计算方法第三章习题答案计算方法是一门涵盖了数值计算和计算机编程的学科,它在现代科学和工程中扮演着重要的角色。

第三章是计算方法课程中的重要章节,主要涉及到数值计算中的误差分析和插值方法。

本文将为大家提供第三章习题的详细答案,帮助读者更好地理解和应用这些概念。

1. 误差分析误差分析是计算方法中非常重要的一部分,它帮助我们理解和评估数值计算中的误差来源。

以下是一些常见的误差类型:- 绝对误差:绝对误差是指数值计算结果与真实值之间的差异。

它可以通过计算两者之差来得到。

- 相对误差:相对误差是指绝对误差与真实值之间的比值。

通常以百分比的形式表示。

- 截断误差:截断误差是由于在计算过程中舍入或截断数字而引入的误差。

它通常是由于计算机的有限精度导致的。

- 舍入误差:舍入误差是由于将无限位数的小数截断为有限位数而引入的误差。

它通常是由于计算机的有限精度或计算方法的近似性质导致的。

2. 插值方法插值方法是一种用于通过已知数据点来估计未知数据点的技术。

以下是一些常见的插值方法:- 线性插值:线性插值是一种简单的插值方法,它假设两个已知数据点之间的未知数据点的取值在直线上。

通过已知数据点的斜率和截距,我们可以计算出未知数据点的值。

- 拉格朗日插值:拉格朗日插值是一种使用多项式来逼近已知数据点的方法。

它通过构造一个满足通过已知数据点的多项式来估计未知数据点的值。

- 牛顿插值:牛顿插值是一种使用差商来逼近已知数据点的方法。

它通过构造一个满足通过已知数据点的差商多项式来估计未知数据点的值。

3. 习题答案以下是一些第三章习题的答案,供大家参考:- 习题1:已知函数f(x)在区间[a, b]上连续,且在[a, b]上的导数存在且连续,证明存在一点c∈(a, b),使得f(b) - f(a) = (b - a)f'(c)。

这是拉格朗日中值定理的一个特例,根据定理的条件,我们可以得到上述结论。

- 习题2:已知函数f(x)在区间[a, b]上连续,且在(a, b)内可导,证明存在一点c∈(a, b),使得f'(c) = (f(b) - f(a))/(b - a)。

《计算方法引论》-徐翠微主编

《计算方法引论》-徐翠微主编

《计算方法引论》-徐翠微主编2009 ~ 2010学年第一学期计算方法教案计0701-0703 4h第二章插值法知识点:拉格朗日插值法,牛顿插值法,余项,分段插值。

实际问题中,时常不能给出f(x)的解析表达式或f(x)解析表达式过于复杂而难于计算,能采集的只是一些f(x)的离散点值{xi,f(xi)}(i=0,1,2,…n)。

因之,考虑近似方法成为自然之选。

定义:设f(x)为定义在区间[a,b]上的函数,x0,x1,…,xn为[a,b]上的互异点,yi=f(xi)。

若存在一个简单函数,(x),满足(插值条件),(xi)=f(xi),i=0,1,…,n。

则称 ,(x)为f(x)插值函数,f(x)为被插函数,点x0,x1,…,xn为插值节点,点{xi,f(xi)},i=0,1,2,…n为插值点。

于是计算f(x)的问题就转换为计算 ,(x)。

构造插值函数需要解决:插值函数是否存在唯一;插值函数如何构造(L插值);插值函数与被插函数的误差估计和收敛性。

对插值函数 ,(x)类型有多种不同的选择,代数多项式常被选作插值函数。

P23(2.18)和(2.19)指出,存在唯一的满足插值条件的n次插值多项式p(x)。

但是需要计算范德蒙行列式,构造插值多n项式工作量过大,简单表达式不易得到,实际中不采用这类方法。

p(x)?f(x) n插值法是一种古老的数学方法,拉格朗日(Lagrange)、牛顿(Newton)等分别给出了不同的解决方法。

拉格朗日插值拉格朗日(Lagrange)插值的基本思想:把插值多项式p(x)的构造问题转化为n+1个插值基函数l(x)(i=0,1,…,n)的ni构造。

(1)线性插值?构造插值函数已知函数y=f(x)的两个插值点(x,y),(x,y),构造多项式y=p(x),使p(x)=y,p(x)=y。

001111001111 《计算方法引论》、徐翠薇,高等教育出版社 2008年4月第三版第二章Lagrange插值法2009 ~ 2010学年第一学期计算方法教案计0701-0703 4h由直线两点式可知,通过A,B的直线方程为, y y 1 0 , , , y y ,, x x p ( x ) + 0 0 1 , x x 1 0变形为 x-x0 x-x1 y 1, , p(x) y 10 x1-x0 x0-x1记 x-x0 x-x1 , l(x) , l(x) 10 x1-x0 x0-x1则p(x)=l(x)y+l(x)y10011插值完毕~注意性质:l(x)=l(x)=1,l(x)=l(x)=0,p(x)=y,p(x)=y。

计算方法习题答案

计算方法习题答案

计算方法习题答案在数学和工程领域,计算方法是指解决数学问题的一系列算法和程序。

以下是一些常见的计算方法习题及其答案。

习题1:求解线性方程组考虑线性方程组:\[ \begin{align*}3x + 2y &= 7, \\4x - y &= 5.\end{align*} \]答案:使用高斯消元法,我们首先将第二个方程乘以2,然后从第一个方程中减去得到:\[ \begin{align*}3x + 2y &= 7, \\0x + 9y &= 17.\end{align*} \]解得 \( y = \frac{17}{9} \)。

将 \( y \) 的值代入第一个方程,解得 \( x = 1 \)。

因此,解为 \( x = 1, y = \frac{17}{9} \)。

习题2:数值积分给定函数 \( f(x) = x^2 \),求在区间 [0, 1] 上的积分。

答案:使用梯形法则进行数值积分,取两个子区间:\[ \int_{0}^{1} x^2 dx \approx \frac{1}{2} \left( f(0) + f(1) \right) = \frac{1}{2} \left( 0 + 1 \right) = 0.5. \]习题3:求解常微分方程的初值问题考虑初值问题:\[ y' = 3x^2 - 2y, \quad y(0) = 1. \]答案:使用欧拉方法,取步长 \( h = 0.1 \),计算 \( y \) 的值:\[ y_{n+1} = y_n + h f(x_n, y_n). \]从 \( y_0 = 1 \) 开始,计算得到:\[ y_1 = 1 + 0.1(0 - 2) = 1.2, \]\[ y_2 = 1.2 + 0.1(0.01 - 2.4) = 1.4, \]以此类推,可以得到 \( y \) 在区间 [0, 1] 上的近似值。

习题4:数值解非线性方程给定方程 \( f(x) = x^3 - x - 1 = 0 \),求根。

计算方法 课后习题答案

计算方法 课后习题答案
解:因为第一列中10最大,因此把10作为列主元素
得到方程组
3。举例说明一个非奇异矩阵不一定存在LU分解。
例如:设
与题设相矛盾,所以一个非奇异矩阵不一定存在LU分解。
4。下列矩阵能否分解为LU(其中L为单位下三角矩阵,U为上三角矩阵)?若能分解,那么分解是否唯一?
解:
设 B可以进行LU分解,则B=
计算得
其中。 。
解:(1)由题意,可设 ,由Lagrange插值余项公式得
(2)由(1)式可知,
15.给定数据表:
1
0
2
3
构造出函数 的差商表,并写出它的三次 插值多项式.
解:利用Newton插值公式:
先作出差商表
一阶差商
二阶差商
三阶差商
0
1
3
1
3/2
13/4
1/2
2
0
3
1/6
1/3
3
2
5/3
-2/3
-5/3
证明:据题4可知,
令 ,则有 。注意到
(证明见王能超数值简明教程145页题6)
令 即有 。
9.已知 ,求差商 和 。
解:根据差商与微商的关系,有
10.已知 互异,求 。其中 。(此题有误。)(见王能超《教程》P149-题2)
解:因为 ,则
由差商性质 可知,
11.设首项系数为1的n次式 有n个互异的零点 ,证明
解:1)用梯形公式有:
事实上,
2)Simpson公式
事实上,
3)由Cotes公式有:
事实上,
2.证明Simpson公式 具有三次代数精度。
证明:
而当 时
左侧:
右侧:

计算方法:第4章习题答案

计算方法:第4章习题答案

第四章 习题答案1。

用Gauss 消去法解方程组12312312323463525433032x x x x x x x x x ++=⎧⎪++=⎨⎪++=⎩ 解:方程组写成矩阵形式为12323463525433032x x x ⎛⎫⎛⎫⎛⎫ ⎪ ⎪ ⎪= ⎪ ⎪ ⎪ ⎪ ⎪ ⎪⎝⎭⎝⎭⎝⎭对其进行Gauss 消去得123234414726002x x x ⎛⎫⎛⎫⎛⎫⎪ ⎪ ⎪ ⎪-= ⎪ ⎪ ⎪ ⎪ ⎪ ⎪⎝⎭⎝⎭-⎝⎭得方程组12312323323461314482224x x x x x x x x x ++=⎧=-⎧⎪⎪⎪-=-⇒=⎨⎨⎪⎪=⎩-=-⎪⎩ 2。

用Gauss 列主元素消去法解方程组1233264107075156x x x -⎛⎫⎛⎫⎛⎫ ⎪ ⎪ ⎪-= ⎪ ⎪ ⎪ ⎪ ⎪ ⎪-⎝⎭⎝⎭⎝⎭ 解:因为第一列中10最大,因此把10作为列主元素1233264107075156x x x -⎛⎫⎛⎫⎛⎫ ⎪ ⎪ ⎪-= ⎪ ⎪ ⎪ ⎪ ⎪ ⎪-⎝⎭⎝⎭⎝⎭12r r ↔−−−→1231070732645156x x x -⎛⎫⎛⎫⎛⎫ ⎪ ⎪ ⎪-= ⎪ ⎪ ⎪ ⎪ ⎪ ⎪-⎝⎭⎝⎭⎝⎭21311310122310707161061010550522r r r r x x x +-⎛⎫⎛⎫ ⎪ ⎪-⎛⎫ ⎪ ⎪ ⎪ ⎪ ⎪−−−→-= ⎪ ⎪ ⎪ ⎪ ⎪ ⎪⎝⎭ ⎪⎪⎝⎭⎝⎭23r r ↔−−−→12310707550522161061010x x x ⎛⎫⎛⎫⎪ ⎪-⎛⎫⎪ ⎪⎪⎪ ⎪= ⎪ ⎪ ⎪ ⎪ ⎪ ⎪⎝⎭ ⎪⎪-⎝⎭⎝⎭32125r r +−−−→1231070755052231310055x x x ⎛⎫⎛⎫ ⎪ ⎪-⎛⎫ ⎪ ⎪ ⎪⎪ ⎪= ⎪ ⎪ ⎪ ⎪⎪ ⎪⎝⎭ ⎪ ⎪⎝⎭⎝⎭得到方程组12123233107705551221313155x x x x x x x x ⎧⎪-==⎧⎪⎪⎪+=⇒=-⎨⎨⎪⎪=⎩⎪=⎪⎩ 3。

计算方法引论课后答案

计算方法引论课后答案

计算方法引论课后答案第一章误差1.什么是模型误差,什么是方法误差?例如,将地球近似看为一个标准球体,利用公式 $A=4\pi r$ 计算其表面积,这个近似看为球体的过程产生的误差即为模型误差。

在计算过程中,要用到 $\pi$,我们利用无穷乘积公式计算 $\pi$ 的值:pi=2\cdot\frac{2}{1}\cdot\frac{2}{3}\cdot\frac{4}{3}\cdot\f rac{4}{5}\cdot\frac{6}{5}\cdot\frac{6}{7}\cdot\frac{8}{7}\cdot\ frac{8}{9}\cdot\cdots我们取前9项的乘积作为 $\pi$ 的近似值,得$\pi\approx3.xxxxxxxx5$。

这个去掉 $\pi$ 的无穷乘积公式中第9项后的部分产生的误差就是方法误差,也称为截断误差。

2.按照四舍五入的原则,将下列各数舍成五位有效数字:816.956,76.000,.322,501.235,.182,130.015,236.23.解:816.96,76.000,.501.24,.130.02,236.23.3.下列各数是按照四舍五入原则得到的近似数,它们各有几位有效数字?81.897,0.008,136.320,050.180.解:五位,三位,六位,四位。

4.若 $1/4$ 用 0.25 表示,问有多少位有效数字?解:两位。

5.若 $a=1.1062$,$b=0.947$,是经过舍入后得到的近似值,问:$a+b$,$a\times b$ 各有几位有效数字?已知 $da<\frac{1}{2}\cdot10^{-4}$,$db<\frac{1}{2}\cdot10^{-3}$,又 $a+b=0.\times10$。

begin{aligned}d(a+b)&=da+db\leq da+db=\frac{1}{2}\cdot10^{-4}+\frac{1}{2}\cdot10^{-3}=0.55\times10^{-3}<\frac{1}{2}\cdot10^{-2}end{aligned}所以 $a+b$ 有三位有效数字;因为 $a\timesb=0.xxxxxxxx\times10$。

计算方法引论课后答案

计算方法引论课后答案

第一章 误差1. 试举例,说明什么是模型误差,什么是方法误差.解: 例如,把地球近似看为一个标准球体,利用公式24A r π=计算其表面积,这个近似看为球体的过程产生的误差即为模型误差.在计算过程中,要用到π,我们利用无穷乘积公式计算π的值: 其中我们取前9项的乘积作为π的近似值,得这个去掉π的无穷乘积公式中第9项后的部分产生的误差就是方法误差,也成为截断误差.2. 按照四舍五入的原则,将下列各数舍成五位有效数字:816.956 7 6.000 015 17.322 50 1.235 651 93.182 13 0.015 236 23 解: 816.96 6.000 0 17.323 1.235 7 93.182 0.015 2363. 下列各数是按照四舍五入原则得到的近似数,它们各有几位有效数字? 81.897 0.008 13 6.320 05 0.180 0 解: 五位 三位 六位 四位4. 若1/4用0.25表示,问有多少位有效数字? 解: 两位5. 若 1.1062,0.947a b ==,是经过舍入后得到的近似值,问:,a b a b +⨯各有几位有效数字?解: 已知4311d 10,d 1022a b --<⨯<⨯, 又0.2053210a b +=⨯,()433211110100.551010222d a b da db da db ----+=+≤+=⨯+⨯=⨯<⨯,所以a b +有三位有效数字;因为0.1047571410a b ⨯=⨯,所以a b ⨯有三位有效数字.6. 设120.9863,0.0062y y ==,是经过舍入后作为12,x x 的近似值.求1211,y y 的计算值与真值的相对误差限及12y y ⋅与真值的相对误差限.解: 已知-4-41112221211d ,d ,d =10,d 1022x y x x y x x x =+=+⨯=⨯, ()44111111110d d 12dr dr 0.50100.9863x xx x x y --⨯⎛⎫==≈=≈⨯ ⎪⎝⎭;()42222222110d d 12dr dr 0.81100.0062x xx x x y --⨯⎛⎫==≈=≈⨯ ⎪⎝⎭;()()()4221212dr dr dr 0.50100.81100.8210x x x x ---⋅=+≈⨯+⨯≈⨯.7. 正方形的边长约为100cm,应该怎样测量,才能使其面积的误差不超过1cm 2. 解: 设正方形面积为S,边长为a,则S=a 2.所以要使:2d d 2d 1s a a a ==≤,则要求211d 0.5102200a a -≤==⨯.所以边长的误差不能超过20.510-⨯cm.8. 用观测恒星的方法求得某地维度为4502'''(读到秒),试问:计算sin ϕ将有多大误差?解: ()()1d sin cos d cos 45022ϕϕϕ*''⎛⎫'''== ⎪⎝⎭.9 . 真空中自由落体运动距离s 与时间的关系由公式212s gt =确定,g 是重力加速度.现在假设g 是准确的,而对t 的测量有0.1s ±的误差,证明t 增加时,距离的绝对误差增加而相对误差却减小. 证明: 因为:221d d d d d d d ;2.122s gt t gt t t s gt gt t s s t gt ⎛⎫=====⎪⎝⎭ d s 与t成正比,d s s与t 成反比,所以当d t 固定的时候, t增加时,距离的绝对误差增加而相对误差却减小.10. 设0x >,x 的相对误差为δ,求ln x 的绝对误差. 解: 已知d x x δ=,所以ln x 的绝对误差()d d ln x x xδ==. 11. 设x 的相对误差为%α,求nx 的相对误差.解: 1d d d %n n n nx nx x n xn x x xα-===. 12. 计算球的体积,为了使相对误差限为1%,问度量半径R 时允许的相对误差限如何? 解: 已知343V R π=,设()d dr R R a R ==,则要使得 ()()3d dr dln d ln 3d ln 3d ln 3dr 31%V V V R R R R a V ========,则11%3a =⋅. 第二章 插值法与数值微分1.设y =在100,121,144x =三处的值是很容易求得的,试以这三个点建立y =的二次插值多项式,并用,且给出误差估计.用其中的任意两点,构造线性插值函数,用得到的三个线性插值函数,,并分析其结果不同的原因.解: 已知012012100,121,144;10,11,12x x x y y y ======,建立二次Lagrange 插值函数可得:()211510.7228L ≈=.误差()()()()()()2012012,,,,3!f R x x x x x x x x x x ξξξ'''=---∈,所以利用前两个节点建立线性插值函数可得:()111510.7143L ≈=.利用后两个节点建立线性插值可得:()111510.7391L ≈=.利用前后两个节点建立线性插值可得:()111510.6818L ≈=.与,二次插值比线性插值效果好,利用前两个节点的线性插值比其他两个线性插值效果好.此说明,二次插值比线性插值效果好,内插比外插效果好.2. 利用(2.9)式证明 证明: 由(2.9)式当01x x x <<时,()()01max x x x f f x ξ≤≤''''≤,()()()01201101max 4x x x x x x x x x ≤≤--≤- 所以3. 若()0,1,...,j x n 为互异节点,且有 证明 证明: 由于且()0nk j j j x l x =∑和kx都为k 次多项式,而且在k+1个不同的节点处的函数值都相同0,1,...,k n =, 所以马上有()0,0,1,...,nk kj j j x l x xk n =≡=∑.4. 设给出sin x 在[],ππ-上的数值表,用二次插值进行计算,若希望截断误差小于510-,问函数表的步长最大能取多少?解: 记插值函数为p(x),则所以()()()()11cos max sin 3!i i i x x p x x x x x x ππξ-+-≤≤--=---()cos 1ξ-≤;令()()()()11i i i g x x x x x x x -+=---,设1i x x th -=+,得又()()()[]12,0,2t t t t t ϕ=--∈的最大值为10.3849ϕ⎛= ⎝⎭,所以有 所以0.0538h ≤.5. 用拉格朗日插值和牛顿插值找经过点()()()()3,1,0,2,3,2,6,10---的三次插值公式. 解: Lagrange 插值函数:牛顿插值: 首先计算差商也可以利用等距节点构造,首先计算差分 可得前插公式 和后插公式6. 确定一次数不高于4的多项式()x ϕ,使()()()()()00,00,111,21ϕϕϕϕϕ''=====. 解: 利用重节点计算差商则可构造Hermite 插值函数满足题设条件:7. 寻找过1n +个点01,,...,n x x x 的21n +次多项式()21n H x +,满足条件: 解: 和Lagrange 插值函数的构造类似,可将插值函数写成其中,基函数满足条件 (1)()()(),,,21n i n i h x h x P n ∈+;(2)()()()(),,,,,0;,0n i n i n ij ij n i j j ijj h x h x h x h x δδ''====则可由已知条件,可得()()()()2,,,12n i n i i i n i h x l x x x l x '⎡⎤=--⎣⎦;()()()2,,n i i n i h x x x l x '=-.所以可得8. 过0,1两点构造一个三次Hermite 插值多项式,满足条件: 解: 计算重节点的差商马上可得9. 过给定数组(1) 作一分段线性插值函数.(2) 取第二类边界条件,作三次样条插值多项式.(3) 用两种插值函数分别计算75.5,78.3x x ==的函数值. 解: (1)做分段线性插值函数可得:其中, ()[][]076 75,76;0 75,76.x x l x x ⎧-∈⎪=⎨∉⎪⎩()[][][]175 75,7677 76,77;0 75,77.x x l x x x x ⎧-∈⎪=-∈⎨⎪∉⎩ (2)把已知节点值带入M 关系式可得: 由边界条件可得050M M ==,所以上面方程组变为可求解方程组解得12340.0058,0.0067,0.0036,0.0071M M M M ====.所以可得在每个区间上的三次样条函数的表达式: (3)当75.5x =时,()()()50175.5 2.76875.5 2.83375.5 2.8005I l l =+=;()()()()()30.00580.005875.575.576 2.7687675.5 2.83375.575 2.79966s ⎛⎫=-+-+--= ⎪⎝⎭当78.3x =时,()()()53475.5 2.97978.3 3.06278.3 3.0039I ll =+=;10. 若给出sin ,cos ,tan x x x 的函数表:用表上的数据和任一插值公式求: (1) 用tan x 表格直接计算tan1.5695.(2) 用sin1.5695和cos1.5695来计算tan1.5695.并讨论这两个结果中误差变化的原因. 解: 利用Lagrange 插值直接用tan 表计算得tan1.5695819.0342874999274≈;利用Lagrange 插值计算sin 得sin1.56950.99999917500000≈;利用Lagrange 插值计算cos 得cos1.56950.00129630000000≈;最后利用sin/cos 计算tan 得tan1.5695771.4257309264500≈.出现小除数,误差被放大.11. 求三次样条函数()s x ,已知和边界条件解: 把表中数据带入M 关系式可得由边界条件还可得到两个方程: 联立两个方程组可解得:带入M 表达式便可得所求三次样条函数.12. 称n 阶方阵()ij A a =具有严格对角优势,若 (1) 试证明:具有严格对角优势的方阵必可逆. (2) 证明:方程组(2.62)解存在唯一.证明: (1)设矩阵A 按行严格对角占优,如果A 奇异,则存在非零向量x 使得Ax=0,写成分量形式为令指标0i 使得00i x x∞=≠,则因此0000010n i i i i j j j i x a a =≠⎛⎫⎪-≤ ⎪ ⎪⎝⎭∑ 即000010ni i i j j j i a a =≠-≤∑上式与矩阵按行严格对角占优矛盾,因此矩阵非奇异. (2)方程组(2.62)由于该方程组系数矩阵为严格对角占优的方阵,所以由克拉默法则可知方程组存在唯一解.。

数值计算方法习题答案(绪论,习题1,习题2)

数值计算方法习题答案(绪论,习题1,习题2)

引论试题(11页)4 试证:对任给初值x 0,0)a >的牛顿迭代公式112(),0,1,2,......k ak k x x x k +=+= 恒成立下列关系式:2112(1)(,0,1,2,....(2)1,2,......kk k x k x x k x k +-=-=≥=证明:(1)(2211222k k k k k k k kx a x ax x x x x +-⎫⎛-+-=+==⎪ ⎝⎭(2) 取初值00>x ,显然有0>k x ,对任意0≥k ,a a x a x x a x x k k k k k ≥+⎪⎪⎭⎫ ⎝⎛-=⎪⎪⎭⎫ ⎝⎛+=+2121216 证明:若k x 有n 位有效数字,则n k x -⨯≤-110218, 而()kk k k k x x x x x 288821821-=-⎪⎪⎭⎫⎝⎛+=-+ nnk k x x 2122110215.22104185.28--+⨯=⨯⨯<-∴>≥ 1k x +∴必有2n 位有效数字。

8 解:此题的相对误差限通常有两种解法. ①根据本章中所给出的定理:(设x 的近似数*x 可表示为m n a a a x 10......021*⨯±=,如果*x 具有l 位有效数字,则其相对误差限为()11**1021--⨯≤-l a x x x ,其中1a 为*x 中第一个非零数) 则7.21=x ,有两位有效数字,相对误差限为025.010221111=⨯⨯≤--x x e 71.22=x ,有两位有效数字,相对误差限为025.010221122=⨯⨯≤--x x e 3 2.718x =,有两位有效数字,其相对误差限为:00025.010221333=⨯⨯≤--x e x ②第二种方法直接根据相对误差限的定义式求解 对于7.21=x ,0183.01<-e x∴其相对误差限为00678.07.20183.011≈<-x e x 同理对于71.22=x ,有003063.071.20083.022≈<-x e x 对于718.23=x ,有00012.0718.20003.033≈<-x e x备注:(1)两种方法均可得出相对误差限,但第一种是对于所有具有n 位有效数字的近似数都成立的正确结论,故他对误差限的估计偏大,但计算略简单些;而第二种方法给出较好的误差限估计,但计算稍复杂。

计算理论导引习题答案[第2版]CHAP9new

计算理论导引习题答案[第2版]CHAP9new

9.1 证明TIME(2n)=TIME(2n+1).证明:2n=O(2n+1)TIME(2n)TIME(2n+1).2n+1=O(2n)TIME(2n+1)TIME(2n).所以TIME(2n)=TIME(2n+1).9.2证明TIME(2n)TIME(22n)。

注:这里“”是严格包含。

证明:令f(n)=22n,则f(n)/logf(n)=22n/2n, 由时间层次定理有TIME(o(22n/2n))TIME(22n).又由于2n=o(22n/2n),TIME(2n)TIME(o(22n/2n)),所以TIME(2n)TIME(22n).9.3 证明NTIME(n)PSPACE.证明:NTIME(n)NSPACE(n)SPACE(n2)SPACE(n3)PSPACE.9.6 证明若A P,则P A=P。

证明:首先P P A。

这是因为不带谕示即可。

下面证明P A P。

任取A P,则存在多项式图灵机T判定A。

设B P A,则存在带语言A的谕示的多项式时间图灵机M A判定B。

如下构造不带谕示的图灵机D:D=“对于输入串w:1)在w上运行M A。

2)每当M A要在谕示带上写下某个字符串x,则在x上运行T,若T接受,则代替谕示回答x属于A,否则代替谕示回答x不属于A。

3)若M A接受,则接受;否则,拒绝。

”设M A的运行时间是n a,T的运行时间是n b。

谕示带上写下的字符串的长度不会超过n a,询问谕示带的次数也不会超过n a。

D的运行时间是n a (n a)b=n a+ab,所以A P。

9.7 给出带指数的正则表达式,产生如下在字母表{0,1}上的语言:a.所有长为500的字符串. (01)500。

b.所有长度不超过500的字符串.(01)500.c.所有不少于500的字符串. (01)500(01)*.d.所有长度不等于500的字符串. (01)499(01)501(01)*.e.所有恰好包含500个1的字符串. 0*(10*)500.f.所有包含至少500个1的字符串. (01)*(1(01)*)500.g.包含至多500个1的字符串. 0*((1)0*)500.h.所有长度不少于500并且在第500个位置上是0的字符串. (01)4990(01)*.i.所有包含两个0并且其间至少相隔500个符号的字符串。

计算方法答案

计算方法答案

计算方法答案方法是一种系统化的思考和行动方式,用来解决问题、达成目标或完成任务。

在各个领域和行业,方法的应用都发挥着重要的作用。

本文将探讨方法的定义、分类以及如何有效地运用方法来解决问题。

首先,方法可以被定义为一种明确的步骤或程序,用来完成特定的任务或达到特定的目标。

它通常是经过反复验证和实践的,并且具有可重复性和可预测性。

方法可以是科学的、经验的、逻辑的或启发式的,具体取决于问题的性质和解决的需求。

方法可以被分为多个类别,根据其应用领域和特点来进行分类。

以下是一些常见的方法分类:1. 科学方法:科学方法是自然科学领域中最常用的一种方法。

它包括观察、实验、假设的提出和验证等步骤,以获取可靠的实证证据。

2. 问题解决方法:这类方法是用来解决现实生活中的问题的。

它们可以是启发式的,如决策树、贝叶斯网络等;也可以是经验的,如五步法和PDCA循环等。

3. 创新方法:创新方法是用来推动创新和创造的方法,以产生新的想法和解决方案。

常见的创新方法包括头脑风暴、设计思维和敏捷方法等。

4. 绩效改进方法:这类方法是用来改进组织或个人绩效的。

它们可以是管理方法,如六西格玛和OKR等;也可以是个人效率工具,如番茄工作法和日程管理等。

在使用方法解决问题时,有一些重要的注意事项需要被考虑。

首先,要确保选择适用于问题的方法,并根据实际情况进行调整和优化。

其次,要确保方法的正确实施,包括每个步骤的严格执行和结果的准确评估。

最后,要学会从每个问题的解决中吸取经验教训,并不断改进和完善方法。

通过有效地运用方法,我们可以更加高效地解决问题,实现目标,并取得更好的成果。

无论是在个人生活中还是在工作环境中,掌握和运用合适的方法都是非常重要的。

希望本文的介绍能够帮助读者理解方法的概念和分类,并提供一些实用的思考和行动指南。

计算方法_习题第一、二章答案

计算方法_习题第一、二章答案

第一章 误差1 问3.142,3.141,722分别作为π的近似值各具有几位有效数字?分析 利用有效数字的概念可直接得出。

解 π=3.141 592 65…记x 1=3.142,x 2=3.141,x 3=722.由π- x 1=3.141 59…-3.142=-0.000 40…知3411110||1022x π--⨯<-≤⨯ 因而x 1具有4位有效数字。

由π- x 2=3.141 59…-3.141=-0.000 59…知2231021||1021--⨯≤-<⨯x π因而x 2具有3位有效数字。

由π-722=3.141 59 …-3.142 85…=-0.001 26…知231021|722|1021--⨯≤-<⨯π因而x 3具有3位有效数字。

2 已知近似数x*有两位有效数字,试求其相对误差限。

分析 本题显然应利用有效数字与相对误差的关系。

解 利用有效数字与相对误差的关系。

这里n=2,a 1是1到9之间的数字。

%5101211021|*||*||)(|1211*=⨯⨯≤⨯≤-=+-+-n ra x x x x ε3 已知近似数的相对误差限为0.3%,问x*至少有几位有效数字?分析 本题利用有效数字与相对误差的关系。

解 a 1是1到9间的数字。

1112*10)1(2110)19(21102110003%3.0)(--⨯+≤⨯+⨯=⨯<=a x r ε 设x*具有n 位有效数字,令-n+1=-1,则n=2,从而x*至少具有2位有效数字。

4 计算sin1.2,问要取几位有效数字才能保证相对误差限不大于0.01%。

分析 本题应利用有效数字与相对误差的关系。

解 设取n 位有效数字,由sin1.2=0.93…,故a 1=9。

411*10%01.01021|*||*||)(-+-=≤⨯≤-=n r a x x x x ε解不等式411101021-+-≤⨯n a 知取n=4即可满足要求。

计算方法引论课后答案.

计算方法引论课后答案.

计算⽅法引论课后答案.第⼀章误差1. 试举例,说明什么是模型误差,什么是⽅法误差.解: 例如,把地球近似看为⼀个标准球体,利⽤公式24A r π=计算其表⾯积,这个近似看为球体的过程产⽣的误差即为模型误差.在计算过程中,要⽤到π,我们利⽤⽆穷乘积公式计算π的值:12222...q q π=?其中112,3,...n q q n +?=??==?? 我们取前9项的乘积作为π的近似值,得3.141587725...π≈这个去掉π的⽆穷乘积公式中第9项后的部分产⽣的误差就是⽅法误差,也成为截断误差.2. 按照四舍五⼊的原则,将下列各数舍成五位有效数字:816.956 7 6.000 015 17.322 50 1.235 651 93.182 13 0.015 236 23 解: 816.96 6.000 0 17.323 1.235 7 93.182 0.015 236 3. 下列各数是按照四舍五⼊原则得到的近似数,它们各有⼏位有效数字? 81.897 0.008 13 6.320 05 0.180 0 解: 五位三位六位四位4. 若1/4⽤0.25表⽰,问有多少位有效数字? 解: 两位5. 若 1.1062,0.947a b ==,是经过舍⼊后得到的近似值,问:,a b a b +?各有⼏位有效数字?解: 已知4311d 10,d 1022a b --()433211110100.551010222d a b da db da db ----+=+≤+=?+?=?所以a b +有三位有效数字;因为0.1047571410a b ?=?,()43321110.94710 1.1062100.600451010222所以a b ?有三位有效数字.6. 设120.9863,0.0062y y ==,是经过舍⼊后作为12,x x 的近似值.求1211,y y 的计算值与真值的相对误差限及12y y ?与真值的相对误差限. 解: 已知-4-41112221211d ,d ,d =10,d 1022x y x x y x x x =+=+?=?, ()44111111110d d 12dr dr 0.50100.9863x xx x x y --==≈=≈? ???;()42222222110d d 12dr dr 0.81100.0062x xx x x y --==≈=≈? ???;()()()4221212dr dr dr 0.50100.81100.8210x x x x ---?=+≈?+?≈?.7. 正⽅形的边长约为100cm,应该怎样测量,才能使其⾯积的误差不超过1cm 2.解: 设正⽅形⾯积为S,边长为a,则S=a 2.所以要使:2d d 2d 1s a a a ==≤,则要求211d 0.5102200a a -≤==?.所以边长的误差不能超过20.510-?cm.8. ⽤观测恒星的⽅法求得某地维度为4502'''o(读到秒),试问:计算sin ?将有多⼤误差?解: ()()1d sin cos d cos 45022*''?'''==o.9 . 真空中⾃由落体运动距离s 与时间的关系由公式212s gt =确定,g 是重⼒加速度.现在假设g 是准确的,⽽对t 的测量有0.1s ±的误差,证明t 增加时,距离的绝对误差增加⽽相对误差却减⼩.证明: 因为:221d d d d d d d ;2.122s gt t gt t t s gt gt t s s t gt ??d s 与t 成正⽐,d s s与t 成反⽐,所以当d t 固定的时候, t 增加时,距离的绝对误差增加⽽相对误差却减⼩.10. 设0x >,x 的相对误差为δ,求ln x 的绝对误差. 解: 已知d x x δ=,所以ln x 的绝对误差()d d ln x x x δ==.11. 设x 的相对误差为%α,求nx 的相对误差.解: 1d d d %n n n n x nx x n xn x x xα-===.12. 计算球的体积,为了使相对误差限为1%,问度量半径R 时允许的相对误差限如何? 解: 已知34 3V R π=,设()d dr R R a R ==,则要使得 ()()3d dr dln d ln 3d ln 3d ln 3dr 31%V V V R R R R a V ========,则11%3a =?.第⼆章插值法与数值微分1.设y =在100,121,144x =三处的值是很容易求得的,试以这三个点建⽴y =的⼆次插值多项式,,且给出误差估计.⽤其中的任意两点,构造线性插值函数,⽤得到的三个线性插值函数,,并分析其结果不同的原因.解: 已知012012100,121,144;10,11,12x x x y y y ======,建⽴⼆次Lagrange 插值函数可得:()()()()21211441001441011100121100144121100121144121100 12144121144100x x x x L x x x ----= +------+--()211510.7228L ≈=.误差()()()()()()2012012,,,,3!f R x x x x x x x x x x ξξξ'''=---∈,所以20.00065550.001631R <<利⽤前两个节点建⽴线性插值函数可得:()()()()()11211001011100121121100x x L x --=+--()111510.7143L ≈=.利⽤后两个节点建⽴线性插值可得:()()()()()11441211112121144144121x x L x --=+--()111510.7391L ≈=.利⽤前后两个节点建⽴线性插值可得:()()()()()21441001012100144144100x x L x --=+()111510.6818L ≈=.,⼆次插值⽐线性插值效果好,利⽤前两个节点的线性插值⽐其他两个线性插值效果好.此说明,⼆次插值⽐线性插值效果好,插⽐外插效果好.2. 利⽤(2.9)式证明()()()0121001max ,8x x x x x R x f x x x x ≤≤-''≤≤≤证明: 由(2.9)式()()()()0101,2!f R x x x x x x x ξξ''=--<<当01x x x <<时,()()01max x x x f f x ξ≤≤''''≤,()()()01201101max 4x x x x x x x x x ≤≤--≤- 所以()()()0121001max ,8x x x x x R x f x x x x ≤≤-''≤≤≤3. 若()0,1,...,j x n 为互异节点,且有()()()()()()()()()011011............j j n j jj j j j j n x x x x x x x x l x xx x x x x x x -+-+----=证明()0,0,1,...,nk kj j j x l x xk n =≡=∑证明: 由于() 1 ;0 .j i ij i j l x i j δ=?==?≠? 且()0nk j j j x l x =∑和kx都为k 次多项式,⽽且在k+1个不同的节点处的函数值都相同0,1,...,k n =, 所以马上有()0,0,1,...,nk kj j j x l x xk n =≡=∑.4. 设给出sin x 在[],ππ-上的数值表,⽤⼆次插值进⾏计算,若希望截断误差⼩于5 10-,问函数表的步长最⼤能取多少? 解: 记插值函数为p(x),则()()()()()11sin sin 3!i i i x p x x x x x x x ξ-+'''-=--- 所以()()()()11cos max sin 3!i i i x x p x x x x x x ππξ-+-≤≤--=---()()()[]3112,0,2i g x th h t t t t -+=--∈⼜()()()[]12,0,2t t t t t ?=--∈的最⼤值为10.3849??= ?,所以有 350.3849max sin 106x x p h ππ--≤≤-≤< 所以 0.0538h ≤.5. ⽤拉格朗⽇插值和⽜顿插值找经过点()()()()3,1,0,2,3,2,6,10---的三次插值公式. 解: Lagrange 插值函数:()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()12302330101020310121301301223202123303132 31033101622731033 .2781/5x x x x x x x x x x x x L x y y x x x x x x x x x x x x x x x x x x x x x x x x y y x x x x x x x x x x x x x x x x x x x x x x x x ------= +------------++--------+--=++-+-++⽜顿插值: ⾸先计算差商3 10 2 13 2 1.333 0.38896 104 0.8889 0.1420-----()()()()()3130.38893 1.142033.N x x x x x x x =-++-+++-也可以利⽤等距节点构造,⾸先计算差分。

数值计算引论(第二版)三四五章习题解答

数值计算引论(第二版)三四五章习题解答

close all clear all clc n=10; x=zeros(n+1,1); for k=1:n+1 x(k)=cos((2*k-1)*pi/2/(n+1)); end y=1./(1+25*x.^2); x0=-1:0.1:1; y0=interp1(x,y,x0,'spline'); plot(x0,y0,'r')
h2 1.5, h3 0.5, h4 1.5, h5 0.5
b [0
h2 h3 3 h3 A 6 0 h3 6 h3 h4 3 h4 6
2
0]
0
T
2 3 h4 1 12 6 h4 h5 0 3
(d)样条函数插值具有比较好的数值稳定性。 √
习题
3.以0.1,0.15,0.2为插值节点,计算 f ( x ) x 的二次Lagrange插值多 项式 P2 ( x ) ,比较 P2 (0) 和 f (0) ,问定理4.1的结果是否适用于本问题。 解答: 首先构造二次Lagrange插值多项式
R=chol(A)
0 -0.8165 1.1547 0 0 0 -0.8660 1.1180
-0.7071 1.2247 0 0
方法2: 利用Cholesky定义求解
6.矩阵
1 A1 1 2 2 1 2
2 2 1 , A2 2 1 1
2 2 0
(B) 0 1
2 1 2
Gauss-Seidel迭代
0 1 M (D L) U 0 0
(M ) 2 1

计算理论导引习题答案[第2版]CHAP5new

计算理论导引习题答案[第2版]CHAP5new

5.1 证明EQ CFG 是不可判定的。

解:只须证明ALL CFG ≤m EQ CFG 即可。

构造CFG G 1,使L(G 1)=∑*。

设计从ALL CFG 到EQ CFG 的归约函数如下: F=“对于输入<G >,其中G 是CFG :1)输出<G ,G 1>。

”若<G >ALL CFG ,则<G ,G 1>EQ CFG 。

若<G >ALL CFG ,则<G , G 1>EQ CFG 。

F 将ALL CFG 归约到EQ CFG 即ALL CFG ≤m EQ CFG∵ALL CFG 是不可判定的,∴EQ CFG 是不可判定的。

5.2证明EQ CFG 是补图灵可识别的。

证明:注意到A CFG ={<G,w>|G 是能派生串w 的CFG}是可判定的。

构造如下TM : F=“输入<G ,H>,其中G ,H 是CFG ,1) 对于字符串S 1, S 2,,重复如下步骤。

2) 检测S i 是否可以由G 和H 派生。

3) 若G 和H 中有一个能派生w ,而另一个不能,则接受。

”F 识别EQ CFG 的补。

5.3 略。

5.4 如果A m B 且B 是正则语言,这是否蕴涵着A 也是正则语言?为什么? 解:否。

例如:对非正则语言A={0n 1n |n 0}和正则语言B={0},可以构造一个可计算函数f 使得:f(w)=⎩⎨⎧≠=n n nn 10w 1,10w 0, 于是w A f(w)B,故A m B 。

5.5 证明A TM 不可映射规约到E TM 。

证明:反证法假设A TM m E TM , 则有TM m TM E A ≤。

而A TM 的补不是图灵可识别的,从而可知E TM 的补也不是图灵可识别的。

下面构造一个识别E TM 的补的图灵机S :S=“输入<M>,M 是TM,1) 对i=1,2,…重复下一步。

2) 对S 1,S 2,…,S i 模拟M 运行i 步,若有接受,则接受。

计算机科学引论前六章答案.docx

计算机科学引论前六章答案.docx

Chapter 1Crssword Puzzle1. people2. enduser3. procedures4. documentfile5. devicedriver6. databasefile7. operationsystem8. hardware9. Internet10. modem11. softwarermation13.data14.tablet PCMultiple Choice1. b2. b3. a4. b5. d6. d7. a8. c9. d10.dOpen-endedL An information system has five parts:people,procedures,software, hardware and data. People:Are end users who use computer to make themselves more productive. Procedures:Specify rules or guidelines for computer operations.Software:Provides step-by-step instructins for computer hardware・ Hardware:Processes the data to create information.DataiConsist of unprocessed facts including text,numbers, image and sounds・ People are the most important part of any information system・2.System software helps the computer manage its own internal resources.lt includes three kindsof programs:operating systems,utilities and device drivers programs.3・ Basic applications are the kinds of programs to be considered computer competent. Specialized applications are more narrowly focused on specific disciplines and occupations. Basicapplications have some types^such as browser,word processor^spreadsheet ,and so on. Also specialized applications have many types,some of the best known are graphics,audio andvideo,multimedia,Web authoring ,and artificial intelligence programs.4.There are four types of computers:supercomputers5mainframe computers,minicomputers,andSupercomputers are the most powerful type of computer.Main frame computers occupy specially wired,air-conditioned rooms,they are capable of great processing speeds and data storage.Minicomputers are refrigeratorsized machines・Microcomputers are the least powerful.yet the most widely used and fastest-growing,type of compute 匚Microcomputers are the most common type of computers.There are four types of microcomputers:Desktop computers,Notebook computers,Handheld computers and PDA.5.Connectivity is the capability of you microcomputer to share the information with othercomputers.Wireless revolution dramatically affect connectivity.A computer network is a communications system connecting two or more computers.Internet is the largest network in the world.The Web provides a multimedia interface to the numerous resources available on the Internet. Chapter2Crossword Puzzle:1.hits2.ISP3.spam4.applets5・ surf,search engine6.url7.ftp8.carder9.attachment10.B2B11.Browser12.filter13.link14.downloading ,dslMultiple Choice:1. d2. a3. c4. c5. a6. a7. a8. a9. d10.bMatching:4——e5— f6——c7—h8…j9---a10—bOpen-Ended1.The most common uses of the Internet are the following:communicating,shopping,searching,etertainment,education,and so on.I have participated in almost all of them.I thinkcmmunicating is the most popula匚2.The two most common types of providers are National and wireless.National service providers provide access through standard telephone connections.Wireless service providers provide Internet connections for computers with wireless modems and a wide array of wireless devices.3.A typical e-mail message has three basic elements:header3nessage,and signature・4.Social networking is the grouping of individuals into specific groups.There are three basic categories of social networking sites:reuniting,friend-of-a-friend,and common interestReuniting sites are designed to connect people who have known one another but have lost touch. Friend-of-a-friend sites are designed to bring together two people who do not know one another but share a common friend.Common interest sites bring together individuals that share common interests or hobbies・5.There are three types of search engines: crawler-based search engines, metasearch engines and specialized search enginesCrawler-based search engines, such as Google, create their listings automatically・Metasearch engines are programs that automatically submit your search request to several engines simultaneously. The metasearch engines receives the results, eliminates duplicates,orders the hits,and then provides the edited list to you .one of the best known is Dogpile.Specialized search engines focus on subject-specific Web sites.such as Environment.Chapter 3Crossword Puzzle1.menu2・ worksheet3.table4.window5.DBMS6.master slide7.dialog box8.software suite9・ word wrap13.column14.database15.toolbar16.document17.slides18.queryMultiple Choice1. d2. c3. b4. d5. d6. a7. b& b9. c10.bMatching1・j2. a3. c4.h5. b6. d7.i& e9.g10.fOpen-Ended1. General-purpose application are widely used in nearly every discipline and occupation.Theyinclude word processors,spreadsheets,database man agement systems,and presentation graphics ・Specialized application includes thousands of other programs that are more narrowly focused on specific disciplines and occupations.2・ Most applications use a GUI,use windows to display information,and have menus to present commands ・3. A formula is an instruction to calculate or process.Functions are prewritten formulas.A formularelated to what-if analysis is called recalculation.4.Presentation graplics are programs that combine a variety of visual objects to createautractive,visually interesting presentation.People in a variety of setting and situations use presentation graphics programs to make their presentations more interesting and professional・processor,spreadsheet,database manager, and more. The primary disadvantage of an integrated package is that the capabilities of each function are not as extensive as in the individualprograms.The primary advantages are cost and simplicity.A software suite is a collection of separate application programs bundled together and sold as agroup.lt is significantly less expensive to buy a suite of applications than to buy eachapplication separatelyChapter 4Crossword Puzzle1.bitmap image2.vrml3.morphing4.story board5.interactivity6.ACID7.fuzzy logic& blog9・ web authoring10.graphical map11.pixels12.link13.vector image14.ai15.flashMultiple Choice1. a2. a3. a4. b5. a6. b7. c& b9. a10.bMatching1.i2.g3. d4. e5. c6. f7.h& bOpen-EndedL Graphics are widely used to analyze data and to create professional-looking presenUitions;Desktop publishers focus on page design and layout and provide greater flexibility; Image editors are programs for creating and editing bitmap images;Illustration programs are used to create and to edit vector images;Image galleries are libraries of electronic images.These images are used for a wide variety of applications from illustrating textbooks to providing visual interest to presentations;Graphics suites are some companies combining their separate graphics programs in groups・2. Audio editing software allows you to create and edit audio clips,most software allow you to addaudio effects to your tracks. Video editing software allows you to reorganize,add effects,and more to your digital video footage・3・Multimedia is the integration of all sorts of media into one presentation.The creation of interactive multimedia presentations follows several steps:Plan, Design, Create and Support. 4.Creating a site is called Web authoring.A web site design is an interactive multimedia form ofcommunication,designing a web site begins with determining the site's overall con tent,the overall site design is commonly represented in a graphical map.More specialized and powerful programs, called Web authoring programs, are typically used to create sophisticated commercial sites・5.The three areas of artificial intelligence are virtual reality ,knowledge-based systems androbotics.Virtual reality is an artificial,or simulated,reality generated in 3-D by acomputer.Knowledge-based systems are a type of artificial intelligence that uses a database to provide assistance to users.Robotics is the field of study concerned with developing and using robots.Chapter 5Crossword Puzzle1.folderwork server3.gui4.fragmented5.backup,booting6・ warm boot7・ windows8.utility suite9・ driver10. icons11 • tracks12. nosMultiple Choice1. c2. d3. c4. a7. b8. b9. a10.cMatching1.j2. d3. f4. b5.g6.h7. a8. e9.i10.cOpen-Ended1.System software works with end users,application software,and computer hardware to handlethe majority of technical details.lt consists of four types of programs:operating systems,utilities,device drivers and language translators.2・ The basic functions of every operating system are :managing computer resources,providing a user in terface, and running applications.The three basic operating system categories are :embedded,network and stand-alone.3. Windows is by far the most popular microcomputer operating system today.lt comes in a varietyof different versions and is designed to run with Intel and Intel-compatible microprocessors.Mac OS is not nearly as widely used as the Windows operating system.lt is a powerful,easy-to-use operating system that is popular with professional graphic designs,desktop publishers,and many home users.While Windows,the Mac OS are proprietary operating systems,Linux is not.It is open source software free and available from many sources,including the Web.4. Utilities are specialized programs designed to make computing easier.The five most essentialutilities are :troubleshooting or diag nostic programs,antivirus programs,uninstall programs,backup programs and file compression programs.Unility suites combine several programs into one package・5. A device driver works with the operating system to allow communication between the deviceand the rest of the computer system.Each time the computer system is started, the operating system loads all of the device drivers into memory.Whenever a new device is added to a computer system, a new device driver must be installed before the device can be used.Add Printer Wizard provides step-by-step guidance to select the appropriate printer driver and to install that drive匚Windows uses Windows Update to make reinstalling or updating device drivers easily.Chapter 6Crossword Puzzle1.system unit3.bus width4.memory5.cable6.plug and play7.byte8.cache9.ascii10.system clockMultiple Choice1. d2. b3. c4. b5. b6. a7. a8. c9. b10.dMatching1.j2. a3. c4.h5.g6.i7. d8. e9. f10.bOpen-Ended1. There are four basic types of system units:Desktop system units,Notebook system units.TabletPC system units ,and Handheld computer system units・Desktop system units typically contain the system's electronic components and selected secondary storage devices .Notebook system units are portable and much smaller.They contain the electroniccomponents5selected secondary storage devices,and input device ・Tablet PC system units are highly protable devices that support the use of a stylus or pen to input commands and data.Handheld computer system units are the smallest and are designed to fit into the palm of one hand.2.The two basic components are:the control unit and the arithmetic-logic unit・Control unit tells the rest of the computer system how to carry out a program's instructions.3.There are three types of memory chips:RAM, ROM, and CMOS.RAM chips hold the program and data that the CPU is presently processing,everything in most types of RAM is lost as soon as the microcomputer is turned off or a power failure・ ROM chips have programs built into them at the factory・ ROM chips are not volatile and cannot be changed by the user.CMOS chips provides flexibility and expandability for a computersystem.lt contains essential information that is required every time the computer system is turned on.It is powered by a battery and does not lose its contents when the power is turned.Its contents can be changed to reflect changes in the computer system.4.Five expansion cards are:graphics cards,sound cards,modem cards,NIC and TV tuner cards.Graphics cards connect the system board to the computer's monitor,they convert the internal electronic sighals to video signals so they can be displayed on the monitor.Sound cards accept audio input from a microphone and convert it into a form that can beprocessed by the computer,they also convert internal electronic signals to audio signals.Modem cards allow distant computers to communicate with one another by converting electronic signals from within the system unit into electronic signals that can travel over telephone lines and other types of connections・NIC are used to connect a computer to one or more other computers・TV tuner cards can changes the TV signal into one that can be displayed on you monitor.5・ Four standard ports are:serial ports,parallel ports, universal serial bus ports and firewire ports.Serial ports are often used to connect a mouse,keyboard,modem,and many other devices to the system unit.Parallel portsa are used to connect external devices that need to send or receive a lot of data overa short distance・USB ports are gradually replacing serial and parallel ports.FireWire ports provide connections to specialized FireWire devices・。

计算方法——第一章——课后习题答案_刘师少

计算方法——第一章——课后习题答案_刘师少

1.1 设3.14, 3.1415, 3.1416分别作为π的近似值时所具有的有效数字位数解 近似值x =3.14=0.314×101,即m =1,它的绝对误差是 -0.001 592 6…,有31105.06592001.0-*⨯≤=- x x . 即n =3,故x =3.14有3位有效数字. x =3.14准确到小数点后第2位. 又近似值x =3.1416,它的绝对误差是0.0000074…,有 5-1*10⨯50≤00000740=-.. x x即m =1,n =5,x =3.1416有5位有效数字. 而近似值x =3.1415,它的绝对误差是0.0000926…,有 4-1*10⨯50≤00009260=-.. x x即m =1,n =4,x =3.1415有4位有效数字.这就是说某数有s 位数,若末位数字是四舍五入得到的,那么该数有s 位有效数字1.2 指出下列各数具有几位有效数字,及其绝对误差限和相对误差限:2.0004 -0.00200 9000 9000.00解 (1)∵ 2.0004=0.20004×101, m=1 绝对误差限:4105.0000049.020004.0-*⨯≤≤-=-x x xm -n =-4,m =1则n =5,故x =2.0004有5位有效数字1x =2,相对误差限000025.010221102151)1(1=⨯⨯=⨯⨯=---n r x ε (2)∵ -0.00200= -0.2×10-2, m =-2 5105.00000049.0)00200.0(-*⨯≤≤--=-x x xm -n =-5, m =-2则n =3,故x =-0.00200有3位有效数字1x =2,相对误差限3110221-⨯⨯=r ε=0.0025 (3) ∵ 9000=0.9000×104, m =4, 0105.049.09000⨯<≤-=-*x x xm -n =0, m =4则n =4,故x =9000有4位有效数字4110921-⨯⨯=r ε=0.000056 (4) ∵9000.00=0.900000×104, m =4,2105.00049.000.9000-*⨯<≤-=-x x xm -n =-2, m =4则n =6,故x =9000.00有6位有效数字 相对误差限为6110921-⨯⨯=rε=0.000 00056由(3)与(4)可以看到小数点之后的0,不是可有可无的,它是有实际意义的.10-的近似值是多少?1.3 ln2=0.69314718…,精确到310-=0.001,即绝对误差限是ε=0.0005,解精确到3故至少要保留小数点后三位才可以.ln2≈0.6931.1 设3.14, 3.1415, 3.1416分别作为π的近似值时所具有的有效数字位数解近似值x=3.14=0.314×101,即m=1,它的绝对误差是-0.001 592 6…,有.即n=3,故x=3.14有3位有效数字.x=3.14准确到小数点后第2位.又近似值x=3.1416,它的绝对误差是0.0000074…,有即m=1,n=5,x=3.1416有5位有效数字.而近似值x=3.1415,它的绝对误差是0.0000926…,有即m=1,n=4,x=3.1415有4位有效数字.这就是说某数有s位数,若末位数字是四舍五入得到的,那么该数有s位有效数字1.2指出下列各数具有几位有效数字,及其绝对误差限和相对误差限:2.0004 -0.00200 9000 9000.00 解(1)∵ 2.0004=0.20004×101, m=1绝对误差限:m-n=-4,m=1则n=5,故x=2.0004有5位有效数字=2,相对误差限(2)∵ -0.00200= -0.2×10-2, m=-2m-n=-5,m=-2则n=3,故x=-0.00200有3位有效数字=2,相对误差限 =0.0025(3)∵ 9000=0.9000×104, m=4,m-n=0,m=4则n=4,故x=9000有4位有效数字=0.000056(4) ∵9000.00=0.900000×104, m=4,m-n=-2,m=4则n=6,故x=9000.00有6位有效数字相对误差限为=0.000 00056由(3)与(4)可以看到小数点之后的0,不是可有可无的,它是有实际意义的.1.3 ln2=0.69314718…,精确到的近似值是多少?解精确到=0.001,即绝对误差限是e=0.0005,故至少要保留小数点后三位才可以.ln2»0.6932.1 用二分法求方程在[1, 2]的近似根,要求误差不超过至少要二分多少?解:给定误差限e=0.5×10-3,使用二分法时,误差限为只要取k满足即可,亦即只要取n=10.2.3 证明方程1 -x–sin x=0 在区间[0, 1]内有一个根,使用二分法求误差不超过0.5×10-4的根要二分多少次?证明令f(x)=1-x-sin x,∵f(0)=1>0,f(1)=-sin1<0∴f(x)=1-x-sin x=0在[0,1]有根.又f¢(x)=-1-c os x<0 (xÎ[0.1]),故f(x) 在[0,1]单调减少,所以f(x) 在区间[0,1]内有唯一实根.给定误差限e=0.5×10-4,使用二分法时,误差限为只要取k满足即可,亦即只要取n=14.。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

第一章 误差1. 试举例,说明什么是模型误差,什么是方法误差.解: 例如,把地球近似看为一个标准球体,利用公式24A r π=计算其表面积,这个近似看为球体的过程产生的误差即为模型误差.在计算过程中,要用到π,我们利用无穷乘积公式计算π的值:12222...q q π=⋅⋅⋅ 其中112,3,...n q q n +⎧=⎪⎨==⎪⎩ 我们取前9项的乘积作为π的近似值,得3.141587725...π≈这个去掉π的无穷乘积公式中第9项后的部分产生的误差就是方法误差,也成为截断误差.2. 按照四舍五入的原则,将下列各数舍成五位有效数字:7 015 50 651 13 236 23 解: 0 7 2363. 下列各数是按照四舍五入原则得到的近似数,它们各有几位有效数字 13 05 0解: 五位 三位 六位 四位4. 若1/4用表示,问有多少位有效数字 解: 两位5. 若 1.1062,0.947a b ==,是经过舍入后得到的近似值,问:,a b a b +⨯各有几位有效数字解: 已知4311d 10,d 1022a b --<⨯<⨯, 又0.2053210a b +=⨯,()433211110100.551010222d a b da db da db ----+=+≤+=⨯+⨯=⨯<⨯,所以a b +有三位有效数字;因为0.1047571410a b ⨯=⨯,()43321110.94710 1.1062100.600451010222d a b b da a db ----⨯=+=⋅⨯+⋅⨯=⨯<⨯所以a b ⨯有三位有效数字.6. 设120.9863,0.0062y y ==,是经过舍入后作为12,x x 的近似值.求1211,y y 的计算值与真值的相对误差限及12y y ⋅与真值的相对误差限. 解: 已知-4-41112221211d ,d ,d =10,d 1022x y x x y x x x =+=+⨯=⨯, ()44111111110d d 12dr dr 0.50100.9863x xx x x y --⨯⎛⎫==≈=≈⨯ ⎪⎝⎭;()42222222110d d 12dr dr 0.81100.0062x xx x x y --⨯⎛⎫==≈=≈⨯ ⎪⎝⎭;()()()4221212dr dr dr 0.50100.81100.8210x x x x ---⋅=+≈⨯+⨯≈⨯.7. 正方形的边长约为100cm,应该怎样测量,才能使其面积的误差不超过1cm 2.解: 设正方形面积为S,边长为a,则S=a 2.所以要使:2d d 2d 1s a a a ==≤,则要求211d 0.5102200a a -≤==⨯.所以边长的误差不能超过20.510-⨯cm.8. 用观测恒星的方法求得某地维度为4502'''o(读到秒),试问:计算sin ϕ将有多大误差解: ()()1d sin cos d cos 45022ϕϕϕ*''⎛⎫'''== ⎪⎝⎭o.9 . 真空中自由落体运动距离s 与时间的关系由公式212s gt =确定,g 是重力加速度.现在假设g 是准确的,而对t 的测量有0.1s ±的误差,证明t 增加时,距离的绝对误差增加而相对误差却减小. 证明: 因为:221d d d d d d d ;2.122s gt t gt t t s gt gt t s s t gt ⎛⎫=====⎪⎝⎭ d s 与t 成正比, d s s 与t 成反比,所以当d t 固定的时候, t 增加时,距离的绝对误差增加而相对误差却减小.10. 设0x >,x 的相对误差为δ,求ln x 的绝对误差. 解: 已知d x x δ=,所以ln x 的绝对误差()d d ln x x xδ==.11. 设x 的相对误差为%α,求nx 的相对误差.解: 1d d d %n n n n x nx x n xn x x xα-===.12. 计算球的体积,为了使相对误差限为1%,问度量半径R 时允许的相对误差限如何 解: 已知343V R π=,设()d dr R R a R ==,则要使得 ()()3d dr dln d ln 3d ln 3d ln 3dr 31%VV V R R R R a V========,则11%3a =⋅.第二章 插值法与数值微分1.设y =在100,121,144x =三处的值是很容易求得的,试以这三个点建立y =二次插值多项式,,且给出误差估计.用其中的任意两点,构造线性插值函数,用得到的三个线性插值函数,,并分析其结果不同的原因.解: 已知012012100,121,144;10,11,12x x x y y y ======,建立二次Lagrange 插值函数可得:()()()()()()()()()()()()()21211441001441011100121100144121100121144121100 12144121144100x x x x L x x x ----=+------+--()211510.7228L ≈=.误差()()()()()()2012012,,,,3!f R x x x x x x x x x x ξξξ'''=---∈,所以20.00065550.001631R <<利用前两个节点建立线性插值函数可得:()()()()()11211001011100121121100x x L x --=+--()111510.7143L ≈=.利用后两个节点建立线性插值可得:()()()()()11441211112121144144121x x L x --=+--()111510.7391L ≈=.利用前后两个节点建立线性插值可得:()()()()()21441001012100144144100x x L x --=+--()111510.6818L ≈=.,二次插值比线性插值效果好,利用前两个节点的线性插值比其他两个线性插值效果好.此说明,二次插值比线性插值效果好,内插比外插效果好.2. 利用式证明()()()0121001max ,8x x x x x R x f x x x x ≤≤-''≤≤≤证明: 由式()()()()0101,2!f R x x x x x x x ξξ''=--<<当01x x x <<时,()()01max x x x f f x ξ≤≤''''≤,()()()01201101max 4x x x x x x x x x ≤≤--≤- 所以()()()0121001max ,8x x x x x R x f x x x x ≤≤-''≤≤≤3. 若()0,1,...,j x n 为互异节点,且有()()()()()()()()()011011............j j n j jj j j j j n x x x x x x x x l x xx x x x x x x -+-+----=----证明()0,0,1,...,nk kj j j x l x xk n =≡=∑证明: 由于() 1 ;0 .j i ij i j l x i j δ=⎧==⎨≠⎩且()0nkj j j x l x =∑和kx都为k 次多项式,而且在k+1个不同的节点处的函数值都相同 0,1,...,k n =, 所以马上有()0,0,1,...,nk kj j j x l x xk n =≡=∑.4. 设给出sin x 在[],ππ-上的数值表,用二次插值进行计算,若希望截断误差小于510-,问函数表的步长最大能取多少 解: 记插值函数为p(x),则()()()()()11sin sin 3!i i i x p x x x x x x x ξ-+'''-=--- 所以()()()()11cos max sin 3!i i i x x p x x x x x x ππξ-+-≤≤--=---()cos 1ξ-≤;令()()()()11i i i g x x x x x x x -+=---,设1i x x th -=+,得()()()[]3112,0,2i g x th h t t t t -+=--∈又()()()[]12,0,2t t t t t ϕ=--∈的最大值为10.3849ϕ⎛= ⎝⎭,所以有 350.3849max sin 106x x p h ππ--≤≤-≤<所以 0.0538h ≤.5. 用拉格朗日插值和牛顿插值找经过点()()()()3,1,0,2,3,2,6,10---的三次插值公式. 解: Lagrange 插值函数:()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()12302330101020310121301301223202123303132 31033101622731033 .2781/5x x x x x x x x x x x x L x y y x x x x x x x x x x x x x x x x x x x x x x x x y yx x x x x x x x x x x x x x x x x x x x x x x x ------=+------------++--------+--=++-+-++牛顿插值: 首先计算差商3 10 2 13 2 1.333 0.38896 104 0.8889 0.1420-----()()()()()3130.38893 1.142033.N x x x x x x x =-++-+++-也可以利用等距节点构造,首先计算差分3 10 2 33 24 76 10 12 16 23-----可得前插公式()()()()3072313112;26N x th t t t t t t -+=-++-+-- 和后插公式()()()()3316231012112.26N x th t t t t t t +=++-+-- 6.确定一次数不高于4的多项式()x ϕ,使()()()()()00,00,111,21ϕϕϕϕϕ''=====.解: 利用重节点计算差商0 00 0 01 1 1 11 1 1 0 12 1 0 1 1/2 1/4---则可构造Hermite 插值函数满足题设条件:()()()()()()()()()()()44320001001001100114139.424H x x x x x x x x x x x x x x =+-+------+----=-+7. 寻找过1n +个点01,,...,n x x x 的21n +次多项式()21n H x +,满足条件:()()()()()()()()()()()()21002111212100211121,,...,,,,..,.n n n n n n n n n n H x f x H x f x H x f x H x f x H x f x H x f x ++++++===''''''===解: 和Lagrange 插值函数的构造类似,可将插值函数写成()()%()(),21,0nn i n n i i ii H x h x y h x y +='=+∑其中,基函数满足条件 (1)()%()(),,,21n i n ih x hx P n ∈+;(2)()()%()%(),,,,,0;,0n i n i n ijijn i j j ijj h x h x h x h x δδ''==== 则可由已知条件,可得()()()()2,,,12n i n i i i n i h x l x x x l x '⎡⎤=--⎣⎦;%()()()2,,n i i n i h x x x l x '=-. 所以可得()()()()()()()2221,,,012nn n i i i n i i i n i i i H x l x x x l x y x x l x y +=''⎡⎤=--+-⎣⎦∑8. 过0,1两点构造一个三次Hermite 插值多项式,满足条件:()()()()1101,0,12,122f f f f ''====解: 计算重节点的差商0 10 1 1/21 2 1 1/21 2 1/2 -1/2 1-马上可得()()()()()()()33211100010012231122H x x x x x x x x x x =+-+------=-+++9. 过给定数组(2) 取第二类边界条件,作三次样条插值多项式.(3) 用两种插值函数分别计算75.5,78.3x x ==的函数值. 解: (1)做分段线性插值函数可得:()()()()()()()50123452.768 2.833 2.903 2.979 3.062 3.153I x l x l x l x l x l x l x =+++++ 其中, ()[][]076 75,76;0 75,76.x x l x x ⎧-∈⎪=⎨∉⎪⎩()[][][]175 75,7677 76,77;0 75,77.x x l x x x x ⎧-∈⎪=-∈⎨⎪∉⎩()[][][]276 76,7778 77,78;0 76,78.x x l x x x x ⎧-∈⎪=-∈⎨⎪∉⎩()[][][]377 77,7879 78,79;0 77,79.x x l x x x x ⎧-∈⎪=-∈⎨⎪∉⎩()[][][]478 78,7980 79,80;0 78,80.x x l x x x x ⎧-∈⎪=-∈⎨⎪∉⎩()[][]580 79,80;0 79,80.x x l x x ⎧-∈⎪=⎨∉⎪⎩(2)把已知节点值带入M 关系式可得:121232343451120.0152211 20.0182211 20.014221120.01622M M M M M M M M M M M M ⎧++=⎪⎪⎪++=⎪⎨⎪++=⎪⎪⎪++=⎩ 由边界条件可得050M M ==,所以上面方程组变为可求解方程组1212323434120.01521120.0182211 20.01422120.0162M M M M M M M M M M ⎧+=⎪⎪⎪++=⎪⎨⎪++=⎪⎪⎪+=⎩ 解得12340.0058,0.0067,0.0036,0.0071M M M M ====.所以可得在每个区间上的三次样条函数的表达式:()()()()()33111116666j j j j jj j j j j M M M M s x xx x x y x x y x x -----⎛⎫⎛⎫=-+-+--+-- ⎪ ⎪⎝⎭⎝⎭(3)当75.5x =时, ()()()50175.5 2.76875.5 2.83375.5 2.8005I l l =+=;()()()()()30.00580.005875.575.576 2.7687675.5 2.83375.575 2.79966s ⎛⎫=-+-+--= ⎪⎝⎭当78.3x=时, ()()()53475.5 2.97978.3 3.06278.3 3.0039I l l =+=;()()()()()330.00360.007178.37978.378.378660.00360.0071 2.9797978.3 3.06278.378 3.0034.66s =-+-⎛⎫⎛⎫+--+--= ⎪ ⎪⎝⎭⎝⎭10. 若给出sin ,cos ,tan x x x 的函数表:用表上的数据和任一插值公式求:(1) 用tan x 表格直接计算tan1.5695.(2) 用sin1.5695和cos1.5695来计算tan1.5695.并讨论这两个结果中误差变化的原因. 解: 利用Lagrange 插值直接用tan 表计算得tan1.5695819.0342874999274≈;利用Lagrange插值计算sin 得sin1.56950.99999917500000≈;利用Lagrange 插值计算cos 得cos1.56950.00129630000000≈;最后利用sin/cos 计算tan 得tan1.5695771.4257309264500≈.出现小除数,误差被放大.11. 求三次样条函数()s x ,已知和边界条件()()0.25 1.0000,0.530.6868s s ''==解: 把表中数据带入M 关系式可得12123234592 4.3143141432 2 3.26435534 2 2.428677M M M M M M M M M ⎧++=-⎪⎪⎪++=-⎨⎪⎪++=-⎪⎩由边界条件还可得到两个方程:01342 5.52002 2.1150M M M M +=-⎧⎨+=-⎩ 联立两个方程组可解得:012342.0284, 1.4632, 1.0319,0.8062,0.6544M M M M M =-=-=-=-=- 带入M 表达式便可得所求三次样条函数.12. 称n 阶方阵()ij A a =具有严格对角优势,若 1,1,2,...,nij ij j j i a a i n =≠>=∑(1) 试证明:具有严格对角优势的方阵必可逆.(2) 证明:方程组解存在唯一.证明: (1)设矩阵A 按行严格对角占优,如果A 奇异,则存在非零向量x 使得Ax=0,写成分量形式为10,1,2,...,n ijj j a x i n ===∑令指标0i 使得00i x x ∞=≠,则0000000000001111n n n ni i i i j j i j j i j i i j j j j j j i j i j i j i a x a x a x xa x a ∞====≠≠≠≠=-≤≤=∑∑∑∑因此 0000010n i i i i j j j i x a a =≠⎛⎫ ⎪-≤ ⎪ ⎪⎝⎭∑ 即 000010n i i i j j j i a a =≠-≤∑上式与矩阵按行严格对角占优矛盾,因此矩阵非奇异.(2)方程组()()()()0010101121212232121111 212 12 ............ 12 12n n n n n n n n M M M M M M M M M M M M M αβααβααβααβα------+=-++=-++=-++=-+n nβ⎧⎪⎪⎪⎪⎨⎪⎪⎪⎪=⎩ 由于该方程组系数矩阵为严格对角占优的方阵,所以由克拉默法则可知方程组存在唯一解.。

相关文档
最新文档