MT Cse330 Fall2023 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Online Midterm Examination : CSE330. All Sections.

Department of Computer Science & Engineering


BRAC University
Fall 2023 Semester
Date : November 08, 2023
Exam Time : One hour 15 minutes
Scanning and Uploading time : 15 minutes.

Faculty Name (Initial) : Student ID# : Section#:

Instructions:
• Answer as instructed below. Total marks 40.
• Answer questions sequentially. DO NOT mix part of one question with another question. Write legibly so that
we can follow your thoughts.
• Number your pages, and scan them sequentially when done, and prepare a single pdf file with the Top Sheet as
the first page.
• Use pencil for your answers (preferable). No break for bathroom/freshroom is allowed. Must use your own
calculator. Cell phones must be turned off (Not in vibration mode). We assume that you know how to use
scientific calculator of model CASIO fx-991 ES or equivalent.
• All students MUST follow the ‘Midterm Exam Policy’ published before.
• All examinees must abide by the ‘Regulations of Students Conduct’ of Brac university.
• Wait and stay in front of the camera till the end of exam. DO NOT leave before that.
• NO Email submission. The scanned pdf file of your answer script MUST be submitted through the Google
Form Submission Link provided in the Discord server for CSE330.

Read carefully the questions below and answer properly:


1. (4 marks) CO-1: Answer any one from Questions-(1a-1b):
(a) (4 marks) A function f (x) is interpolated by using Newton’s basis at the nodes {−1, 0, 1} and the Newton
coefficients are found to be a2 = 2, a1 = 1 and a0 = 0. If the interpolation function is computed using
Vandermonde method at the same nodes, what would be the Taylor coefficients of the interpolating function.
(b) In Richardson extrapolation, the parameter h is replaced by h/2, and hence we define the first order extrap-
olated derivative as
(1) 22 Dh/2 − Dh
Dh = .
3
i. (2 marks) Explain if it is necessary to replace h by h/2.
(1)
ii. (2 marks) Write down how we need to define Dh if we replace h by h/n where n is a nonzero positive
integer. Note that you do not need to derive the expression.
2. CO-2: Answer any one from Questions-(2a-2b):
(a) You are asked to analyze the climate change data set which contains the average temperature of a day for
the last ten years. Answer the following:
i. (3 marks) Name the methods you can use to represent the data set and find the average temperature
of a day within the given ten years period.
ii. (1 mark) If we want to make the data set dynamic, which method you should use to keep your results
up -to-date.
iii. (4 marks) Usually equally spaced data set are used to obtain the interpolation polynomial. Suppose you
obtained the Taylor coefficients a0 = 1, a1 = 0 and a2 = −1 of an interpolating polynomial using equally
spaced data. Now if you use non-equally spaced data, will these coefficients have the same values or
different values? Explain your answer.
(b) Answer the following:
i. (2+2 marks) The following Data set is generated by the function f (x) = x sin(x) − x + cos(x).

x 1.1 1.2 1.3


f (x) 0.3339 0.2808 0.2201
Online Midterm Exam CSE 330 November 08, 2023

Based on the above data, compute f ′ (1.2) using Central Difference method, and also calculate the
relative error. Use 4 significant figures.
(1)
ii. (4 marks) During the lecture, we derived first order numerical derivative, Dh , using Richardson extrap-
(1)
olation method by replacing h → h/2. Derive an expression for Dh by replacing h → h/4 using the
Richardson extrapolation method.

3. CO-3: Answer any two from Questions-(3a-3c):


(a) (6 marks) Consider the nodes at (1, 10), (2, 15), (3, 20). Using Newton’s divided difference method, evaluate
a polynomial that goes through the above nodes.
(b) (6 marks) Consider the function f (x) = x2 ex . Evaluate the numerical derivative of f (x) at x = 2.0 with
step size h = 0.2 using the backward and central difference methods up to 5 significant figures.
(c) (6 marks) Evaluate the upper bound of truncation error for the function f (x) = x sin(x) − x + cos(x) if we
compute the numerical derivative at x = 1.2 by the Central Difference method and h = 0.1.
4. CO-4: Answer any two from Questions-(3a-3c):
(a) (4+4 marks) A computing system exists with β = 2, exponent e ∈ [−2, 3], and mantissa m = 3. Express
the floating-point representation of the numbers x = 13.125, y = 11.625 using the normalized form, and
calculate fl[x + y] in binary form and then convert it to the decimal form.
(b) An interpolating polynomial, p1 (x) = 1.648(x − 1) is derived for the function f (x) = x ln x at the nodes
(x0 = 1, x1 = 3) using the Lagrange method. Answer the following keeping up to 4 significant figures.
i. (2 marks) Explain what you need to do to obtain a degree 3 interpolation polynomial for the same
function f (x) and for the same nodal points (x0 = 1, x1 = 3).
ii. (6 marks) Calculate the bases of the degree 3 polynomial.
(c) (8 marks) The function f (x) = e3x −e−3x has been interpolated at the nodes at (-1, 0, 1) using Vandermonde
matrix method. Evaluate the upper bound of the interpolation error for the interval [-1.5, 1.5] using Cauchy’s
theorem. Keep up to 4 significant figures.

You might also like