0% found this document useful (0 votes)
6 views31 pages

NT MR.X

The document explains floating point representation, detailing its three components: sign bit, exponent, and mantissa, and how they work together to approximate numbers. It also covers methods for converting decimal numbers to binary, hexadecimal, and octal systems, as well as discussing the bisection method's linear convergence and providing examples of numerical integration techniques. Additionally, it highlights different types of errors in numerical techniques, including truncation and rounding errors, with relevant examples.

Uploaded by

tusharamohanty81
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views31 pages

NT MR.X

The document explains floating point representation, detailing its three components: sign bit, exponent, and mantissa, and how they work together to approximate numbers. It also covers methods for converting decimal numbers to binary, hexadecimal, and octal systems, as well as discussing the bisection method's linear convergence and providing examples of numerical integration techniques. Additionally, it highlights different types of errors in numerical techniques, including truncation and rounding errors, with relevant examples.

Uploaded by

tusharamohanty81
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

NUMERICAL TECHNIQUES

GROUP-D

4.Explain Floating point representation.

Ans: Floating point representation is a way to store numbers as an approximation, offering a


balance between range and precision for numerical techniques. It's similar to scientific notation.

A floating-point number is made of three parts:

1. Sign bit: This indicates whether the number is positive (0) or negative (1).

Example: 11000001110100000000000000000000 This is


negative number.

2. Exponent: This part represents the position of the decimal point. It's stored as a
biased exponent, meaning a constant value is added to the actual exponent during
storage.

There are 3 exponent bits in 8-bit representation and 8 exponent bits in 32-bit representation.

Thus

bias = 3 for 8 bit conversion (2 3-1 -1 = 4-1 = 3)


bias = 127 for 32 bit conversion. (2 8-1 -1 = 128-1 = 127)
Example: 01000001110100000000000000000000
10000011 = (131)10
131-127 = 4
Hence the exponent of 2 will be 4 i.e. 2 4 = 16.

3. Mantissa (Significand): This is the fractional part of the number, along with the
leading digit (which can be to the left or right of the decimal depending on the
exponent). It represents the significant digits of the number.

Example:
01000001110100000000000000000000

The fractional part of mantissa is given by:

1*(1/2) + 0*(1/4) + 1*(1/8) + 0*(1/16) +……… = 0.625

Thus the mantissa will be 1 + 0.625 = 1.625

The decimal number hence given as: Sign*Exponent*Mantissa = (-1)0*(16)*(1.625) = 26


Or

Discuss the method of conversion of decimal number into binary number, hexadecimal,
number, octal number.

Ans: Decimal to binary conversion is done through various methods. One of the methods to
convert decimal to binary is by dividing the given decimal number recursively by 2. Then, the
remainders are noted down till we get 0 as the final quotient.

Decimal into Hexadecimal:


The base of the hexadecimal system as 16. The 16 symbols used in this system are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
A, B, C, D, E, F.

Decimal into octal number:


In this method, the decimal number is divided by 8, each time a reminder is obtained from the
previous digit. The first remainder obtained is the least significant digit(LSD) and the last
remainder is the most significant digit(MSD).
5.Prove the bisection method is linearly convergent.

Ans: The bisection method is a root-finding method that repeatedly bisects an interval and then selects

a subinterval in which a root must lie for further processing. It is known to be linearly convergent.
A sequence ({x_k}) converges linearly to a number (L)
if there exists a constant (0 < C < 1) such that:
∣ 𝑥𝑘+1 − 𝐿 ∣
lim⁡ =𝐶
𝑘→∞ ∣ 𝑥𝑘 − 𝐿 ∣

where (L) is the actual root.

If (a) and (b) are the endpoints of the initial interval :


∣𝑏−𝑎 ∣
∣ 𝑥𝑘 − 𝐿 ∣≤
2𝑘
Given the error bound, the error at the (k+1)th iteration is:
∣𝑏−𝑎 ∣
∣ 𝑥𝑘+1 − 𝐿 ∣≤
2𝑘+1
Dividing the error at the (k+1)th iteration by the error at the (k)th iteration,
∣𝑏−𝑎 ∣
∣ 𝑥𝑘+1 − 𝐿 ∣ 𝑘+1 1
≤ 2 =
∣ 𝑥𝑘 − 𝐿 ∣ ∣𝑏−𝑎 ∣ 2
2𝑘
Taking the limit as (k) approaches infinity,
∣ 𝑥𝑘+1 − 𝐿 ∣ 1
lim⁡ =
𝑘→∞ ∣ 𝑥𝑘 − 𝐿 ∣ 2
Or

Find an approximate value of correct up to 6 decimal place using secant method.

Ans:

( x_0 ) and ( x_1 ) that are close to the true root.

( f(x_0) ) and ( f(x_1) ) these are the functional value


To find the next approximation ( x_2 ):
𝑥𝑛 − 𝑥𝑛−1
𝑥𝑛+1 = 𝑥𝑛 − 𝑓(𝑥𝑛 ) ⋅
𝑓(𝑥𝑛 ) − 𝑓(𝑥𝑛−1 )
( x_1 ) and ( x_2 ) as the new approximations.

The absolute difference between two successive approximations is less than ( 10^{-6} ).

6.Find log(1.25) by using Newton’s divided difference interpolation formula from the following
data.

X 1 1.5 2 2.5

Log(x) 0 0.17609 0.30103 0.39794

Ans:

Given data points:

• ( x_0 = 1, f(x_0) = \log(1) = 0 )


• ( x_1 = 1.5, f(x_1) = \log(1.5) = 0.17609 )
• ( x_2 = 2, f(x_2) = \log(2) = 0.30103 )
• ( x_3 = 2.5, f(x_3) = \log(2.5) = 0.39794 )

First divided difference f[x_0, x_1] =f(x_1) - f(x_0)/{x_1 - x_0}={0.17609 – 0/}{1.5 - 1}=0.35218

f[x_1, x_2] = f(x_2) - f(x_1)/{x_2 - x_1} = {0.30103 - 0.17609}/{2 - 1.5} = 0.24988

