Sei sulla pagina 1di 24

mca amity 2nd semester assignment

Numerical & Statistical Computations


section A
Q1-Find the negative root of the equation x3 21x + 3500 = 0
correct to two decimal places by Newton Raphson Method.
ans-
let f(x)=x3 -21x+3500
differentiating with respect to x we get
f'(x)=3x2-21
now observe if x=-16 then f(x)=-4096+336+3500=-260
if x=-15 then f(x)=-3375+315+3500=440
so the root lies between -15 and -16
let us take initial approximation root x0=-15
newton's formula is

putting n=0 in the first approximation we get

x1=x0-((x0)3-21x0+3500)/(3*(x0)2-21)

=-15 - [(-15)3-21*(-15)+3500]/[3*(-15)2-21]

=-15 - 440/654

=-15.67
f(x1)=f(-15.67)= (-15.67)3-21*(-15.67)+3500=-18.63

f'(x1)=f'(-15.67)=3*(-15.67)2-21=715.64

putting n=1 in newton's formula we get

x2=x1-[(x1)3-21x1+3500]/ (3*(x1)2-21)

=-15.67 - [(-15.67)3-21*(-15.67)+3500]/[3*(-15.67)2-21]

=-15.67- (-18.63)/(715.64)=-15.64

putting n=2 in newton's formula we get

x3=x2-[(x2)3-21x2+3500]/ (3*(x2)2-21)

=-15.64 - [(-15.64)3-21*(-15.64)+3500]/[3*(-15.64)2-21]

=-15.64-(2.74)/(712.8)=-15.64

the difference between x2 and x3 is almost 0 so the root is -15.64


correct to two decimal places.

Q5) Fit a straight line trend by the method of least square to


the following data.

ans-
let y=a+bx be best fit straight line for given data
then the normal equation are given by
y=na+bx --------(1)
xy=ax+bx2 --------(2)
Year Y X(deviation x.y x.x
from 1993)
1991 240 -2 -480 4
1992 255 -1 -255 1
1993 225 0 0 0
1994 260 1 260 1
1995 280 2 560 4
N=5 y=1260 x=0 xy=85 10

so from (1) we have:


1260=5a
=> a=252
from (2) we have:
b=85/10=8.5
so the straight line for given data is
y=252+8.5x
now to know the sale in year 2000 we have x=2000-1993=7
y=252+8.5*7=311.5

Q8-.Discuss the three available methods (Bi-Section, Regula


Falsi and Newton Raphson Method) and explain the merits
and demerits of each method.
ans-
BISECTION METHOD
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 a very simple and robust
method, but it is also relatively slow. Because of this, it is often
used to obtain a rough approximation to a solution which is then
used as a starting point for more rapidly converging methods. The
method is also called the interval halving method, the binary
search method, or the dichotomy method. Suppose that, by trial
and error for example, we know that a single root of some
function f lies between x = a and x = b. The root is said to be
bracketed by a and b. This must mean that f(a) and f(b) are of
opposite signs, that is that f(a)f(b) < 0. The aim with the bisection
method is to repeatedly reduce the width of the bracketing interval
a < x < b so that it pinches the required root of f to some
desired accuracy.

Regula Falsi Method


This is another two-point encompassing method. However it
differs from the bisection method since it uses some information
from the function f(x) in order to faster predict its root much like
Newton's method. In essence this is a clever remake of the
bisection and Newton's method. the bisection method always
divides in half the given interval in order to obtain the next iterate
closer to the root. Instead regular falsi tries to cleverly divide the
interval closer to the root. Let's take an example in order to outline
the thinking behind this new method: We let for instance x0 = 2
and x1 = 10 for the function f(x) = x2-6 and we wish to approximate
its root in that interval [2; 10]. Then we have that f(2) = -2 while
f(10) = 94 and note that the condition f(x0)f(x1) < 0 is satisfied.
Here the bisection method, which does not use any information
from the function f, would produce the next iterate at x2 = 6.
Whereas just looking at the two values for f we would expect the
root to be much closer to x0 = 2. The regula falsi method instead
takes into account precisely that information about the function at
the end points in order to make an educated guess as to where it
is most likely that the root ought to be closer to. Regula falsi
weighs that information in the calculation and produces the next
iterate much closer to x0 = 2. In gives that x2 = 2.16. Note the
difference between the two methods in just one iteration.

