Jadavpur University
Session 2021-2022, Odd Semester
Computer Programming and Numerical Methods
1. Write a menu-driven program for solving a system of linear equations using Gauss-Elimination
method, Jacobi’s method and Gauss Elimination with pivoting method
2. Using the above program solve the following system of equations:
i. 𝑥 + 𝑦 + 𝑧 = 6 ii. 𝑥1 + 𝑥2 + 𝑥3 = 3 iii. 2𝑥1 + 4𝑥2 + 2𝑥3 = 15
𝑥+𝑦−𝑧 =0 2𝑥1 + 3𝑥2 + 𝑥3 = 6 2𝑥1 + 𝑥2 + 2𝑥3 = −5
𝑥−𝑦+𝑧 =2 𝑥1 − 𝑥2 − 𝑥3 = −3 4𝑥1 + 𝑥2 − 2𝑥3 = 0
3. Write a menu-driven program for implementing Interpolation using Lagrange's formula,
Newton’s forward difference formula, and Newton’s backward difference formula.
4. For the following table of values:
x 1 2 3 4
f(x) 1 8 27 64
Find f(2.5) using all three methods and comment on your answer
5. An experiment gave the following table of values for the dependent variable y for a set of known
values of x. Obtain an appropriate least squares fit for the data.
x 1 2 3 4 5 6 7 8 9
y 5.5 7.0 9.6 11.5 12.6 14.4 17.6 19.5 20.5