Tribhuwan University

Institute of Science and Technology

2081

Bachelor Level / Second Year / Third Semester / Science

B.Sc in Computer Science and Information Technology (CSC212)

(Numerical Method)

Full Marks: 60

Pass Marks: 24

Time: 3 Hours

Candidates are required to give their answers in their own words as for as practicable.

The figures in the margin indicate full marks.

Section A

Long Answers Questions

Attempt any TWO questions.
[2*10=20]
1.
What are inherent errors? Derive the Newton Raphson method for solving non-linear equation and using this method solve the following equation up to 3 decimal places:
x25x+6=0x^2 - 5x + 6 = 0
[10]
2.
What are the limitations of direct methods for solving a system of linear equations? How does Gauss Seidel method differ from Jacobi iteration? Solve the following system of linear equations using Jacobi iteration method:
2x7y10z=172x - 7y - 10z = -17
5x+y+3z=145x + y + 3z = 14
x+10y+9z=7x + 10y + 9z = 7
[10]
3.
Write an algorithm and program to implement Lagrange interpolation method. [10]
Section B

Short Answers Questions

Attempt any Eight questions.
[8*5=40]
4.
Consider the following data points. Estimate f(0.6)f(0.6) using Newton's interpolation formula.
x0.10.20.30.40.5f(x)2.683.043.383.693.97\begin{array}{c|ccccc} x & 0.1 & 0.2 & 0.3 & 0.4 & 0.5 \\ \hline f(x) & 2.68 & 3.04 & 3.38 & 3.69 & 3.97 \end{array}
[5]
5.
What is regression analysis? Fit a second order polynomial for the following data values.
x246810y1.42.02.42.62.8\begin{array}{c|ccccc} x & 2 & 4 & 6 & 8 & 10 \\ \hline y & 1.4 & 2.0 & 2.4 & 2.6 & 2.8 \end{array}
[5]
6.
What is numerical differentiation? The table below gives the values of distance travelled by a vehicle at various time intervals. Estimate the velocity and acceleration at x=4x = 4.
Time(x)124810Distance(y)0152127\begin{array}{c|ccccc} \text{Time}(x) & 1 & 2 & 4 & 8 & 10 \\ \hline \text{Distance}(y) & 0 & 1 & 5 & 21 & 27 \end{array}
[5]
7.
What is an application of numerical integration? Find the value of the integral using Simpson's 3/8 rule with n=6n = 6.
12exxdx\int_{1}^{2} \frac{e^x}{x} dx
[5]
8.
Solve the following system of linear equations using Gauss-Jordan elimination method:
x+2y3z=4x + 2y - 3z = 4
2x+4y6z=82x + 4y - 6z = 8
x2y+5z=4x - 2y + 5z = 4
[5]
9.
Given the data points below, find cubic spline which belongs to 1x31 \leq x \leq 3 and estimate f(2)f(2) using cubic splines.
x1.03.04.0f(x)1.54.59.0\begin{array}{c|ccc} x & 1.0 & 3.0 & 4.0 \\ \hline f(x) & 1.5 & 4.5 & 9.0 \end{array}
[5]
10.
What is differential equation? Differentiate between ODE and PDE with example. [5]
11.
Solve dydx=xy\frac{dy}{dx} = \frac{x}{y}, y(0)=1y(0) = 1, at x=0.4x = 0.4 using Runge-Kutta's 4th order method.
dydx=xy,y(0)=1,x=0.4\frac{dy}{dx} = \frac{x}{y}, \quad y(0) = 1, \quad x = 0.4
[5]
12.
Solve the Poisson equation with boundary conditions:
2ux2+2uy2=64xy,0x1,  0y1\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} = -64xy, \quad 0 \leq x \leq 1, \; 0 \leq y \leq 1
u(0,y)=0,  u(x,0)=0,  u(1,y)=150,  u(x,1)=150,  h=13u(0,y) = 0, \; u(x,0) = 0, \; u(1,y) = 150, \; u(x,1) = 150, \; h = \frac{1}{3}
[5]