( f[x_2, x_3] = f(x_3) - f(x_2)/{x_3 - x_2} = {0.39794 - 0.30103}/{2.5 - 2} = 0.19382

The second divided differences:

f[x_0, x_1, x_2] = f[x_1, x_2] - f[x_0, x_1]/{x_2 - x_0} = {0.24988 - 0.35218}/{2 - 1} = -0.1023

f[x_1, x_2, x_3] = f[x_2, x_3] - f[x_1, x_2]/{x_3 - x_1} = {0.19382 - 0.24988}/{2.5 - 1.5} = -
0.05606

The third divided difference:

f[x_0, x_1, x_2, x_3] = f[x_1, x_2, x_3] - f[x_0, x_1, x_2]/{x_3 - x_0} = {-0.05606 - (-0.1023)}/{2.5
- 1} = 0.04624

Newton’s Divided Difference

P(x) = f(x0) + (x - x0) * f[x0, x1] + (x - x0)(x - x1) * f[x0, x1, x2] + ... + (x - x0)(x - x1) ... (x - xn-1) *
f[x0, x1, ..., xn]

Now Applying the value


log⁡(1.25) = 0 + (1.25 − 1) ⋅ 0.35218 + (1.25 − 1)(1.25 − 1.5) ⋅ (−0.1023)
+(1.25 − 1)(1.25 − 1.5)(1.25 − 2) ⋅ 0.04624
= 0.08809 + (−0.031575) ⋅ (−0.1023) + (0.031575)(−0.75) ⋅ 0.04624
= 0.08809 + 0.00323 + (−0.1089)
= 0.08242

Or

If f(x)=3x4-x3+x2+5 find f [1,2,3,7,8].

Ans: for each x value:

• f(1) = 3(1^4) - 1(1^3) + 1(1^2) + 5 = 8

• f(2) = 3(2^4) - 2(2^3) + 2(2^2) + 5 = 49

• f(3) = 3(3^4) - 3(3^3) + 3(3^2) + 5 = 230


• f(7) = 3(7^4) - 7(7^3) + 7(7^2) + 5 = 6914
• f(8) = 3(8^4) - 8(8^3) + 8(8^2) + 5 = 11845
𝟐
𝟏
7. Find the approximate value of an en2 by integrating ∫ 𝒙
𝒅𝒙⁡𝒖𝒔𝒊𝒏𝒈⁡𝒄𝒐𝒎𝒑𝒖𝒏𝒅⁡Trapezoidal
−𝟏
rule with six subinterval’s.

Ans:

Integration interval: [-1, 2]


Number of subintervals (n): 6
Subinterval width (Δx): (b - a) / n = (2 - (-1)) / 6 = ½
x_0 = -1

x_1 = -1/2

x_2 = 0

x_3 = 1/2

x_4 = 1

x_5 = 3/2

x_6 = 2

Evaluate the Function (f(x) = 1/x) at Each x_i:

f(x_0) = 1/(-1) = -1

f(x_1) = 1/(-1/2) = -2

f(x_2) = undefined
f(x_3) = 2

f(x_4) = 1

f(x_5) = 2/3

f(x_6) = ½
Δ𝑥
Apply the Composite Trapezoidal Rule: 𝑇6 = 2
[𝑓(𝑥0 ) + 2𝑓(𝑥1 ) + 2𝑓(𝑥2 ) + 2𝑓(𝑥3 ) + 2𝑓(𝑥4 ) +
2𝑓(𝑥5 ) + 𝑓(𝑥6 )]
Integral = (1/2) * [-1 - 2] + (1/2) * [2 + 1 + 2/3 + 1/2]

Ntegral=-1.5 + 3.1666 ≈ 1.6666

Or
𝟏.𝟑𝟎
Integrate ∫ √𝒙 dx numerically by compound Simpson’s 1/3rd rule using six interval.
𝟏

Ans:

Number of Subintervals (n): 6

Δx = (Upper Bound - Lower Bound) / n

Δx = (1.30 - 1) / 6 = 0.05

x_0 = 1 (lower bound)

x_1 = x_0 + Δx = 1.05

x_2 = x_1 + Δx = 1.10

x_3 = x_2 + Δx = 1.15

x_4 = x_3 + Δx = 1.20

x_5 = x_4 + Δx = 1.25

x_6 = 1.30 (upper bound)

Evaluate the Function (f(x) = √x) at Each x_i:

f(x_0) = √1 = 1

f(x_1) = √1.05 ≈ 1.0247

f(x_2) = √1.10 ≈ 1.0488

f(x_3) = √1.15 ≈ 1.0749

f(x_4) = √1.20 ≈ 1.0954


f(x_5) = √1.25 ≈ 1.1180

f(x_6) = √1.30 ≈ 1.1401

The formula for the composite Simpson's 1/3rd rule is:

Integral = (Δx/3) * [f(x_0) + 4 * f(x_1) + 2 * f(x_2) + 4 * f(x_3) + 2 * f(x_4) + 4 * f(x_5) +


f(x_6)]

Δx = 0.05

f(x_i)

Integral = (0.05 / 3) * [1 + (4 * 1.0247) + (2 * 1.0488) + (4 * 1.0749) + (2 * 1.0954) + (4 *


1.1180) + 1.1401]

Integral = 0.0167 * [1 + 4.0988 + 2.0976 + 4.2996 + 2.1908 + 4.4720 + 1.1401]

Integral = 0.0167 * 15.3089 ≈ 0.2548

Therefore, the approximate value of the integral using the composite Simpson's 1/3rd rule with
six intervals is 0.2548.

8.Explain different types of errors with example .

Ans: In numerical techniques, we trade off exact solutions for efficient approximations. This
introduces various types of errors that can affect the accuracy of our results.

1. Truncation Error:

• Description: This error arises from simplifying a mathematical problem to make it solvable
by a computer. It occurs when we neglect an infinite series, terminate an iterative process
early, or use an approximation function instead of the exact one.
• Example: Consider calculating the infinite geometric series 1 + 1/2 + 1/4 + ... . In reality, we
can only sum a finite number of terms. The difference between the sum of a finite number
of terms and the infinite series itself is the truncation error.

2. Rounding Error:

• Description: This error originates from the limited precision of computer arithmetic.
Numbers are stored in binary format with a fixed number of bits. When a number cannot be
represented exactly with this limited precision, it gets rounded to the nearest representable
value. Rounding errors accumulate during calculations involving many operations.
• Example: Imagine calculating the sum of 0.1 and 0.2 on a computer with limited precision.
Due to rounding, the individual numbers might be stored as slightly different binary values.
The sum of these rounded values might not be exactly equal to 0.3, introducing a rounding
error.

3. Propagation of Errors:

• Description: This error refers to how errors from one calculation can grow and affect
subsequent calculations. When multiple calculations are chained together, rounding errors
from each step can accumulate and magnify the final result's inaccuracy.
• Example: Imagine calculating the derivative of a function using a numerical method. The
numerical method itself might introduce a slight error in the derivative calculation. If we
then use this approximate derivative in another calculation, the initial error can be
amplified, leading to a larger error in the final result.

4. Inherent Errors:

• Description: These errors stem from inaccuracies present in the data itself. This could be
due to measurement errors, data collection limitations, or noise in the data.
• Example: If you're measuring the temperature with a thermometer that has a limited
resolution, the recorded temperature might not be the exact value. This inherent error in the
data will affect any calculations or analyses performed on it.

Or

Find the root of the equation correct to three decimal place by using simple Iteration method.

Ans: The Simple Iteration Method

x = g(x), where g(x) is a function involving x.

Apply the iteration formula:

x_(n+1) = g(x_n)

Let's find the root of the equation: x^3 - 7x - 6 = 0

Let's start with x₀ = 2

Iteration 1: x₁ = g(x₀) = (7 * 2 + 6)^(1/3) ≈ 2.454

Iteration 2: x₂ = g(x₁) = (7 * 2.454 + 6)^(1/3) ≈ 2.378

Iteration 3: x₃ = g(x₂) = (7 * 2.378 + 6)^(1/3) ≈ 2.374

Iteration 4: x₄ = g(x₃) = (7 * 2.374 + 6)^(1/3) ≈ 2.374


|x₃ - x₂| ≈ 0.004

|x₄ - x₃| ≈ 0.000

Simple iteration value x ≈ 2.374

9.Solve to find the real root of using Newton -Raphson method.

Ans: Assume we’re looking for the root (or x-intercept) of f(x).

Newton’s method is to draw a tangent line to the graph y = f(x) at


the point (b, f(b)).

y = f(x) at the point (x1, y1) crosses the x-axis.

The point gradient form of equation of a line with slope m and passing
through the point (x0, y0) is given as:
y – y0 = m(x – x0).
The line has a slope of f'(xn). The x- intercept occurs where y = 0.
Thus, by setting y = 0,
X1=x0-f(x0)/f^’(x0).
Or

Find a real root of the equation by using Secant method.

Ans: Let’s pretend we have two root estimations of root α, say, x0 and x1. Then,
we have a linear function

q(x) = a0 + a1x

using q(x0) = f (x0), q(x1) = f (x1).


q(x)=(x1-x)f(x0)+(x-x0)f(x1)/x1-x0

x2=x1-f(x1).x1-x0/f(x1)_f(x0)

10.use langrage’s formula of interpolation to fit a polynomial to the decimal.

Ans
Let f(x)𝑓(𝑥) be an arbitrary real function. The nth degree polynomial passing
through n+1𝑛+1 points.

where Lj(x)𝐿𝑗(𝑥) is the nth degree polynomial defined as


Or

Explain the correct concept of newton form Finite difference operators.

Ans: • Finite difference operators are mathematical symbols that represent these differences.
Common examples include:

• Forward difference: D⁺f(x) = f(x + h) - f(x) (h is the spacing between grid points)
• Backward difference: D⁻f(x) = f(x) - f(x - h)
• Central difference: δf(x) = f(x + h/2) - f(x - h/2)

These operators can be combined to create higher-order derivatives or more accurate


approximations.

Newton’s Forward Difference Formula: This formula is used when the data points are equally spaced
𝑝(𝑝−1) 2 𝑝(𝑝−1)…(𝑝−𝑛+1) 𝑛
and is given by:⁡𝑃(𝑥) = 𝑓(𝑥0 ) + 𝑝Δ𝑓(𝑥0 ) + Δ 𝑓(𝑥0 ) + ⋯ + Δ 𝑓(𝑥0 )
2! 𝑛!

Newton’s Backward Difference Formula: Similar to the forward difference formula, the backward
difference formula is used for equally spaced data points but is applied in a backward manner:
𝑝(𝑝 + 1) 2 𝑝(𝑝 + 1) … (𝑝 + 𝑛 − 1) 𝑛
𝑃(𝑥) = 𝑓(𝑥𝑛 ) + 𝑝∇𝑓(𝑥𝑛 ) + ∇ 𝑓(𝑥𝑛 ) + ⋯ + ∇ 𝑓(𝑥𝑛 )
2! 𝑛!

11.Find the value of y(0.1) and y(0.2) by using Euler method.

Ans: To find the values of ( y(0.1) ) and ( y(0.2) ) using the Euler method,

Typically in the form ( y’ = f(x, y) ), with ( y(x_0) = y_0 ).

Differential equation: dy/dx = x^2 + y

Initial condition: y(0) = 1

Iteration at x = 0.1 (i = 0):


y_0 = 1

f(x_0, y_0) = 0^2 + 1 = 1 (f(x, y)

y_1 = y_0 + h * f(x_0, y_0) = 1 + 0.1 * 1 = 1.1

Iteration at x = 0.2 (i = 1):

y_1 = 1.1

f(x_1, y_1) = (0.1)^2 + 1.1 = 1.12

_2 = y_1 + h * f(x_1, y_1) = 1.1 + 0.1 * 1.12 = 1.212

• y(0.1) ≈ 1.1

• y(0.2) ≈ 1.212

Or

Explain the concept of Newton’s form Finite difference operators.

Ans:

Ans: • Finite difference operators are mathematical symbols that represent these differences.
Common examples include:

• Forward difference: D⁺f(x) = f(x + h) - f(x) (h is the spacing between grid points)
• Backward difference: D⁻f(x) = f(x) - f(x - h)
• Central difference: δf(x) = f(x + h/2) - f(x - h/2)

These operators can be combined to create higher-order derivatives or more accurate


approximations.

Newton’s Forward Difference Formula: This formula is used when the data points are equally spaced
𝑝(𝑝−1) 𝑝(𝑝−1)…(𝑝−𝑛+1) 𝑛
and is given by:⁡𝑃(𝑥) = 𝑓(𝑥0 ) + 𝑝Δ𝑓(𝑥0 ) + 2! Δ2 𝑓(𝑥0 ) + ⋯ + 𝑛!
Δ 𝑓(𝑥0 )

Newton’s Backward Difference Formula: Similar to the forward difference formula, the backward
difference formula is used for equally spaced data points but is applied in a backward manner:
𝑝(𝑝 + 1) 2 𝑝(𝑝 + 1) … (𝑝 + 𝑛 − 1) 𝑛
𝑃(𝑥) = 𝑓(𝑥𝑛 ) + 𝑝∇𝑓(𝑥𝑛 ) + ∇ 𝑓(𝑥𝑛 ) + ⋯ + ∇ 𝑓(𝑥𝑛 )
2! 𝑛!
12.Find the value of y(0.2) by using Euler method.

Ans: • Differential equation: dy/dx = x^2 + y

• Initial condition: y(0) = 1


Let's choose a step size (h) of 0.1. We want to find y at x = 0.2

• Iteration at x = 0.1 (i = 0):

• y_0 = 1
• f(x_0, y_0) = 0^2 + 1 = 1 (f(x, y)
• y_1 = y_0 + h * f(x_0, y_0) = 1 + 0.1 * 1 = 1.1

• Iteration at x = 0.2 (i = 1):

• y_1 = 1.1
• f(x_1, y_1) = (0.1)^2 + 1.1 = 1.12
• y_2 = y_1 + h * f(x_1, y_1) = 1.1 + 0.1 * 1.12 = 1.212

Or
𝟏
Evaluate ∫𝟎 ⬚ 𝒆𝒙 𝒅𝒙⁡, 𝒃𝒚⁡𝑺𝒊𝒎𝒑𝒔𝒐𝒏𝒔 1/3 rule.

Ans: Let us divide the range [0, 1] into six equal parts by taking h = 1/6.

If x0 = 0 then y0 = e0 = 1.

If x1 = x0 + h = ⅙, then y1 = e1/6 = 1.1813

If x2 = x0 + 2h = 2/6 = 1/3 then, y2 = e1/3 = 1.3956

If x3 = x0 + 3h = 3/6 = ½ then y3 = e1/2= 1.6487

If x4 = x0 + 4h = 4/6 ⅔ then y4 = e2/3 = 1.9477

If x5 = x0 + 5h = ⅚ then y5 = e5/6 = 2.3009

If x6 = x0 + 6h = 6/6 = 1 then y6 = e1 = 2.7182

We know by Simpson’s ⅓ rule;


∫ab f(x) dx = h/3 [(y0 + yn) + 4(y1 + y3 + y5 + …. + yn-1) + 2(y2 + y4 + y6 + ….. + yn-2)]

Therefore,

∫01exdx = (1/18) [(1 + 2.7182) + 4(1.1813 + 1.6487 + 2.3009) + 2(1.39561 + 1.9477)]

= (1/18)[3.7182 + 20.5236 + 6.68662]

= 1.7182 (approx.)

GROUP-C

1. a)Find a bound for the number of iterations necessary in the bisection method
to obtain an approximations to 𝟏𝟎−𝟓 to the solution of 𝒙𝟑 + 𝟒𝒙𝟐 − 𝟏𝟎 = 𝟎 lies in
the (1,2).

Ans: the bisection method to obtain an approximation to (10^{-5}) for the solution of (x^3 + 4x^2 - 10
= 0) in the interval ((1,2)), we can use the following formula:
log⁡(𝑏−𝑎)−log⁡(𝜖)
𝑛≥
log⁡(2)

Where:

• ( n ) is the number of iterations.


• ( b - a ) is the initial interval length.

log⁡(1) − log⁡(10−5 )
𝑛≥
log⁡(2)
0 − (−5log⁡(10))
𝑛≥
log⁡(2)
5log⁡(10)
𝑛≥
log⁡(2)

Now, calculate the value of ( n ):


5⋅2.30259
𝑛≥ ⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡
0.693147
⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡ 𝑛 ≥ 16.6096
Therefore, at least 17 iterations are necessary to achieve an approximation within (10^{-5}) of the
actual root using the bisection method for the given function and interval.

b) Find an analytical expression for 𝜟𝒏 (𝟐𝒙 ).

Ans: The forward difference operator (Δ) is defined as:

Δf(x) = f(x + h) - f(x)

The nth difference of 2^x iteratively using the forward difference operator. Here's the process for n =
1 and n = 2

Δ^1(2^x): The derivative of 2^x is ln(2) * 2^x.

Δ^2(2^x): Δ(ln(2) * 2^x) = [ln(2) * 2^(x+h)] - [ln(2) * 2^x]= ln(2) * 2^x (2^h - 1)

Let's choose x = 1 and h = 0.1 (step size).

Δ^1(2^1) = ln(2) * 2^1 ≈ 0.693 * 2 ≈ 1.386

Δ^2(2^1) = ln(2) * 2^1 (2^0.1 - 1) ≈ 0.693 * 2 * (1.105 - 1) ≈ 0.14

c)Find the polynomial by using langrage’s interpolation formula from the


