Numerical Analysis, 2024
Name of Student:
Final exam solution (out of 35 points)
Page 1 of 3
Student number:
Supervisor’s signature:
1. (3 points) True or False: You are given the 3 × 3 linear system in augmented matrix form
5 0 −1 2
0 0 2 4
0 1 0 2
Because the diagonal of the coefficient matrix contains zero entries, it is not possible to apply the Jacobi iterative
method.
A. True
B. False
Answer: FALSE. Swapping rows 2 and 3 converts the matrix to upper triangular form with non-zeroes on the
diagonal, and Jacobi can then be applied.
2. (3 points) A cubic spline is defined by
S0 (x) = a0 + b0 x + c0 x2 + d0 x3 ,
if 0 ≤ x ≤ 1
S1 (x) = a1 + b1 (x − 1) + c1 (x − 1)2 + d1 (x − 1)3 , if 1 ≤ x ≤ 2
S(x) =
S2 (x) = a2 + b2 (x − 2) + c2 (x − 2)2 + d2 (x − 2)3 , if 2 ≤ x ≤ 3
Assuming that not-a-knot end-point conditions are used, which of the following statements about the coefficients
is true?
A. a0 = a1 = a2
B. b0 = b1 = b2
C. c0 = c1 = c2
D. d0 = d1 = d2
E. None of these
Answer: D. The not-a-knot end-point conditions match S0′′′ (1) = S1′′′ (1) and S1′′′ (2) = S2′′′ (2). Using S0′′′ = 6d0 ,
S1′′′ = 6d1 and S2′′′ = 6d2 , it’s easy to see that d0 = d1 = d2 .
3. (4 points) Which of the following is a third degree interpolating polynomial passing through (0, 0), (1, 1),
(2, 8), (3, 27), (4, 64)?
I. P3 (x) = x + 3x(x − 1) + x(x − 1)(x − 2)
II. P3 (x) = 1 + 7(x − 1) + 6(x − 1)(x − 2)
+(x − 1)(x − 2)(x − 3)
III. P3 (x) = 64 + 37(x − 4) + 9(x − 4)(x − 3)
+(x − 4)(x − 3)(x − 2)
A. I only
B. I and II only
C. I and III only
D. III only
E. I, II, and III
Answer: E
0
0
1
1
1
3
7
[Solution] Read the Newton divided difference table :
2
8
1
6
19
3
27
9
37
4
64
0
1
Numerical Analysis, 2024
Final exam solution (out of 35 points)
Page 2 of 3
4. (4 points) Apply one step of Newton’s Method to the system
x1 x2 + ex1 x2 = 0
3x2 + cos(x1 x2 ) = 0,
with starting point (0, 1).
A. (1/4, −1/3)
B. (−1/2, −1/3)
C. (−1/3, 1/4)
D. (1/3, 1/2)
E. None of these
Answer: B
5. (4 points) Let p(x) = ax2 + bx + c be the quadratic polynomial that interpolates f (x) = x6 + 2x4 − 3 at three
Chebyshev nodes on [−1, 1]. Find the value of c.
3
93
3
C. −
D. 0 E.
2
64
32
Answer: A [solution]
The three Chebyshev
nodes on [−1, 1] are given by xj = − cos((2j + 1)π/6), for j = 0, 1, 2,
√
√
namely,
x
=
−
3/2,
x
=
0,
x
=
3/2.
We have
0
1
2
√
− 3/2 f [x0 ] = −93/64
√
f [x0 x1 ] = −33 3/32
0
f [x1 ] = −3
f [x0 x1 x2 ] = 33/16
√
f [x1 x2 ] = 33 3/32
√
3/2
f [x2 ] = −93/64
A. −3
B. −
Thus,
√
√
√
93 33 3
33
33 2
p(x) = − −
(x + 3/2) + x(x + 3/2) =
x −3
64
32
16
16
interploates f at x0 , x1 and x2 .
6. (4 points) Let f be a smooth function and let h > 0. Consider the formula
f ′′ (x) ≈
2f (x) − 5f (x + h) + 4f (x + 2h) − f (x + 3h)
.
h2
Denoting by M > 0 an upper bound for f (4) (x) , we can bound the error by KM hd for some constants K and
d. Find K.
14
25
31
43
A.
B.
C.
D.
E. None of these
3
4
5
6
Answer: B
[solution]
h2 ′′
h3
h4
f (x) + f (3) (x) + f (4) (c1 )
2
3!
4!
3
4
2
8h
16h
4h
f ′′ (x) +
f (3) (x) +
f (4) (c2 )
f (x + 2h) = f (x) + 2hf ′ (x) +
2
3!
4!
9h2 ′′
27h3 (3)
81h4 (4)
f (x) +
f (x) +
f (c3 ),
f (x + 3h) = f (x) + 3hf ′ (x) +
2
3!
4!
f (x + h) = f (x) + hf ′ (x) +
where c1 , c2 , c3 are some constants in (x, x + 3h). Combining these terms as they appear in the formula, we
obtain
1
h2 ′′
′
f (x)(−5 + 16 − 9)
[f
(x)(2
−
5
+
4
−
1)
+
hf
(x)(−5
+
8
−
3)
+
h2
2
h3
h4
+ (−5 + 32 − 27) + (−5f (4) (c1 ) + 64f (4) (c2 ) − 81f (4) (c3 ))]
3!
4!
2
h
= f ′′ (x) + (−5f (4) (c1 ) + 64f (4) (c2 ) − 81f (4) (c3 )).
24
Thus, we can bound the error by 25M h2 /4, from which K = 25/4 (Note that the formula is second-order
accurate.)
Numerical Analysis, 2024
Final exam solution (out of 35 points)
Page 3 of 3
7. (8 points) Consider the integration rule
Z 4h
f (x)dx ≈
0
4h
[2f (h) − f (2h) + 2f (3h)] .
3
(a) (4 points) Find the degree of precision of this rule.
[Solution] Denoting the result of the integration rule by I(f ), we have
f (x) = 1
→
f (x) = x →
f (x) = x2
f (x) = x3
f (x) = x4
I(f ) =
Z 4h
1dx.
0
4h
I(f ) =
(2h − 2h + 6h) = 8h2 =
3
→ I(f ) =
→ I(f ) =
→
4h
(2 − 1 + 2) = 4h =
3
I(f ) =
Z 4h
xdx.
0
4h
64 3
(2h2 − 4h2 + 18h2 ) =
h =
3
3
4h
(2h3 − 8h3 + 54h3 ) = 64h4 =
3
Z 4h
0
Z 4h
x2 dx.
x3 dx.
0
592 5
1024 5
4h
(2h4 − 16h4 + 162h4 ) =
h ̸=
h =
3
3
5
Z 4h
x4 dx.
0
We deduce that this rule has degree of precision 3.
(b) (4 points) The error term for the above rule must be of the form Khd+2 f (d+1) (c) for some constants K, d,
and some c ∈ (0, 4h). Find K.
[Solution] From (a), we know that d = 3 so that
Z 4h
f (x)dx =
0
4h
[2f (h) − f (2h) + 2f (3h)] + Kh5 f (4) (c).
3
Plugging in f (x) = x4 yields f (4) (c) = 4! = 24 so we obtain
1024 5
592 5
1
h =
h + 24Kh5 → K =
5
3
24
1024 592
−
5
3
=
14
.
45
1
−1 .
1
1
8. (5 points) Find the 2nd row of R in the full QR factorization of the matrix 1
2
p
p
√
A. (0, 1/ 6) B. (0, 1/2) C. (0, 1) D. (0, 3/5) E. (0, 7/3)
Answer: E
Question:
1
2
3
4
5
6
7
8
Total
Points:
3
3
4
4
4
4
8
5
35
Score: