辅导案例-MATH 266

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
PAPER CODE NO.
MATH 266
EXAMINER: Dr Ian Thompson TEL.NO. 44012
DEPARTMENT: Mathematical Sciences
MAY 2019 EXAMINATIONS
Numerical Methods
Time allowed: Two and a half hours
INSTRUCTIONS TO CANDIDATES
Answer ALL of Section A and THREE questions from Section B. Students
who answer more than three questions in section B will receive credit for
the best three answers only. The marks shown against questions, or parts
of questions, indicate their relative weight. Section A carries 55% of the
available marks.
Questions A1–A10 must be answered on a multiple choice answer sheet.
In addition, you should write your name and student ID number in the
boxes below, and circle your answers to questions A1–A10 on the exam
paper itself. These answers will be used if there a problem reading the
multiple choice answer sheet. Other questions should be answered in an
examination booklet, in the usual way.
Name:
Student ID number:
Paper Code MATH 266 Page 1 of 9 CONTINUED
Section A
A1. Consider the following sequence of Maple statements.
A := Array( 1 .. 4 ) :
A[1] := 3 :
for j from 2 to 4 do
A[j] := 2 * A[j-1] :
end do :
After these are executed, what values are contained in the array A?
A.
[
0 0 0 0 ]
B.
[
6 12 24 48 ]
C.
[
3 6 9 12 ]
D.
[
3 5 7 9 ]
E.
[
3 6 12 24 ]
[2 marks]
A2. Consider the following sequence of Maple statements.
a := -5 :
b := a + 2 :
a , b := a + b , a - b :
After these are executed, what value is associated with the name a?
A. −8 B. −5 C. 8 D. 2 E. −2 [2 marks]
A3. Suppose that x˜ is an approximation to x with relative error −0.0004. Which
of the following statements is correct?
A. x˜ has no correct significant figures, because the error is negative.
B. x˜ is definitely correct to 3 significant figures. It cannot be correct
to 4.
C. x˜ is definitely correct to 3 significant figures. It may be correct to
4, but it cannot be correct to 5.
D. x˜ is definitely correct to 4 significant figures. It cannot be correct
to 5.
E. x˜ is definitely correct to 4 significant figures. It may be correct to
5, but it cannot be correct to 6.
[2 marks]
Paper Code MATH 266 Page 2 of 9 CONTINUED
A4. Consider the quadratic equation y2 + (7× 1010) y + 1 = 0, which has real
roots t1 and t2 with |t1| > |t2|. Which of the following is the most accurate
approximation to t2?
A. −1.428571429× 10−11
B. −2.857142857× 10−11
C. 2.857142857× 10−11
D. 0.001
E. −0.001
[2 marks]
A5. Suppose that f(x) is continuous for a ≤ x ≤ b, and that f(a)f(b) < 0.
Which of the following statements is correct?
A. There are no roots between a and b.
B. There is precisely one root between a and b.
C. There is at least one root between a and b.
D. There are at least three roots: a, b and a point c such that
a < c < b.
E. There is a turning point between a and b.
[2 marks]
A6. Which of the following functions has a fixed point at x = 1?
A. f(x) = 1 + cos(pix).
B. f(x) = x2 + 1.
C. f(x) = x3 − 4x.
D. f(x) =
1
2− x .
E. f(x) = (x− 2)2 + 1.
[2 marks]
A7. What is the infinity norm of the vector [0, 8,−12, 5]?
A. 8 B. 12 C. −12 D. 25 E. √233. [2 marks]
Paper Code MATH 266 Page 3 of 9 CONTINUED
A8. What is the correct LU factorisation of the matrix A =
[
2 1
−5 3
]
?
A. L =
[
1 0
−5 1
]
U =
[
1 1
0 3
]
B. L =
[
0 0
−5 0
]
U =
[
2 1
0 3
]
C. L =
[
2 0
−5 11
2
]
U =
[
1 1
2
0 1
]
D. L =
[
1 0
− 5
2
1
]
U =
[
2 1
0 11
2
]
E. L =
[
2 0
5 − 11
2
]
U =
[
1 1
2
0 1
]
[2 marks]
A9. In timestepping, what is the principal advantage of Runge–Kutta (RK)
methods over Taylor’s method?
A. RK methods are more accurate.
B. RK methods are more likely to be stable.
C. RK methods can be used to solve more complicated problems.
D. RK methods do not require recalculation of integrals in each
specific problem.
E. RK methods do not require recalculation of derivatives in each
specific problem.
[2 marks]
A10. The integral Ij =
∫ xj
xj−1
f(x) dx is to be approximated by the trapezium
rule. What is the correct estimate?
A. Ij ≈ xj − xj−1
2
[
f(xj) + f(xj−1)
]
.
B. Ij ≈ xj + xj−1
2
[
f(xj) + f(xj−1)
]
.
C. Ij ≈ xj + xj−1
2
[
f(xj)− f(xj−1)
]
.
D. Ij ≈ xj − xj−1
xj
[
f(xj) + f(xj−1)
]
.
E. Ij ≈ (xj − xj−1)
2
2
[
f(xj) + f(xj−1)
]
.
[2 marks]
Paper Code MATH 266 Page 4 of 9 CONTINUED
A11. Consider Simpson’s rule on [−1, 1], which has the form∫ 1
−1
g(t) dt ≈ w1g(−1) + w2g(0) + w3g(1).
(a) By making an appropriate choice for g(t), show that w1 +w2 +w3 = 2.
[2 marks]
(b) Using the result of part (a), and the error formula
E =
∞∑
p=1
g(p)(0)
(p+ 1)!
Sp, where Sp = 1+(−1)p−(p+1)
[
w1(−1)p+w3
]
,
obtain the weights w1, w2 and w3. Hint: use symmetry. [3 marks]
(c) Calculate the first nonzero term in the sequence S1, S2, . . . [2 marks]
A12. (a) Write down the Jacobi iteration equations for the linear system 9 1 −4−5 6 −10
10 −4 −4
x1x2
x3
 =
 53
−6
 . [3 marks]
(b) Obtain the matrix form of the Jacobi iteration equations for the general
n× n linear system Ax = b. [4 marks]
Hint: consider a matrix D with diagonal entries matching those of A,
and zeros elsewhere.
A13. Consider the ordinary differential equation
y′(t) = sin
(
y(t)
)
.
(a) Obtain expressions for y′′(t) and y′′′(t) in terms of y(t). [3 marks]
(b) Starting from the Taylor series for y(t+ ∆t), show that the third order
explicit Taylor iteration scheme for this equation is
yj+1 = yj + ∆t sin(yj)
[
1 +
∆t
2
cos(yj) +
(∆t)2
6
cos(2yj)
]
,
where tj = j∆t and yj = y(tj). [4 marks]
A14. Suppose that the equation f(x) = 0 has a solution at x = c, and that
c0 and c1 are two approximations to c, with f(c0) 6= f(c1). An improved
approximation c2 is to be calculated using one step of the secant method.
(a) Draw a diagram to illustrate how this method works. [2 marks]
(b) Show that
c2 =
c0f(c1)− c1f(c0)
f(c1)− f(c0) . [5 marks]
Paper Code MATH 266 Page 5 of 9 CONTINUED
A15. The following code shows a flawed attempt to compute ln(1 + x2) using
the Taylor series
ln(1 + x2) = −
∞∑
j=1
(−1)j
j
x2j.
1 my_log := proc( x :: numeric )
2
3 local s , t , tj , j :
4
5 s := 0 :
6 t := -1 :
7
8 for j from 1 do
9
10 t := evalf( -t * x^2 ) :
11 tj := evalf( t / j ) :
12
13 if abs( tj < abs( s ) * 0.5 * 10^(-10) then
14 break :
15 end if :
16
17 s := s - tj :
18
19 end do :
20
21 return s :
22
23 end proc :
(a) Maple rejects the code due to a syntax error. Find this and indicate
how it should be corrected. [1 mark]
(b) With the syntax error corrected, the code is tested with x = 0.2 and
returns an incorrect result. Find the error that causes this and indicate
how it should be corrected. [2 marks]
(c) The above Taylor series only converges if |x| ≤ 1.
(i) What will happen if the procedure (with the corrections from
parts (a) and (b) applied) is called with an argument x such that
|x| > 1? [2 marks]
(ii) How should the code be edited to account for this? [2 marks]
Paper Code MATH 266 Page 6 of 9 CONTINUED
Section B
B1. Throughout this question, x˜ and y˜ are approximations to x and y, with
relative errors εx and εy, respectively.
(a) (i) Determine the relative error in x˜+ y˜. [3 marks]
(ii) Prove that the error cannot be magnified if x and y have the same
sign. [3 marks]
(iii) Suppose now that x and y have opposite signs. Under what cir-
cumstances is there a danger of catastrophic cancellation? Justify
your answer. [2 marks]
(b) (i) Find an exact formula for the relative error in sinh(x˜).
[4 marks]
(ii) Find an approximate formula for the relative error in sinh(x˜),
which is valid when |x| is small. Does computing sinh(x˜) cause a
significant magnification of rounding error in this case?
[3 marks]
In your answer to part (b), you may use any of the formulae
sinhx = x+
x3
3!
+
x5
5!
+ · · · coshx = 1 + x
2
2!
+
x4
4!
+ · · ·
and sinh(a+ b) = sinh(a) cosh(b) + cosh(b) sinh(a).
B2. Throughout this question, a function with a subscript n is a polynomial of
degree n. Recall that the Legendre polynomial Pn(t) has the property that∫ 1
−1
Pn(t)t
r dt = 0, r = 0, 1, . . . , n− 1.
(a) Let Cm(t) be an arbitrary polynomial of degree m, where m < n. Show
that ∫ 1
−1
Pn(t)Cm(t) dt = 0. [3 marks]
(b) Prove that Pn(t) has n distinct roots in the interval (−1, 1).
[5 marks]
(c) Recall that the n point Gaussian quadrature rule∫ 1
−1
g(t) dt ≈
n∑
q=1
wqg(tq)
exactly integrates polynomials of order 2n− 1 or lower. By considering
the factorisation
Q2n−1(t) = An−1(t)Pn(t) +Bn−1(t),
prove that the nodes tq are the roots of Pn(t). [7 marks]
Paper Code MATH 266 Page 7 of 9 CONTINUED
B3. Throughout this question, x ∈ [0, 1], and the points xj are defined for
integers j = 0, 1, . . . , N via xj = j∆x, where ∆x = 1/N and N is a positive
integer.
(a) Use Taylor series for u(x) to show that
u′′(xj) =
u(xj+1)− 2u(xj) + u(xj−1)
(∆x)2
+O
(
(∆x)2
)
. [4 marks]
To obtain full marks, you must retain enough terms in the Taylor series
to establish the order of the error.
(b) Given that the centred difference formula for the first derivative is
u′(xj) =
u(xj+1)− u(xj−1)
2∆x
+O
(
(∆x)2
)
,
obtain the discretised form of the differential equation
2u′′(x) + sin(pix)u′(x) + xu(x) = 0.
To obtain full marks, you must express your answer in the form
Pjuj−1 +Qjuj + Sjuj+1 = 0,
where uj = u(xj), and state the correct range for j. [5 marks]
(c) By introducing ghost points at x−1 and xN+1 and using the centred
difference formula for u′(x), apply the boundary conditions
u′(0) = 0 and u′(1) = 1.
Simplify the resulting equations as far as possible. [6 marks]
Paper Code MATH 266 Page 8 of 9 CONTINUED
B4. Recall that the Thomas algorithm can be used to solve the n×n tridiagonal
linear system
D1 U1
L2 D2 U2
L3 D3 U3
. . . . . . . . .
Ln−1 Dn−1 Un−1
Ln Dn


x1
x2
x3
...
xn−1
xn

=

R1
R2
R3
...
Rn−1
Rn

,
where blank entries in the matrix indicate zeros.
(a) During the first (forward) phase, the following replacements are made:
Dj → D′j = Dj −
LjUj−1
Dj−1
, Rj → R′j = Rj −
LjRj−1
Dj−1
, Lj → 0,
for j = 2, . . . , n.
(i) Explain why the number of divisions needed for the operations in
each row is one (not two). [1 mark]
(ii) Calculate df , mf and af , the total number of divisions, multi-
plications and additions/subtractions required to perform these
replacements. [3 marks]
(b) The second (backward) phase of the Thomas algorithm solves linear
systems of the form
D1 U1
D2 U2
D3 U3
. . . . . .
Dn−1 Un−1
Dn


x1
x2
x3
...
xn−1
xn

=

R1
R2
R3
...
Rn−1
Rn

,
by reducing the matrix to the identity.
(i) What replacements should be made in row n? [1 mark]
(ii) What replacements should be made in rows n − 1, n − 2, . . . , 1?
Explain your answer. [7 marks]
(iii) Calculate db, mb and ab, the total number of divisions, multipli-
cations and additions/ subtractions required to perform these
replacements. [3 marks]
Paper Code MATH 266 Page 9 of 9 END
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468