following data f(0)=1, f(1)=3, f(3)=55.

Ans: The Lagrange polynomial of degree n for n + 1 data points (x_i, y_i) is:

P(x) = ∑(i=0 to n) [ yi * product((x - x_j) / (x_i - x_j)) for j=0 to n, j != i ]

where:

• P(x) is the interpolating polynomial


• yi is the function value at the i-th data point (f(x_i))
• x_i and x_j are the x-coordinates of the data points

Applying the formula:

In this case, we have n = 2

• x0 = 0, y0 = f(0) = 1
• x1 = 1, y1 = f(1) = 3
• x2 = 3, y2 = f(3) = 55
P(x) = (1 * [(x - 1) * (x - 3)] / [(0 - 1) * (0 - 3)]) + (3 * [(x - 0) * (x - 3)] / [(1 - 0) * (1 - 3)]) + (55 * [(x - 0) * (x -
1)] / [(3 - 0) * (3 - 1)])

P(x) = (x^2 - 4x + 3) / 6 + (3x^2 - 3x) / -2 + (55x^2 - 55x) / 6

P(x) = (x^2 - 4x + 3 - 9x^2 + 9x + 45x^2 - 45x) / 6

P(x) = 41x^2 - 32x + 3

Therefore, the polynomial that interpolates the data points using Lagrange's formula is P(x) = 41x^2
- 32x + 3.

