You are on page 1of 6

JRE SCHOOL OF Engineering

Class Test-2, October - 2015

Subject Computer Based Numerical and Subject Code NCS 303


Name Statistical Techniques

Solution
SECTION A

1. Attempt any five questions: (3 marks * 5 Questions = 15


Marks)

(i) Find the quadratic interpolating polynomial from the given data:
x: 0 1 2
f(x): 1 3 -1

Solution: Here x0 = 0, x1 = 1, x2 = 3,f(x0) = 2, f(x1) = 4, f(x2) = -5


Quadratic interpolating polynomial is given by:

Hence required polynomial is

2
Ans. -3x + 5x + 1
(ii) Using divided differences, find f(1) from the following data:
x: -4 -1 0
f(x:) 1245 33 5

Solution: Divided difference table

x f(x) 1st dd 2nd dd

-4 1245

-404

-1 33 94

-28

0 5
Using Newtons divided diiference formula

f(x) = f(x0) + (x- x0)[x0, x1] +(x x0)(x- x1)[x0, x1, x2] +..

we get f(1) = 1245 + (1+4)(-404) + (1+4)(1+1)(94) = 165.

Ans. f(1) = 165

(iii) Let f (x) = ln(1 + x), x0 = 1 and x1 = 1.1. Find the bounds on error
for linear
interpolation.
Solution:
The error bound in a
linear
interpolation is given by

Here, x0 = 1, x1 = 1.1 and f (x) = ln(1 + x). f(x) = -[1/(1+x)2]


Hence, error bound is

The maximum value of (x-1)(x-1.1) is .0025. Also max |-1/(1+x)2|is .


Hence error bound is (1/2)(0.0025)(1/4) = 0.0003125

Ans. 0.0003125.

(iv) Prove that

(v) Express 1 x2 + 2x4 as sum of Chebyshev polynomials.


Solution:
We know that 1 = T0(x), x2 = (1/2)[T0(x) + T2(x)] and x4 = (1/8)[ 3T0(x) + t T2(x)+ T4(x)]
Hence,
1 x2 + 2x4 = T0(x) - (1/2)[T0(x) + T2(x)] + 2 (1/8)[ 3T0(x) + t T2(x)+ T4(x)]
= (5/4) T0(x) +(1/2) T2(x) +(1/4) T4(x).
Ans. (5/4) T0(x) +(1/2) T2(x) +(1/4) T4(x).

(vi) Using the Gram-Schmidt or thogonalization process, compute the first two
orthogonal polynomials which are orthogonal on [0, 1] with respect to the weight
function W(x) = 1.
Solution: To find the orthogonal polynomials:

SECTION B

2. Attempt any one questions: (5 marks * 1 Question = 5


Marks)

(i) Find the piecewise linear interpolating polynomials from the data given below
x: 0 1 2 3

f(x) : 1 2 5 10

Hence, estimate the value of f(1.5).

Solution:
(i) In the interval [0,1], we have

(ii) In the interval [1,2], we have

(iii) In the interval [2,3], we have

Ans. Required piecewise linear polynomials are:

f(1.5) = 3 x 1.5 -1 = 3.5.

(ii) Economize the power series


to three significant digit accuracy.
Solution: Let the truncated series be

Converting the powers of x into Chebyshev polynomials, we get

SECTION C

3. Attempt any one question: (10 marks * 1 Question = 10


Marks)

(i) Obtain the cubic spline approximation from the following data:
x: 0 1 2
f(x): -1 3 29
with M0 = 0 = M2. Hence interpolate at x = 0.5, 1.5

Solution: We know that


(ii) Obtain the least squares straight line and quadratic polynomial fit
to the following data:
x: 1 2 3 4 5
f(x): 14 27 40 55 68

Solution: Let the required straight line be f(x) = c 0 + c1x and quadratic
polynomial be y = c0 + c1x +c2x2. Here n=5
The normal equations for a straight line are:

Normal equations for quadratic polynomials are:


Table
x f(x) xf(x) x2 f(x) x2 x3 x4

1 14 14 14 1 1 1

2 27 54 108 4 8 16

3 40 120 360 9 27 81

4 55 220 880 16 64 256

5 68 340 1700 25 125 625

x=15 f(x)=204 xf(x)=748 x 2f(x)=306 x 2 = 55 x 3 =225 x 4 =979


2

Substituting the values from table in normal equations for straight lines and quadratic polynomials ,
we get
204 = 5c0 + 15 c1
748 = 15c0 + 55 c1
Solving these, we get c0 = 0 and c1= 13.6
Hence, the required straight line is f(x) = 13.6 x
And 204 = 5c0 + 15 c1 +55 c2 .
748 = 15c0 + 55 c1 + 225 c2 .
3062 = 55c0 + 225 c1 + 979 c2 .

Solving these equations we get.

c0 = 1, c1 = 12.7428, c2 = 0.1428
Hence the required quadratic polynomial is 1 + 12.7428 x + 0.1428 x2.

************

You might also like