Page 1
Part I (Multiple Choice): Choose the best answer
1. For equally spaced data, Newton’s backward formula uses ——- differences.
(A) Forward
(B) Central
(C) Backward
(D) Divided
2. Newton’s divided difference formula is used when:
(A) Data points are equally spaced only
(B) Data points are unequally spaced
(C) The function is periodic
(D) The derivative is known
3. What is numerical integration?
(A) Solving DEs numerically
(B) Approximating the area under a curve
(C) Estimating function values
(D) Minimizing error in equations using discrete data
4. In Newton’s forward formula, if h = 1 and ∆2 y0 = 4, the coefficient of p(p − 1) in the
polynomial (where p = (x − x0 )/h) is:
(A) 4
(B) 2
(C) 1
(D) 0.5
5. Which of the following is not a direct method for solving linear systems?
(A) Gauss elimination
(B) LU decomposition
(C) Gauss–Jacobi
(D) Matrix inversion
6. In numerical integration, which of the following contributes to convergence?
(A) Increasing the number of intervals
(B) Decreasing the accuracy of floating-point arithmetic
(C) Increasing the interval length
(D) Using an explicit method
7. The order of convergence of a numerical method is defined as:
Page 2
(A) The number of iterations needed
(B) The speed at which the number of correct digits increases
(C) A measure of how fast the error reduces relative to the previous error
(D) The number of steps per iteration
8. The second divided difference f [x0 , x1 , x2 ] is calculated as:
f (x1 )−f (x0 )
(A) x2 −x0
f [x1 ,x2 ]−f [x0 ,x1 ]
(B) x2 −x0
(C) f [x0 , x1 ] + f [x1 , x2 ]
f [x1 ,x2 ]+f [x0 ,x1 ]
(D) 2
9. What is the main goal of interpolation?
(A) To find the derivative of a function
(B) To solve a differential equation
(C) To minimize the error in computation
(D) To estimate unknown values between known data points
10. Which of the following affects the accuracy of numerical differentiation?
(A) Step size h
(B) Number of iterations
(C) Integration constant
(D) Order of the differential equation
Page 3
11. Which of the following is true about Simpson’s 1/3 Rule?
(A) It uses linear approximation
(B) It is less accurate than the Trapezoidal
(C) It uses parabolic approximation
(D) It cannot be used for definite integrals
12. Given 3 data points, Lagrange interpolation will yield a polynomial of degree at most:
(A) 1 (B) 2 (C) 3 (D) 4
13. Newton’s forward interpolation formula is used when:
(A) Interpolation is near the end of the table
(B) The data points are unequally spaced
(C) Interpolation is near the beginning of the table
(D) The function is periodic
14. Which method would you avoid for derivative at endpoints due to large error?
(A) Forward difference
(B) Backward difference
(C) Central difference
(D) Lagrange with 5 points
15. What is a key difference between a MATLAB script and a function?
(A) Scripts accept inputs, functions do not
(B) Functions have local variables, scripts use the workspace
(C) Scripts can return outputs, functions cannot
(D) Functions cannot use loops
16. What does x = linspace(0,1,5) produce?
(A) [0, 0.2, 0.4, 0.6, 0.8]
(B) [0, 0.25, 0.5, 0.75, 1]
(C) [0, 1, 2, 3, 4]
(D) [1, 2, 3, 4, 5]
17. Your iterative solver runs indefinitely. Which is the most likely cause?
(A) The loop variable is not incremented.
(B) The termination tolerance is too strict.
(C) A disp() statement is missing.
(D) None
Page 4
18. Which command creates a row vector?
A. a = [1; 2; 3] B. a = [123] C. a = [1, 2, 3] D. B and C
19. The MATLAB command roots([1 -5 6]) computes roots of:
A. x2 − 5x + 6 = 0 B. x2 + 5x − 6 = 0
20. You get the error: ”Matrix dimensions must agree.” Which operation likely caused it?
(A) A + B where A & B are same-sized matr.
(B) A. ∗ B where A is 3 × 2 and B is 2 × 3
(C) A ∗ B where A is 3 × 2 and B is 2 × 3
(D) A’(transpose of A).
21. The ”Undefined function or variable” error in a script is commonly caused by:
A. A missing semicolon
B. A typo in the function or variable name, or the file not being on the path
C. Using a built-in function name
D. Having too many comments
22. Which statement correctly describes MATLAB scripts?
A. They require input arguments
B. They execute in an isolated workspace
C. They share variables with the base workspace
D. They must return at least one output
23. Which statement is FALSE?
A. MATLAB is designed primarily for numerical computing
B. Python requires external libraries for numerical methods
C. Python cannot handle large-scale numerical problems
D. MATLAB uses vectorization for efficiency
24. Gauss–Seidel method generally converges faster than Gauss–Jacobi because:
(A) It uses parallel computation
(B) It uses updated values immediately within the same iteration
(C) It requires no initial guess
(D) It is a direct method
Page 5
Short Answer and workout questions
1. Floating-point arithmetic may introduce errors due to limited precision.
2. If the Gauss Seidel method is used to solve the system of linear equations
2x1 + x2 + 5x3 = 15
2x1 + x2 + x3 = 8
x1 + 3x2 + x3 = 10
with initial guess X (0) = (x01 , x02 , x03 ) = (0, 0, 0), then the components of X (1) =
(x11 , x12 , x13 ) are: x11 = and x13 =
1 2 −1 0
3. Given a linear system of equation Ax = b where A = 2 8 0 and b = 8.
−1 0 4 4
Using Doolittle LU decomposition method, Decompose Matrix A L = U=
4. What is the result of 0.1 + 0.2 == 0.3 in MATLAB? (1/0)
5. What is the output of 3 > 2 && ∼ (4 < 5) in MATLAB? (1/0)
6. Given the following data
X 0 1 2 3 4
Y=f(x) 1.0 1.5 2.2 3.1 4.6
Then ∇3 f (3) =
7. The error of interpolation at every tabulated point is equal to zero. (True/False)
8. The degree of the polynomial that interpolates a given set of n points is at most equal
to n. (True/False)
9. Simpson’s one-third rule of integration is more accurate than Simpson’s three-eighth
rule of integration. (True/False)
10. represent the number 79.125 in 32 bit single precision(IEEE-754).
Page 6
Workout
1. Given that f (1) = −1, f (2) = −2, f (3) = −1 and f (4) = 2, find an interpolating
polynomial using Newton’s forward difference formula.
2. (a) Complete the divided difference table below. (1 Point)
x f (x) f [., .] f [., ., .] f [., ., ., .]
-2 2
-1 -1
0 -2
3 7
(b) Derive interpolating polynomial by using Lagrange’s interpolation formula.
(c) Derive interpolating polynomial by using Newton’s divided difference formula.
(d) Approximate f (2)
(e) Estimate f 0 (4) and f 00 (4)
Use the difference table below to answer questions from 2 - 4.
x f (x) = ln x ∆ ∆2 ∆3 ∆4
4.90 1.5892
5.00 1.6094 0.0202
5.10 1.6292 0.0198 -0.0004
5.20 1.6487 0.0195 -0.0003 0.0001
5.30 1.6677 0.0190 -0.0005 -0.0002 -0.0003
2. (a) Using the appropriate Newton’s difference formula, approximate ln 5.25.
(b) Give the corresponding error by comparing your results in part (a) with the exact
value.
3. (a) Find f 0 (4.90) and f 00 (4.90)
(b) Give the corresponding errors for each by comparing your results in part (a) with
the exact values.
Z 5.30
4. Approximate f (x) dx by using
4.90
(a) Trapezoidal rule where Rthe step length is h = 0.10 and compare your result with
the exact value (Hint: ln x dx = x ln x − x + c)
(b) Simpson’s rule where the step length is h = 0.10 and compare your result with
the exact value.
(c) Give the error bound of the approximation in (a) and to how many significant
figures is your approximation correct?
(d) Give the error bound in the approximation in (b) and to how many significant
figures is your approximation correct?
Page 7
(e) The voltage V (t) across the capacitor changes at the rate:
dV
= −V, V (0) = 10
dt
Find V (t) at t = 1 seconds using:
(a) Euler’s method with step size h = 0.5
(b) The 4th-order Runge-Kutta (RK4) method with h = 0.5