NEWTON's METHOD
Newton's method (also known as the NewtonRaphson method),
named after Isaac Newton and Joseph Raphson, is a method for
finding successively better approximations to the roots (or zeroes)
of a real-valued function.

The NewtonRaphson method in one variable is implemented as


follows:
The method starts with a function f defined over the real numbers
x, the function's derivative f' , and an initial guess x0 for a root of
the function f. If the function satisfies the assumptions made in the
derivation of the formula and the initial guess is close, then a
better approximation x1 is
Geometrically, (x1, 0) is the intersection of the x-axis and the
tangent of the graph of f at (x0, f(x0)).
The process is repeated as

until a sufficiently accurate value is reached.


BISECTION METHOD
ADVANTAGES
1) Always converges to the root.
2) Simple and easy to implement.
Disadvantages:
1) It may converge slowly to the root (especially if we use
complicated functions or large starting intervals).
2) An early iteration which is actually quite close to the root may
be easily discarded.
3) this method cannot be used to find multiple roots.

REGULA FALSI METHOD:


ADVANTAGES:
1.Better-than-linear convergence near simple root
2.Linear convergence near multiple root
3.No derivative needed as in newton's method
DISADVANTAGES
1.Iterates may diverge
2. No practical & rigorous error bound

NEWTON RAPHSON METHOD:


ADVANTAGES:
1.The advantage of the method is its order of convergence is
quadratic.
2.Convergence rate is one of the fastest when it does converges
3.Linear convergence near multiple roots.
DISADVANTAGES:
1.It needs the function evaluation and then the derivative
evaluation.
2.If the tangent is parallel or nearly parallel to the x-axis, then the
method does not converge.
3. Usually Newton method is expected to converge only near the
solution
section B
Q1-Compare and contrast Trapezoidal, Simpsons 1/3 and
Simpsons 3/8 rule of integration.
ans-
The trapezoidal rule is the first of the Newton-Cotes closed
integration formulas; it uses a straight-line approximation for the
function:

ERROR ANALYSIS OF TRAPEZOIDAL RULE


An estimate for the local truncation error of a single
application of the trapezoidal rule is:
where x is somewhere between a and b.
This formula indicates that the error is dependent upon the
curvature of the actual function as well as the distance
between the points.
Error can thus be reduced by breaking the curve into parts.

SIMPSON'S RULES
One drawback of the trapezoidal rule is that the error is
related to the second derivative of the function.
More complicated approximation formulas can improve the
accuracy for curves - these include using (a) 2nd and (b) 3rd
order polynomials(see figure below).
The formulas that result from taking the integrals under
these polynomials are called Simpsons rules.
Simpsons 1/3 Rule
Simpsons 1/3 rule corresponds to using second-order
polynomials. Using the Lagrange form for a quadratic fit of three
points:

Integration over the three points simplifies to:

Error of Simpsons 1/3 Rule


An estimate for the local truncation error of a single application of
Simpsons 1/3 rule is:
where again is somewhere between a and b.
This formula indicates that the error is dependent upon the
fourth-derivative of the actual function as well as the
distance between the points.
Note that the error is dependent on the fifth power of the
step size (rather than the third for the trapezoidal rule).
Error can thus be reduced by breaking the curve into parts.

Simpsons 3/8 Rule


Simpsons 3/8 rule corresponds to using third-order polynomials
to fit four points. Integration over the four points simplifies to:

Simpsons 3/8 rule is generally used in concert with


Simpsons 1/3 rule when the number of segments is odd.
Q2- Find the value of f(x) at 3.1 and 3.9 for the following data
by using the appropriate formula. x 3 3.2 3.4 3.6 3.8 4.0 y -14
-10.032 -5.296 0.256 6.672 14
2)
lets construct difference table
X Y y 2y 3y 4y 5y
3 -14
3.968
3.2 -10.032 0.768
4.736 0.048
3.4 -5.296 0.816 0
5.552 0.048 0
3.6 0.256 0.864 0
6.416 0.048
3.8 6.672 0.912
7.328
4.0 14