d)Use Newtons divided difference formula interpolation formula to calculate f(3) from the
followings data.

X 0 1 2 4

F(x) 1 14 15 5

Ans The interpolated value of f(x) using Newton's divided difference formula is:

f(x) = f(x_0) + (x - x_0) * f[x_0, x_1] + (x - x_0)(x - x_1) * f[x_0, x_1, x_2] + ... + (x - x_0)(x -
x_1)...(x - x_(n-1)) * f[x_0, x_1, ..., x_n]

able

( X ) ( F(x) ) 1st Divided Difference 2nd Divided Difference 3rd Divided Difference

0 1

1 14 {14-1}/{1-0} = 13

2 15 {15-14}/{2-1} = 1 {1-13}/{2-0} = -6

4 5 {5-15}/{4-2} = -5 {-5-1}/{4-1} = -2 {-2-(-6)}/{4-0} = 1

Now, using the divided differences, we can write the interpolation polynomial as:

f(x)=f[x0]+(x−x0)f[x0,x1]+(x−x0)(x−x1)f[x0,x1,x2]+(x−x0)(x−x1)(x−x2)f[x0,x1,x2,x3]

𝑓(𝑥) = 1 + (𝑥 − 0) ⋅ 13 + (𝑥 − 0)(𝑥 − 1) ⋅ (−6) + (𝑥 − 0)(𝑥 − 1)(𝑥 − 2) ⋅ 1


