Final
Final
Final Exam
Ali Kashefi, UCLA, Fall 2023
• You have 180 minutes to complete this exam. There are thirteen questions
worth a total of 74 points.
• The exam is conducted in a written format. The exams are closed-book and
closed-notes. No formula sheets or cheat sheets are allowed. Electronic devices,
including calculators, are strictly prohibited. No internet connection is allowed.
• By signing below, you affirm that you have neither given nor received unautho-
rized help on this exam.
• Student ID:
• Signature:
1
Problem 1. 3 points The goal is to find the root of the function f (x) = ex − x − 1. Using
Newton’s method and with the initial guess (i.e., x0 ) of 1, we approximate x1 = k1 . What
is k? Report your answer (i.e., k) in terms of e, if e appears. Show your work and simplify
your final answer as much as possible. Box your final answer.
Recall that Newton’s method updates the current guess xn using the formula:
f (xn )
xn+1 = xn − .
f ′ (xn )
2
Problem 2. 3 points To find the root of a function f (x), one decides to use the accelerated
version of the Newton method. If at 10-th iteration, x10 = 13 4
, g( 13
4
) = 2, and g ′ ( 13
4
) = 8,
f (x)
where g(x) = f ′ (x) , what is x11 using the accelerated version of the Newton method? Show
your work and simplify your final answer as much as possible. Box your final answer.
Recall that the accelerated version of the Newton method can be written as follows
f (xn )f ′ (xn )
xn+1 = xn − ,
(f ′ (xn ))2 − f (xn )f ′′ (xn )
where f ′′ (x) is the second derivative of f (x).
Note that we know that the tolerance condition is not satisfied at the 10-th iteration, hence,
we need to compute x11 .
3
Problem 3. 3 points Consider the problem of numerical integration of a function f (x)
over the interval [−1, 1]. The 3-point Gaussian quadrature rule is given by
Z 1
f (x) dx ≈ w1 f (x1 ) + w2 f (x2 ) + w3 f (x3 ),
−1
using the 3-point Gaussian quadrature rule. Show your work and simplify your final answer
as much as possible. Box your final answer.
Hint: You are allowed to use the results (without proof) of the theory of Legendre polynomial
for the Gaussian quadrature rule, as discussed in class.
4
Problem 4. 3 points A mathematician measures the position x(ti ), velocity v(ti ), and
acceleration a(ti ) of a car moving in a straight line along the x-axis at discrete times
t0 , t1 , t2 , . . . , tn over a given time interval, for i = 0, 1, . . . , n. Note that from physics we
have the relationships v(t) = dx(t) dt
and a(t) = dv(t)
dt
. To interpolate the position and velocity,
the mathematician constructs a Hermite interpolation X(t) as follows:
n
X n
X
X(t) = Ai (t)x(ti ) + Bi (t)v(ti ),
i=0 i=0
where Ai (t) and Bi (t) are the corresponding known polynomials. The mathematician then
constructs another Hermite interpolation V (t) to interpolate the velocity and acceleration
as follows: n n
X X
V (t) = Ci (t)a(ti ) + Di (t)v(ti ),
i=0 i=0
where Ci (t) and Di (t) are polynomials as well. Write the polynomials Ci (t) and Di (t) in
terms of the other known terms, which are x(ti ), v(ti ), a(ti ), Ai (t), and Bi (t). Note that you
do not have to include all of them, but these are the possible options. Show your work and
simplify your final answer as much as possible. Box your final answer.
5
Problem 5. Consider the following ordinary differential equation:
du(x)
= u(x) + 1,
dx
Part (a) 3 points Use the forward finite difference method with the step size h = 0.05 to
approximate the function u at x = 0.1 with the initial condition u(0) = 1. Show your work
and simplify your final answer as much as possible. Box your final answer.
Part (b) 3 points Use the central finite difference method with the step size h = 0.05 to
approximate the function u at x = 0.1 with the initial condition u(0) = 1. Show your work
and simplify your final answer as much as possible. Box your final answer.
u(x + h) − u(x − h)
u′ (x) ≈ .
2h
6
Problem 6. 6 points Let f (x) be a smooth function. Using Taylor expansion, we develop
a fourth-order central difference approximation to f ′′ (x0 ) of the form
Recall that the Taylor series of a real-valued smooth function f (x) centered at x0 can be
written as ∞
X f (k) (x0 ) k
f (x0 + h) = h .
k=0
k!
Hint: Try to first construct f (x0 + h) + f (x0 − h) and f (x0 + 2h) + f (x0 − 2h), and then
perform suitable addition and/or subtraction as well as multiplication.
7
Extra Page
8
Problem 7. Consider an upper triangular matrix A and a vector b as follows
1000 4 2 2006
A= 0 2 1 , b = 3 .
0 0 1 1
Part (a) 2 points Find the vector x using the backward substitution that satisfies the
equation Ax = b, where
x1
x = x2 .
x3
Show your work and simplify your final answer as much as possible. Box your final answer.
Part (b) 3 points Imagine x1 , x2 , and x3 are the exact solution of the system of equation
Ax = b as described above. We use numerical software to solve Ax = b and the outputs of
the software are x1 + ϵ, x2 , and x3 , where ϵ is expected to be a small number compared to
x1 . Determine the maximum possible absolute value for ϵ, if the software uses the following
stopping criterion for iterating
||Ax − b||2 ≤ 10−6 ,
where || · · · ||2 indicates the L2 norm. Show your work and simplify your final answer as
much as possible. Box your final answer.
9
Problem 8. This problem is about the Gaussian elimination procedure.
Part (a) 3 points Consider the matrix B1 as follows
1 0 a1
B1 = 0 1 a2 ,
a1 a2 0
where a1 and a2 are real numbers. Without pivoting, perform 2 steps of the Gaussian elim-
ination on B1 . What is the form of B1 after these 2 steps? Show your work and simplify
your final answer as much as possible. Box your final answer.
Part (b) 6 points The matrix A has size m × n with n ≤ m and real components. Consider
the matrix B2 as follows
I A
B2 = ,
AT 0
where I is the identity matrix and 0 is the zero matrix. Without pivoting, perform m steps
of the Gaussian elimination on B2 . What is the form of B2 after these m steps? Show your
work and simplify your final answer as much as possible. Box your final answer.
Hint for part (b): Note that the matrix B1 is a specific version of the matrix B2 . Try to
connect the result you obtained in part (a) with what you are asked for in part (b).
Note that part (b) is the most challenging question of this exam. Recall the time management
strategy!
10
Extra Page
11
Problem 9. Consider the following definitions. We say that a matrix B such that B 2 = A
is a square root of A. We say that an n × n matrix Q is orthogonal if QT Q = I. Given an
n × n matrix A, the Singular Value Decomposition (SVD) of A is the factorization defined by
A = U ΣV T , with U and V orthogonal and Σ diagonal. We show the diagonal components
of the matrix Σ by σii . In general, it turns out that σii ≥ 0 for i = 1, 2, . . . , n. Note that it
is possible in general that σii = 0.
Now suppose C is Symmetric Positive Definite (SPD), and that C = LLT is the Cholesky
factorization of C. If L = U ΣV T is the SVD of L,
Part (a) 3 points Show that R = U ΣU T is a square root of C.
Part (b) 6 points Show that R is SPD.
12
Extra Page
13
Problem 10. An n × n matrix Q is said to be orthogonal if QT Q = In , where In denotes
the n × n identity matrix. Given a vector v ∈ Rn , we define the matrix Hv as follows:
2
Hv = In − vv T .
||v||2
Part (a) 2 points Show that Hv is symmetric.
Part (b) 2 points Show that Hv is orthogonal.
Part (c) 2 points Show that if vectors y and v are perpendicular to each other, the matrix-
vector product Hv y = y.
Part (d) 3 points Show that the matrix-vector product Hv v = −v.
Part (e) 6 points Suppose u and w are vectors such that ||u|| = ||w||, then we write
Hu−w u = αu + βw,
where α and β are real numbers. Find α and β. Show your work and simplify your final
answer as much as possible. Box your final answer.
14
Extra Page
15
Problem 11. 6 points Given
0 1 1
A = 1 0 1 ,
1 1 0
use partial pivoting to find a permutation matrix P , a lower triangular matrix L, and an
upper triangular matrix U such that P A = LU . Report the final form of matrices of P , L,
and U . Use the convention discussed in class for L. Show your work and simplify your final
answer as much as possible. Box your final answer.
16
Problem 12. 3 points As discussed in class, we need to solve a system of equations to
obtain the coefficient of cubic splines. This might be true for other types of polynomials.
For example, consider a function of the form
a0 + a1 x + · · · + am x m
P (x) = .
1 + b1 x + · · · + bm x m
Suppose we are given data points (x1 , y1 ), . . . , (x2m+1 , y2m+1 ). We would like to find co-
efficients a0 , . . . , am and b1 , . . . , bm such that P (x) interpolates the data points; such that
yi = P (xi ), for i = 1, . . . , 2m + 1. For this purpose, we need to express the system of
equations yi = P (xi ) as a Ac = d, where the vector c is defined as
a0
..
.
a
c = m .
b1
.
..
bm
Express the matrix A and the vector d in terms of data points. Show your work and simplify
your final answer as much as possible. Box your final answer.
17
Extra Page
18
Problem 13. 3 points Given three data points with (x0 , y0 ), (x1 , y1 ), and (x2 , y2 ), where
x0 < x1 < x2 , a mathematician uses the forward Newton formula to construct the interpo-
lation polynomial F (x) as follows
F (x) = a0 + a1 (x − x0 ) + a2 (x − x0 )(x − x1 ).
The mathematician then uses the backward Newton formula to construct the interpolation
polynomial B(x) as follows
B(x) = b2 + b1 (x − x2 ) + b0 (x − x2 )(x − x1 ).
Write b1 in terms of x0 , x1 , x2 , a0 , a1 , and a2 . You do not have to include all the above
terms, but these are the possible options. Specifically, note that y0 , y1 , and y2 are not among
the possible options. Show your work and simplify your final answer as much as possible.
Box your final answer.
19