Code: A-07               Subject: NUMERICAL ANALYSIS & COMPUTER PROGRAMMING

Time: 3 Hours                                                                                                     Max. Marks: 100

·      Question 1 is compulsory and carries 16 marks.

·      Answer any THREE Questions each from Part I and Part II.

 

Q.1       Choose the correct or best alternative in the following:                                           (2x8)

a.       An approximation to  is written as .  If  in , then the error of approximation is bounded by

             (A)  .               (B)  .           (C)  .         (D)  .

 

b.      Newton-Raphson method is applied to find  where M > 0.  Then, the method can be written as  where R is   

            

             (A) . (B)  (C)  .          (D)  .

 

             c.   The system of equations  a is real, is to be solved iteratively using Jacobi method.  The method converges for    

 

             (A) .       (B)  .       (C)  all a.                   (D) .

 

             d.   Define .  The Lagrange fundamental polynomial  at x = 0, based on these points, is given by

             (A) 4.                      (B)  .              (C)  4h.                      (D) 6.

 

e.       The polynomial that fits the data

 

X                                                    x

0.1

0.3

0.5

0.7

0.9

f (x)

2.7

3.1

3.5

3.9

4.3

       

                   is given by                                                        

       

             (A) 2 + 2.5 x.          (B)  2.5 + 2 x.         (C) x + 2.6.                (D) 3.5 – 2 x.

f.        The integral  is evaluated by the N+1 point trapezoidal rule.  The roundoff error in each value of  is bounded by .  Then, the bound on the total roundoff error is given by 

            

             (A) .     (B)  .                  (C)  .       (D)  .

 

g.       What is the output of the following program?

# include “xyz.c”

                    main( )

                    {

                          printf(“%d”, a);

                     }                                                      

                  --------- File xyz.c --------

                                     int a;

                                     a =25;

             (A) Error.                (B)  10.                      (C)  25.         (D) infinite loop of printing.


h.       The least squares polynomial approximation of degree one to  on [0, 1] is

       

             (A)  .      (B) .        (C) .        (D) .

 

 

PART I :  Answer any THREE Questions. Each question carries 14 marks.

                

  Q.2     a.   Using the decomposition method for symmetric matrices, find the inverse of the matrix .                                                                                      (7)

       

             b.   The system of equations Ax = b, where A is as defined in Question 2(a), is given.  Components of the right hand vector b were measured with an error, whose magnitude is less than or equal to .  Derive the error bounds for the components of the solution vector x.  (You may use the inverse, , obtained in question 2(a)).                                                                                                                 (7)

 

  Q.3     a.   An iterative method for finding , N > 0 is written as .  Find the expression for the leading term of the error.  Hence, find the order of the method.          (7)

 

             b.   In every paper in a degree examination, the final award of marks (named Finalavg) for any subject has the weightage of 30% for assignment (named Asavg) and 70% for the final examination (named Exavg).  The roll numbers and the marks obtained by the students in the order of assignment and examination marks, in each subject (there are five subjects called paper 1 to paper 5) are stored (one line for roll number and one line per subject) in a file called “Submarks”.  The student passes the examination if the “Finalavg” in each paper is greater or equal to 50.  There are 1000 students (named Roll [1] to Roll [1000]).  Write a C program to evaluate the students, with the output stored in a file called “Result”.  This file should contain (a) Roll number, (b)  Total marks in each paper in a separate line, (c) passed or failed against each line.        (7)

                  

  Q.4     a.   The negative root of smallest magnitude of the equation  is to be obtained. (i) Find an interval of length 1, which contains the root. (ii)  Perform two iterations of the bisection method. (iii) Taking the end points of the last interval (obtained by the bisection method) as initial approximations, perform two iterations of the secant method. (iv)  Taking the mid point of the last interval (obtained by the bisection method) as the initial approximation, perform two iterations of the Newton-Raphson method.          (9)                                                                  

       