Finally, to find ( f(3) ), we substitute ( x = 3 ) into the polynomial:

𝑓(3) = 1 + (3 − 0) ⋅ 13 + (3 − 0)(3 − 1) ⋅ (−6) + (3 − 0)(3 − 1)(3 − 2) ⋅ 1

f(3) = 1 + (3 - 0) * 13 + (3 - 0)(3 - 1) * (-4)

f(3) = 1 + 39 - 8

f(3) = 32.

Therefore, the interpolated value of f(3) using Newton's divided difference formula is 32.

𝟏
e)Integrate ∫𝟎 𝒆⁡^ − 𝒙^𝟐 dx numerically by Trapezoidal rule.

Ans: Integration interval: [a, b] = [0, 1]

Let's use n = 4.

h = (b - a) / n = (1 - 0) / 4 = 0.25

x_0 = 0, f(x_0) = e^(0^2) = 1

x_1 = x_0 + h = 0.25, f(x_1) = e^(-0.25^2) ≈ 0.9259

x_2 = x_1 + h = 0.5, f(x_2) = e^(-0.5^2) ≈ 0.6065

x_3 = x_2 + h = 0.75, f(x_3) = e^(-0.75^2) ≈ 0.3679

x_4 = x_3 + h = 1, f(x_4) = e^(-1^2) ≈ 0.3679

Integral ≈ (h/2) * (f(x_0) + 2f(x_1) + 2f(x_2) + 2*f(x_3) + f(x_4))

Integral ≈ (0.25 / 2) * (1 + 20.9259 + 20.6065 + 2*0.3679 + 0.3679) ≈ 0.7854

Therefore, the numerical approximation of the integral ∫_0^1 e^(-x^2) dx using the Trapezoidal rule
with 4 subintervals is approximately 0.7854.

f)Solve dy/dx=x+y , y(0)=1 by Picards method up to 2nd approximation.

Ans: Given:

dy/dx = x + y

y(0) = 1

Initial guess:
y_0(x) = 1

Iteration 1 (First approximation):

f(x, y) = x + y y_1(x) = y_0(x) + ∫_0^x (t + y_0(t)) dt

y_0(t) = 1:

y_1(x) = 1 + ∫_0^x (t + 1) dt = 1 + (tx/2 + x) = x^2/2 + x + 1

Iteration 2 (Second approximation):

y_2(x) = y_1(x) + ∫_0^x (t + y_1(t)) dt

Substitute y_1(t) = t^2/2 + t + 1 into the integral:

y_2(x) = (x^2/2 + x + 1) + ∫_0^x (t + t^2/2 + t + 1) dt

Evaluate the integral:

y_2(x) = x^2/2 + x + 1 + (t^2/2 + tx + t^2/4 + t) |_0^x

y_2(x) = x^2/2 + x + 1 + x^3/2 + x^2 + x^3/4 + x - (0 + 0 + 0 + 0)

y_2(x) = x^3 + 3x^2 + 5x/4 + 1

• y_1(x) = x^2/2 + x + 1

• y_2(x) = x^3 + 3x^2 + 5x/4 + 1

g)What do you mean by forward difference operator and Backward difference


operator.

Ans: Forward Difference Operator (Δ):

• The forward difference operator, denoted by Δ, represents the difference between


the function's value at a point and its value at a point slightly ahead (shifted forward)
by a fixed step size (h).
• Mathematically, Δf(x) = f(x + h) - f(x).
• It approximates the derivative of the function (f'(x)) at the point x.

Backward Difference Operator (∇):


• The backward difference operator, denoted by ∇, is similar to the forward
difference, but it uses the function's value at a point slightly behind (shifted
backward) by a fixed step size (h).
• Mathematically, ∇f(x) = f(x) - f(x - h).
• It also approximates the derivative of the function (f'(x)) at the point x, but from the
"backward" direction.

h)What is the formula of Euler’s method and Modified Euler’s method.

Ans:

Euler's Method:

Euler's method is the simplest explicit method for numerical integration of ODEs. It uses the
current slope of the solution curve to estimate the solution at the next point.