to know f(3.1) we will use newton's forward difference formula


because 3.1 is near the starting point. newton's formula of forward
difference is

here h=3.2-3=0.2, y0=3.968, 2y0=0.768, 3y0=0.048, 4y0=0,


5y0=0;
p=(x-x0)/h=0.1/0.2=0.5
f(3.1)=-14+0.5(3.968)+ [0.5*(0.5-1)]/2!)*0.768 +[0.5(0.5-1)(0.5-
2))/3!]*0.048 +0 +0
=-14+1.984-0.096+0.003= -12.109
now to know the f(3.9) we will use newton's backward formula

here h=0.2 so p=(3.9-4)/0.2=-0.5, yn=7.328, 2yn=0.912,


3yn=0.048, 4yn=0, 5yn=0;
f(3.9)=14+(-0.5)*7.328+[(-0.5)(-0.5+1)/2!]*0.912 +[(-0.5)(-0.5+1)(-
0.5+2))/3!]*0.048 + 0 + 0
=14-3.664-0.114-0.003=10.219

Q3)
a) Prove that E-?=1, where E is the shift operator.
b)?4y0=y4-4y3+6y2-4y1+y0
ans-
a) we have
y0=y1-y0=Ey0-y0
=(E-1)y0
so =E-1 or E-=1 proved
b) 4y0=(E-1)4y0=(E-1)2 .(E-1)2.y0=(E2+1-2E) (E2+1-2E).y0
=E4y0- 4E3y0+6E2y0-4Ey0+y0
=y4-4y3+6y2-4y1+y0 proved

section C

1. Which one is a method for getting solution to non-linear


