NT MR.X
NT MR.X
GROUP-D
1. Sign bit: This indicates whether the number is positive (0) or negative (1).
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
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
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.
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 =𝐶
𝑘→∞ ∣ 𝑥𝑘 − 𝐿 ∣
Ans:
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
Ans:
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_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
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
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]
Or
Ans:
x_1 = -1/2
x_2 = 0
x_3 = 1/2
x_4 = 1
x_5 = 3/2
x_6 = 2
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]
Or
𝟏.𝟑𝟎
Integrate ∫ √𝒙 dx numerically by compound Simpson’s 1/3rd rule using six interval.
𝟏
Ans:
Δx = (1.30 - 1) / 6 = 0.05
f(x_0) = √1 = 1
Δx = 0.05
f(x_i)
Therefore, the approximate value of the integral using the composite Simpson's 1/3rd rule with
six intervals is 0.2548.
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.
x_(n+1) = g(x_n)
Ans: Assume we’re looking for the root (or x-intercept) of f(x).
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
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
x2=x1-f(x1).x1-x0/f(x1)_f(x0)
Ans
Let f(x)𝑓(𝑥) be an arbitrary real function. The nth degree polynomial passing
through n+1𝑛+1 points.
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)
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! 𝑛!
Ans: To find the values of ( y(0.1) ) and ( y(0.2) ) using the Euler method,
y_1 = 1.1
• y(0.1) ≈ 1.1
• y(0.2) ≈ 1.212
Or
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)
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.
• 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
• 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.
Therefore,
= 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:
log(1) − log(10−5 )
𝑛≥
log(2)
0 − (−5log(10))
𝑛≥
log(2)
5log(10)
𝑛≥
log(2)
The nth difference of 2^x iteratively using the forward difference operator. Here's the process for n =
1 and n = 2
Δ^2(2^x): Δ(ln(2) * 2^x) = [ln(2) * 2^(x+h)] - [ln(2) * 2^x]= ln(2) * 2^x (2^h - 1)
Ans: The Lagrange polynomial of degree n for n + 1 data points (x_i, y_i) is:
where:
• 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)])
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
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]
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.
Let's use n = 4.
h = (b - a) / n = (1 - 0) / 4 = 0.25
Therefore, the numerical approximation of the integral ∫_0^1 e^(-x^2) dx using the Trapezoidal rule
with 4 subintervals is approximately 0.7854.
Ans: Given:
dy/dx = x + y
y(0) = 1
Initial guess:
y_0(x) = 1
y_0(t) = 1:
• y_1(x) = x^2/2 + x + 1
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:
Modified Euler's method aims to improve the accuracy of Euler's method by using an
average slope for the estimation.
Formula:
𝟏
i)find ∫𝟎 𝟏/𝟏 + 𝒙 dx using Simpsons 3rd Rule .
x_0 = a = 0, f(x_0) = 1 / (1 + 0) = 1
x_2 = b = 1, f(x_2) = 1 / (1 + 1) = ½
Apply the Simpson's 3/8 Rule formula:
≈ (3/8) * (1 + 2 + 1)
≈ (3/8) * 4
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)).
Ans: The midpoint rule is another numerical integration technique. It approximates the
definite integral of a function f(x) from a to b by:
Formula:
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.
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:
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.
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).
Ans: The error bound for the Trapezoidal rule for numerical integration is:
where:
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.
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.
Ans: Fast Convergence (Quadratic): When the method converges, it often does so
quadratically.
b)if 24.5 is approximated as 24, then find its absolute error and relative error..
The absolute error is the difference between the approximate value and the true value,
regardless of sign.
Relative Error:
The relative error expresses the absolute error as a proportion of the true value, often
expressed as a percentage.
Iteration 1:
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:
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:
f(x) is -3
Δ(-3) = -3 (x + h) - (-3) = 0
Δ(x^n) = n * h^(n-1) * x^(n-1)
Applying to f(x):
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.
x_0 = 0
y_0 = 1
f(x_0, y_0) = 0 + 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):
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.
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.
• 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.
• 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
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:
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:
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)).
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.
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:
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.
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
Ans: The Bisection method has a linear order of convergence. This means that
with each iteration, the error in the approximation is roughly halved.
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 ?
𝟏
f) Find ∫𝟎 𝒙^𝟐 by Midpoint Rule ?
Ans:
Ans: The Bisection method is the more commonly used name. There's no widely
recognized alternative name for the Bisection method in numerical analysis.
Ans: K= 0.327734375
k)Which of the following is also known as the Newton Rapson method. Tangent 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.
2. Error Detection
3. Ease of Understanding
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: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].
DARKSIDE(Mr.X)