Formula:

y_(i+1) = y_i + h * f(x_i, y_i)

Modified Euler's Method (Improved Euler Method):

Modified Euler's method aims to improve the accuracy of Euler's method by using an
average slope for the estimation.

Formula:

y_(i+1) = y_i + h * f(x_i + h/2, y_i + h/2 * f(x_i, y_i))

𝟏
i)find ∫𝟎 𝟏/𝟏 + 𝒙 dx using Simpsons 3rd Rule .

Ans: ∫_a^b f(x) dx ≈ (3b - 3a) / 8 * [ f(a) + 3 * f((a + b) / 2) + 2 * f(b) ]

Integration interval: [a, b] = [0, 1]


We'll use n = 2
h = (b - a) / n = (1 - 0) / 2 = 0.5

Identify the function values at each subinterval endpoint:

x_0 = a = 0, f(x_0) = 1 / (1 + 0) = 1

x_1 = (a + b) / 2 = 0.5, f(x_1) = 1 / (1 + 0.5) = 2/3

x_2 = b = 1, f(x_2) = 1 / (1 + 1) = ½
Apply the Simpson's 3/8 Rule formula:

∫_0^1 1/(1 + x) dx ≈ (3 * 1 - 3 * 0) / 8 * [1 + 3 * (2/3) + 2 * (1/2)]

≈ (3/8) * (1 + 2 + 1)

≈ (3/8) * 4

≈ 3/2 Therefore, the approximate


value of the integral ∫_0^1 1/(1 + x) dx using Simpson's 3/8 Rule with two subintervals is 3/2.

j)State Newton Cote’s Method.

Ans: Newton-Cotes Methods:

Newton-Cotes methods are a family of numerical integration techniques used to


approximate definite integrals. They rely on evaluating the integrand (function to be
integrated) at equally spaced points within the integration interval and then using a
weighted sum of those function values to estimate the integral.

Trapezoidal Rule, Simpson's Rule, Gaussian Quadrature:

k)Difference b/w Scant and Newton Raphson Method.

Ans: Secant Method: Uses the most recent two function evaluations (f(x_i) and f(x_(i-1)))
to create a secant line that intersects the x-axis. The x-coordinate of this intersection point
becomes the next estimate (x_(i+1)) for the root.
Newton-Raphson Method: Employs the derivative of the function (f'(x)) to improve the
root estimate in each iteration. It calculates the slope of the tangent line at the current
estimate (x_i) and uses it to find the point on the tangent line that intersects the x-axis. This
point's x-coordinate becomes the next estimate (x_(i+1)).

l)What do you mean by mid point rule.

Ans: The midpoint rule is another numerical integration technique. It approximates the
definite integral of a function f(x) from a to b by:

• Dividing the integration interval [a, b] into n subintervals of equal width.


• Evaluating the function f(x) at the midpoint (x_i = (a + b) / 2) of each subinterval.
• Multiplying each function value by the subinterval width (h) and summing these
products.

Formula:

∫_a^b f(x) dx ≈ h * Σ(f(x_i)) from i = 1 to n

m)Write the steps of bijection method.

Ans: The bisection method is a root-finding algorithm that repeatedly bisects the interval
containing the root. Here are the steps:

1. Define the initial interval: Choose an interval [a, b] where you believe the root lies
(f(a) * f(b) < 0 ensures opposite signs at endpoints).
2. Calculate the midpoint: Compute the midpoint (x_m) of the interval: x_m = (a + b) /
2.
3. Evaluate the function at the midpoint: Calculate f(x_m).
4. Check for the root: If f(x_m) is close enough to zero (within a predefined tolerance),
then x_m is considered the root. Stop iterating.
5. Update the interval: Otherwise, determine on which half of the interval the root
must lie based on the signs of f(a) and f(x_m). If f(a) and f(x_m) have the same sign,
the root lies in the interval (b, x_m). Update the interval by setting a = x_m. If they
have opposite signs, the root lies in the interval (a, x_m). Update the interval by
setting b = x_m.
6. Repeat: Go back to step 2 and continue iterating until the root is found within the
desired tolerance or a maximum number of iterations is reached.

n)Write the steps of Regula -Falsi method.

Ans: The Regula Falsi method, also known as the false position method, is an iterative
root-finding technique used to solve equations f(x) = 0. Here are the steps involved:

1. Choose an initial interval lies.


2. Calculate the false position: Find the x-coordinate of the point where the line
connecting the function values at a and b intersects the x-axis. This point, denoted
as c, can be calculated using:

c = (a * f(b) - b * f(a)) / (f(b) - f(a))

3. Evaluate the function at the false position: Calculate f(c).


4. Check for the root: If f(c) is close enough to zero (within a predefined tolerance),
then c is considered the root. Stop iterating.
5. Update the interval
6. Repeat: Go back to step 2 and continue iterating until the root is found within the
desired tolerance or a maximum number of iterations is reached.

o)Name any two method s for solving nonlinear Systems.

Ans: Newton-Raphson Method: This iterative technique involves calculating a Jacobian


matrix containing partial derivatives of the functions and using it to improve the initial
guess for the solution vector (x, y, z) in each iteration. It generally converges faster than
other methods but may diverge if the initial guess is far from the solution or the system is
poorly behaved.

Gauss-Seidel Method: This iterative approach repeatedly updates the solution for each
variable in the system based on the most recent estimates for other variables.

p)What do mean by error bound.

Ans:An error bound, in the context of numerical methods, is an estimate of the maximum possible
difference between the exact solution and the approximate solution obtained by the method. It
provides an indication of the method's accuracy for a given problem and step size (for integration
methods) or number of iterations (for root-finding methods).

q)State the error bound for trapezoidal rule.

Ans: The error bound for the Trapezoidal rule for numerical integration is:

|Error| <= (b - a)^3 * |f''(ξ)| / (12 * n^2)

where:

• b - a is the width of the integration interval.


• n is the number of subintervals.
• ξ is a point within the integration interval (it can be anywhere between a and b).
• f''(ξ) is the second derivative of the function f(x) evaluated at ξ.

r)What do you mean by accuracy in floating point representation.