b.      Find the Choleski decomposition of matrix .                           (5)                        

       

  Q.5     a.   Solve the system of equations

                    

                   using Gauss-Seidel method, with the initial approximations taken as   .  Perform three iterations.                       (5)  

 

             b.   For the problem in Q.5 (a), write the Gauss-Seidal method in matrix form.  Hence, find the rate of convergence of the method.                 (9)

 

  Q.6     a.   The system of equations 

                  

                   has a solution near .  Obtain the Newton’s method for solving this system.  Iterate once using the given initial approximations.                                                          (8)

 

             b.   A simple root of the equation f (x) = 0 is to be determined by the bisection method.  Write a C program to find this root.  Input (i)  end points of the interval (a, b) in which the root lies, (ii)  maximum number of iterations n, (iii) error tolerance “eps”.  Output, (i) number of iterations taken, (ii)  root, (iii) f (root), (iv)  “Iterations are not sufficient”, if convergence is not attained.                                                (6) 

 

 

PART II : Answer any THREE Questions. Each question carries 14 marks.

  Q.7     a.   The following table of values represents a polynomial of degree   It is given that there is an error in one of the tabular values of f (x) near the end of the table.  Locate the error and correct this value.         (7)                                                                  

x

0

0.1

0.2

0.3

0.4

f(x)

2.00

2.11

2.28

2.39

2.56

 

             b.   A table of values,  with uniform mesh, is to be constructed for the function  on (1, 3).  If linear interpolation is to be used, find the maximum value of the step length that can be used so that .                                                           (7)

Q.8             A mathematical model of a process in an experiment is taken as.  A  data of N points , i = 1, 2, ……, N is given.  If the parameters a, b and c are to be determined by the method of least squares, find the normal equations.  Use these equations to find a, b, c for the data (keep 4 decimal accuracy).                                                                                                             

x

1

2

4

5

f(x)

1.1

1.5

1.56

1.57

                  

                  

 

                   Solve the resulting equations by Gauss elimination.  Find the least squares error.                  (4+10)

  Q.9     a.   Use the formula  to compute  from the given table of values with step lengths h = 0.4, 0.2 and 0.1.

            

x

0.2

0.3

0.4

0.6

1.0

f(x)

1.5048

2.0243

2.5768

3.8888

8.5

                   If the error is of the form , obtain the Richardson’s extrapolation estimates for the case when h is reduced by a factor 2 each time.  Apply these formulas to find a better estimate of .                                                            (8)

 

             b.   Determine the abscissas in the Gauss-Hermite integration formula  such that the formula is of as high order as possible.  It is given that .       (6)

Q.10           a.                                                        Evaluate the integral , using Simpson’s rule with step lengths    h = 0.25 and h = 0.125.  Find a better approximation to the value of the integral using Romberg integration.  Compare with the exact solution  (Keep 5 decimal accuracy).          (7)

             b.   The integral is to be evaluated by the Gauss-Legendre 2 point or the 3 point rules  or .  Write a C program to evaluate the integral when   User should choose the 2 point or 3 point formula (Use switch).  Define the weights W (k), abscissas x (k), f (x (k)) and I as double precision variables.                                                                (7)                                                             

 

Q.11           a.                                                        Consider the following Runge-Kutta method for the solution of the initial value problem .

                  

                  

                   Compute y (0.4) when  and h=0.2 (Keep 5 decimal places).                                                                   (6)

 

              b.  The initial value problem  is given.  Taylor series method of order 4 is to be used for computing y in the interval [a, b] with step length h.  Write a C program for finding the solutions.  Define double precision functions fD1, fD2, fD3, fD4 for finding .  Assume  that . Define the arguments x,y also as double precision variables.  Input a, b, h (in double precision) and compute the number of steps as .  Output y (x) at all step points.  (You may use arrays for x and y).  Assume that maximum value of M is 500.                                                           (8)