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

Time: 3 Hours                                    Flowchart: Alternate Process: December 2005                                                                 Max. Marks: 100

                                                 

 

NOTE: There are 9 Questions in all.

·      Question 1 is compulsory and carries 20 marks. Answer to Q. 1. must be written in the space provided for it in the answer book supplied and nowhere else.

·      Out of the remaining EIGHT Questions answer any FIVE Questions. Each question carries 16 marks.

·      Any required data not explicitly given, may be suitably assumed and stated.

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

a.       A second degree polynomial approximation to  using Taylor Series expansion is given by 

                   (A)  .                            (B)  .

(C)    .                           (D)  None of above.

b.      The order of Newton-Raphson method     for finding a multiple root of multiplicity 3 of the equation , is

(A)    1                                                  (B)  2

(C)  3                                                  (D)  4

            

             c.   The combination “\a” in C gives a                                      

(A)    vertical tab.                                  (B)  form feed.

(C)  system beep.                                (D)  carriage return.

 

             d.   For a two point Gauss-Hermite integration rule  ,  the values of   are given by

(A)    .   

(B)    .

(C)  .

(D)  .         

             e.   If x = 5, the output of the statement   sign = (x < 0) ? -1 : ((x == 0) ? 0 : 1);   would be                                                           

(A)     –1                                                (B)  0

(C)  1                                                  (D)  error

 

 

 

 

             f.    If a general iteration method    is of order p then

                   , by definition. The value of r is

(A)     p+1                                             (B)  p

(C)  p-1                                              (D)  None of above

             g.   The left shift operator “<<” has the effect of

(A)     multiplying the number by 2.        

(B)     dividing the number by 2.

(C)     adding 2 to the number.

(D)    subtracting 2 from the number.     

             h.   The solution for the system of equations

                                                                  

                    is given by

(A)    .            (B) .

(C) .                  (D) .

             i.    The format for unsigned integer in C printf statement is

                          

(A)   %i                                                (B) %I

(C) %u                                                (D) None of above

 

             j.    What should be the condition on  such that the method    where  ,  converges?

(A)  .                                         (B)  .

(C)  .                                         (D) None of above.

 

Answer any FIVE Questions out of EIGHT Questions.

Each question carries 16 marks.

  Q.2     a.   The system of equations                                                                                         

                  

                   is to be solved. Write the Newton’s iterative procedure and iterate two times starting with  and .                                            (8)

             b.   The equation  has a simple root in the interval . The function  is such that  and  for all values of  in this interval. Assuming that the Newton-Raphson method converges for all initial approximations in , find the number of iterations required to obtain the root correct to .                                                              (8)


Q.3   a.        Show that the matrix                                                                                        

                     

                   is positive definite and hence decompose it as  using Cholesky method.                (8)

             b.   Consider the linear system of equations                                                                  

                                     

                   Discuss the convergence of Gauss Jacobi and Gauss Seidel methods.                  (8)          

  Q.4     a.   Construct the divided difference table for the following data:

                  

                   Use Newton’s divided difference formula to find the Interpolating Polynomial and hence find the value of .                                                   (6)

             b.   When does a function need an include directive?                                                (5)

             c.   Write a programme using a function comb() to calculate C(n,k) to print Pascal’s Triangle down to row number 12. Each number in Pascal’s Triangle is one of the combinations . If we count the rows and the diagonal columns starting with 0, then the number C(n,k) is in row n and column k. Pascal’s Triangle looks like

                                                        (5)

  Q.5     a.   Starting with the set , generate a set of orthogonal polynomials on  with the weight function . Using these polynomials find a Least squares approximation of the form  for the function  on .                                                                                   (8)

             b.   For the method

                                                   

                   determine the optimal value of  using the criteria

(i)

                   (ii)  minimum                                                                                   (8)

 

  Q.6     a.   Find the error term of the method

                   as a power series in . Derive the corresponding Richardson’s extrapolation scheme. Using this method and the Richardson’s extrapolation, find the best value of  when  is given in tabular form as

                                                    (8)

             b.   Write a function that rotates a two-dimensional square array 900 “clock-wise”. Consider an array of integers. For example, an array 

                                                                       (8)

  Q.7     a.   Using the method of undetermined coefficients, find the nodes and weights of the quadrature formula                                                                  (8)   

             b.   Calculate  using Trapezoidal rule with number of points as 3, 5 and 9. Improve the results using Romberg Integration.                           (8)

  Q.8     a.   The following IVP is given

                   Use second order Taylor series method to get  with step length .                    (8)

             b.   Write a programme that plays the game of “rock, paper, scissors”. In this game, two players will simultaneously say either “rock” or “paper” or “scissors”. The winner is the one whose choice dominates the other. The rules are: paper dominates (wraps) rock, rock dominates (breaks) scissors and scissors dominates (cuts) paper. Use enumerated data type for the choices and the result. The result will be either a “tie” or “player 1 wins” or “player 2 wins”.                                                                         (8)

  Q.9     a.   Use the classical fourth order Runge-Kutta method to find the solution at  for

                   Assume the step length .                                                                        (10)

             b.   Construct a truth table for each of the following boolean expressions, showing its truth value (0 or 1) for all its combinations of truth values of its operands p, q and r.

i)                    !p  ||  q

ii)                   p && q  ||  !p && !q

iii)                 (p || q)  &&  !(p && q)

iv)                 !(p && q)

v)                  p  && (q && r)

vi)                 p  ||  (q  && r)                                                                                 (6)