Ans: Floating-point representation is a standard way to store real numbers using a sign bit,
exponent, and mantissa. However, it has limitations due to finite precision.

Factors affecting accuracy include:


• Number of bits: More bits in the mantissa allow for a wider range of values and
higher precision.
• Rounding errors: Operations like addition, subtraction, multiplication, and division
can introduce rounding errors due to limited precision.
• Cancellation: Subtracting two nearly equal numbers can lead to a significant loss
of precision in the result.

s)What are the advantage of LANGRAGE interpolation over newton form.

Ans: Advantages of Lagrange Interpolation:

1. Works for Unequally Spaced Points: Lagrange interpolation can be applied to data
points that are not necessarily spaced at equal intervals
2. Potentially More Stable (for Large Numbers of Points): In some cases, with a
large number of data points, Lagrange interpolation can be numerically more stable
than Newton's form.

GROUP-B

1.

a)Write the two advantages of Newton -Rapson method.

Ans: Fast Convergence (Quadratic): When the method converges, it often does so
quadratically.

Simple to Implement: The formula for the Newton-Raphson method is relatively


straightforward and requires only basic mathematical operations and the function and its
derivative.

b)if 24.5 is approximated as 24, then find its absolute error and relative error..

Ans: Absolute Error:

The absolute error is the difference between the approximate value and the true value,
regardless of sign.

Absolute Error = |True Value - Approximate Value|

Absolute Error = |24.5 - 24| = 0.5

Relative Error:
The relative error expresses the absolute error as a proportion of the true value, often
expressed as a percentage.

Relative Error = |Absolute Error| / |True Value|

Relative Error = |0.5| / |24.5| ≈ 0.0204

c)Find the 3rd approximates value of equation 𝒙𝟒 − 𝟓𝒙 + 𝟏 = 𝟎 lying b/w 0and 1


using Bisection method.

Ans:Given f(x) = 2x^10 - 3 and the interval [a, b] = [0, 1].

Iteration 1:

• Midpoint: x_m = (a + b) / 2 = (0 + 1) / 2 = 0.5


• Evaluate f(x_m): f(0.5) = 2 * 0.5^10 - 3 ≈ -2.996

Since f(0.5) is negative, the root lies in the interval (0.5, 1). Update the interval: a = x_m = 0.5, b = 1.

Iteration 2:

• Midpoint: x_m = (a + b) / 2 = (0.5 + 1) / 2 = 0.75


• Evaluate f(x_m): f(0.75) = 2 * 0.75^10 - 3 ≈ -1.211

Again, f(0.75) is negative, so the root lies in (0.75, 1). Update the interval: a = x_m = 0.75, b = 1.

Iteration 3:

• Midpoint: x_m = (a + b) / 2 = (0.75 + 1) / 2 = 0.875


• Evaluate f(x_m): f(0.875) = 2 * 0.875^10 - 3 ≈ -0.274

The third approximation of the root is x_m ≈ 0.875.

d)Find 𝜟𝟏𝟎 f(x) if f(x)=2x^10-3.

Ans: Δf(x) = f(x + h) - f(x) forward difference

f(x) is -3

Δ(-3) = -3 (x + h) - (-3) = 0
Δ(x^n) = n * h^(n-1) * x^(n-1)

Applying to f(x):

For f(x) = 2x^10 - 3

Δ(2x^10) = 10 * h^9 * 2x^9

the tenth forward difference of the x^10 term:

Δ^10 f(x) = Δ^10 (2x^10) = 10 * h^9 * 2x^9

e)Convert the decimal number (35631)10 to hexadecimal number.

• Ans: ( 35631 \div 16 = 2226 )remainder of 15


• ( 2226 \div 16 = 139 ) remainder of 2.
• ( 139 \div 16 = 8 ) reminder 11
• ( 8 \div 16 = 0 ) remainder of 8.

So, ( (35631){10} ) in hexadecimal is {8B2F}{16}.


f)Convert the binary number to (111001)2 to decimal number.

Ans: ( 1 \times 2^5 + 1 \times 2^4 + 1 \times 2^3 + 0 \times 2^2 + 0 \times 2^1 + 1 \times
2^0 )

( 32 + 16 + 8 + 0 + 0 + 1 ) =( 57 )

g)if dy/dx= x+y , y(0)=1. Find y(0.2) with h=0.1 by Eular’s method.

Ans: Differential Equation: dy/dx = x + y

Initial Condition: y(0) = 1

Step Size: h = 0.1

Euler's Method Formula:

y_(i+1) = y_i + h * f(x_i, y_i)

x_0 = 0
y_0 = 1

f(x_0, y_0) = 0 + 1 = 1

• y_1 = y_0 + h * f(x_0, y_0) = 1 + 0.1 * 1 = 1.1

(x = 0.1):
• f(x_0, y_0) = 0 + 1 = 1
• y_1 = y_0 + h * f(x_0, y_0) = 1 + 0.1 * 1 = 1.1

(x = 0.2):

• f(x_1, y_1) = 0.1 + 1.1 = 1.2


• y_2 = y_1 + h * f(x_1, y_1) = 1.1 + 0.1 * 1.2 = 1.22

h)Write two methods of finding roots of an equation.

Ans: Two methods of finding roots of an equation are:

1. Graphical Method: This involves plotting the function on a graph and identifying where it
intersects the x-axis. The x-coordinates of these intersection points are the roots of the
equation.
2. Numerical Method: Methods like the bisection method, Newton-Raphson method, and
secant method are used to find roots iteratively.

i)Stated intermediate value Theorum.

Ans: The Intermediate Value Theorem states that if a function ( f ) is continuous on a closed
interval ([a, b]), and ( N ) is any number between ( f(a) ) and ( f(b) ), then there is at least one number
( c ) in the interval ([a, b]) such that ( f© = N )45. It’s often used to show that a function has a root
within an interval.
j)What is the application of interpolation.

Ans: application of interpolation includes:

• Estimating unknown values within the range of a discrete set of known data points.
• Constructing new data points in the field of engineering, science, and computer graphics.

k)Difference b/w Local and Global truncation errorand .

Ans: The difference between Local and Global Truncation Error:

• Local Truncation Error (LTE) is the error made during a single step of a numerical method,
assuming perfect knowledge of the solution at the previous step.
• Global Truncation Error (GTE) is the cumulative error over all steps of the numerical method,
assuming perfect knowledge of the solution only at the initial step

l)What is the advantage of Bijection method.

Ans: Advantages of Bisection Method: The Bisection method offers several advantages for
finding the roots of equations:

1. Guaranteed Convergence
2. Simple to Implement
3. No Need for Derivatives
m)What do you mean by Trapezoid Rule.

Ans: The Trapezoidal rule is a numerical integration technique used to approximate the
definite integral of a function f(x) over a closed interval [a, b]. It works by:

1. Dividing the interval [a, b] into n subintervals of equal width (h).


2. Evaluating the function f(x) at the endpoints (a and b) and midpoint (x_i) of each
subinterval.
3. Forming a trapezoid under the curve defined by the function values at the endpoints
and midpoint of each subinterval.
4. Summing the areas of all these trapezoids to estimate the definite integral.

n)State the fundamental theorem of Gaussian Quadrature.

Ans: The Fundamental Theorem of Gaussian Quadrature states that for a definite integral
∫_a^b f(x) dx, there exists a set of n non-equally spaced points (xi) within the interval [a, b]
and corresponding weights (wi) such that the following holds:

∫_a^b f(x) dx ≈ ∑(wi * f(xi))

o)What do you mean by Forward Interpolation.

Ans: Forward interpolation is a technique used to approximate the value of a function f(x) at a point
x = x_k based on its known values at a set of n data points (x_0, f(x_0)), (x_1, f(x_1)), ..., (x_(n-1),
f(x_(n-1))). These data points are assumed to be ordered in increasing order of x-values (x_0 < x_1 <
... < x_(n-1)).

p)Which method is used by the final corrector of 4th order Runge -


Kuttatechniques.

Ans: The 4th order Runge-Kutta method (RK4) is a single-step method for solving ordinary
differential equations (ODEs) numerically. It consists of four stages that calculate function values
at specific points within each step size (h) to estimate the derivative and update the solution.

q)State the Euler’s method.

Ans: Euler's method, also called the forward Euler method, is a fundamental numerical technique
for solving ordinary differential equations (ODEs) of the form dy/dx = f(x, y).

Formula:

y_(i+1) = y_i + h * f(x_i, y_i)

r)What is Error.
Ans: In numerical analysis, error refers to the difference between the exact solution and
the approximate solution obtained by a numerical method. This can be:

• Absolute Error: The absolute difference between the exact and approximate
values, regardless of sign.
• Relative Error: The absolute error divided by the exact value, often expressed as a
percentage. This provides a measure of the error's significance relative to the
solution itself.

s)Mention the other name of Modified-Euler method.

Ans:The Modified Euler method, also known as Heun's method, is a second-order Runge-Kutta
method. It's a refinement of Euler's method that aims to improve accuracy by incorporating
information from a "predictor" and a "corrector" step within each step size. This leads to a more
accurate estimate of the solution compared to the basic Euler's method.

GROUP-A

a)What is the order of Convergence of bijection method.

Ans: The Bisection method has a linear order of convergence. This means that
with each iteration, the error in the approximation is roughly halved.

Linear Order: Bisection method


Quadratic Order: Newton-Raphson method (when it converges)
Cubic Order: Some higher-order methods
b) Find the number of significant digits in the 0.0005603000.

Ans:The number of significant digits in 0.0005603000 is 7

c) What do you mean by percentage error ?

Ans:Percentage error is a measure of the relative difference between an


approximate value (obtained from a numerical method) and the exact value,
expressed as a percentage.

Percentage Error = |Absolute Error| / |Exact Value| * 100%

Absolute Error = |Approximate Value - Exact Value|

d) Write the definition of interpolating points ?

Ans: Interpolating points are a set of ordered pairs (x_i, y_i) that define a function's
values at specific points within an interval. These points are used by interpolation
techniques to construct an approximation of the function between the known data
points.
e) Write the formula for compound simpon's 1/3rd rule ?

Ans: ∫_a^b f(x) dx ≈ h/3 * (f(a) + 4 * Σ(f(x_i)) + 2 * Σ(f(x_j)) + f(b))

𝟏
f) Find ∫𝟎 𝒙^𝟐 by Midpoint Rule ?

Ans:

g) What is the other name of Bolzano method ?

Ans: The Bisection method is the more commonly used name. There's no widely
recognized alternative name for the Bisection method in numerical analysis.

h) When 𝜟f(x)=f(x+h)- f(x), then Constant K=?

Ans: K= 0.327734375

i)Numerical techniques more commonly involve Iterative methods

j)Errors my occur in performing numerical computation on the computer due to


which of the following. Rounding errors

a)Operater Fatigue b)Back Substitution

c)Rounding errors d)Power fluctuation

k)Which of the following is also known as the Newton Rapson method. Tangent Method

a)Chord method b)tangent Method

c)Diameter method d)Secant method

l)If approximate solution of the set equations 2x+2y-z=6, x+y+2z=8 and -x+3y+2z=4
is given by x=2.8, y=1 and z=1.8, Then What is the exact solution.

Ans: (x = 2.8, y = 1, z = 1.8)

m)What is the advantage of the Gauss Jordan method.

Ans: Direct Solution

2. Error Detection

3. Ease of Understanding

4. Suitability for Large Systems


5. Uniqueness Check

n) Quadractic equation x^4-x-8=0 is defind with an initial guess of 1 and 2. Find the
approximate value of X2 using Secant Method.

Ans: f(x1) = f(1.75) ≈ -2.996

f(x2) = f(1.571) ≈ -0.274


o)What is the Simpsons 1/3rd Method.

Ans:The Simpson's 1/3rd rule, also simply called Simpson's rule, is a numerical
integration technique used to approximate the definite integral of a function f(x) over
a closed interval [a, b].

p)What is Local truncation error.

Ans: Local truncation error is a fundamental concept in numerical analysis. It refers


to the error introduced in a single step of a numerical method for solving a
differential equation or approximating an integral.

DARKSIDE(Mr.X)

You might also like