algebraic equation?
Options
a) Runga Kutta Method
b) Newton Raphson Method
c) Jacobi Method
d) Divided Difference Formula
Ans- Newton Raphson Method
2. y=mx+c is the equation of a
Options
a) Polygon
b) Circle
c) Line
d) None
Ans-Line
3. Which one of the following is not a method for finding the root
of an algebraic equation?
Options
a) Newton Raphson Method
b) Bi-Section Method
c) Gregorys Method
d) Regula Falsi Method
Ans- Gregorys Method
4. The formula for Newton Raphson method is
Options
Ans- None of these
5. For x3 5x +3 =0, the root lies in between
Options
a) [0, 1]
b) [4, 5]
c) [3, 4]
d) [0, -1]
Ans-[0,1]
6. The value of f(x) is
Options
a) f(x1) + f(x0)
b) f(x1) f(x0)
c) f(x1)
d) None of these
Ans-None of these
7. Which one is not a method for numerical integration
Options
a) Trapezoidal Rule
b) Gauss Method
c) Simpsons 1/3 Rule
d) Simpsons 3/8 Rule
Ans-Gauss Method
8. The Formula for Bi-section method is
Options
a) (x1+x2)/2
b) (x1-x2)/2
c) (x1x2)/2
d) None of these
Ans-(x1+x2)/2
9.
Options
a) y3-3y2+3y1-y0
b) y3+3y2+3y1+y0
c) y0-3y1+3y2-y3
d) None of these
Ans-None of these
10. In forward difference formula h is
Options
a) The difference between two consecutive y.
b) The difference between two consecutive x
c) The difference between first and last x values
d) The difference between first and last y values
Ans- The difference between two consecutive x
11. In line fitting method, the general equation of a line is
Options
a) y = a + bx
b) y2 = a + bx
c) y = a + bx2
d) None of these
Ans- y = a + bx
12. For Trapezoidal rule the Generalized Quadrature formula uses
Options
a) n=1
b) n=2
c) n=3
d) None of these
Ans-n=1
13. Gauss elimination method is used to solve the set of linear
algebraic equations
Options
a) True
b) False
Ans-true
14. For f(a) and f(b)are of same sign then equation f(x)=0 has at
least one root with in [a,b].
Options
a) True
b) False
Ans-true
15. C (n, r) or nCr. = n! / (n+r)! r!
Options
a) True
b) False
Ans-False
16. In Gauss Elimination method, coefficient matrix A is reduced
to upper triangle matrix by using the elementary row operations
Options
a) True
b) False
Ans-True
17. Modified Euler is a modified version of Euler Method.
Options
a) True
b) False
Ans-True
18. Gauss Elimination method reduces the system of equations to
an equivalent upper triangular matrix.
Options
a) True
b) False
Ans-True
19. Regula Falsi Method converges fastest among Bi-section,
Regula Falsi and Newton Raphson Method.
Options
a) True
b) False
Ans-False
20. The number of distinguishable words that can be formed from
the letters of MISSISSIPPI is 34650.
Options
a) True
b) False
Ans-True
21. The set of linear algebraic equations can be arranged in
matrix for AX=B, where A is the coefficient matrix, X is the variable
matrix.
Options
a) True
b) False
Ans- True
22. Numerical methods give always-exact solutions to the
problems
Options
a) True
b) False
Ans-False
23. Simpsons method is used to interpolate the value of the
function at some given point.
Options
a) True
b) False
Ans-False
24. The set of equation 3x+2y = 0 and 2x+7y = 9 can be solved
by using Bi-Section method.
Options
a) True
b) False
Ans- False
25. In solving simultaneous equation by Gauss- Jordan method ,
the coefficient matrix is reduced to - matrix
Options
a) Null
b) Unit
c) Skew
d) Diagonal
Ans-Null
26. The order of convergence in Newton Raphson method is
Options
a) 2
b) 3
c) 0
d) None of these
Ans-2
27. Which of the following is a step by step method
Options
a) Taylor`s
b) Adams-Bashforth
c) Picard`s
d) Euler`s
Ans-Eulers
28. In the case of Bisection method , the convergence is
Options
a) LINEAR
b) Quadratic
c) Very slow
d) None
Ans-Very slow
29. Solutions of simultaneous non- linear equations can be
obtained using
Options
a) Method of iteration
b) Newton-Raphson method
c) Bisection method
d) None
Ans-Newton Raphson method
30. Bessel`s formula is most appropriate when p lies between
Options
a) -0.25 and 0.25
b) 0.25 and 0.75
c) 0.75 and 1
d) None of the above
Ans-0.25and0.75
31. The order of the matrix [473] is.
Options
a) 3*1
b) 1*3
c) 3*3
d) 1*1
Ans-3*1
32. If B is square matrix and BT = B, then B is called
Options
a) Symmetric
b) Skew symmetric
c) Singular
d) Non Singular
Ans-Skew Symmetric
33. Find the coefficient of x in the Taylor series about x = 0 for
f(x) =sin2x ?
Options
a) -2/3
b) -4/3
c) 4/3
d) 2/3
Ans- -2/3
34. The bisection method of finding roots of nonlinear equations
falls under the category of a (an) - method.
Options
a) Open
b) Bracketing
c) Random
d) Graphical
Ans- Bracketing
35. A unique polynomial of degree passes through
n+1 data points.
Options
a) n+1
b) n
c) n or less
d) n+1 or less
Ans- n
36. Interpolation is the technique to find the value of dependent
variable for the given value of independent variable
Options
a) True
b) False
Ans- False
37. By increasing the iterations of any Numerical methods, we
increase the correctness of the solution.
Options
a) True
b) False
Ans-True
38. Lagranges Interpolation method can be used only for equal
interval problems.
Options
a) True
b) False
Ans-False
39. Trapezoidal Integration Method is derived by putting
Options
a) n =0
b) n=1
c) n=2
d) n=4
Ans- n=1
40.
If f(x) is a real continuous function in [a,b], and f(a)f(b)<0, then for
f(x),there is (are).in the domain [a,b].
Options
a) One root
b) An undeterminable number of roots
c) No root
d) At least on root
Ans- One root

Potrebbero piacerti anche