I ns t i t ut eo fMa na g e me nt & Te c hni c a lSt udi e s
COMPUTERORI ENTEDNUMARI CAL & STATI CMETHODS
PGDCA
www. i mt s i ns t i t ut e . c o m
IMTS (ISO 90012008 Internationally Certified)
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
COMPUTER ORIENTED NUMARICAL & STATIC METHODS FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS UNIT I:
0125
Statistical methods: Probability and expected values – Correlation analysis – Meaning – Types – Degrees of correlation – Scatter diagram – Correlation graph – Karl Pearson’s coefficient of correlation – Rank correlation. Regression analysis – Meaning – types of regression – Regression equations – Regression equations from mean – Regression coefficients – properties of Regression coefficients – correlation and regression a comparison.
UNIT II:
2666 Theoritical distributions: Binomial, Poisson, normal distributions –
tests of hypothesis – types of errors – estimation – large samples tests – small samples tests – χ2 test – F test .
UNIT III :
6796
Numerical methods: Introduction  errors – machine computation – Transcendental and polynomial equation – Initial approximation – bisection, secant, NewtonRaphson, the Muller, the Chebyshev and iterative methods – polynomial equations – The bierge vieta ,
multipoint Bairstow and
Graeffe’s root squaring methods.
UNIT IV :
97117
System of linear algebraic equations and eigen value problems – Gauss elimination, Gauss Jordan, Triangularisation, Cholesky methodsGauss Jacobi and Gauss Siedel methods.
UNIT V:
118146 Interpolation and approximation – Newton, Lagrange’s methods –
Numerical differentiation and Integration – methods based on
interpolation
– Trapezoidal rule – Simpson’s rule – Romberg Integration.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
UNIT – I STATISTICAL METHODS UNIT STRUCTURE
1.0 Introduction 1.1 Statistics as statistical methods 1.2 Probability and expected values 1.3Correlation analysis 1.3.1 Meaning 1.3.2 In the view of mathematicians 1.4 Types of correlation 1.4.1 Positive and negative correlation 1.4.2 Simple and multiple correlation 1.4.3 Partial and total correlation 1.4.4 Linear and nonlinear correlation 1.5 Methods of studying correlation 1.5.1 Scatter diagram method 1.5.2 Graphic method 1.5.3 Karl pearson’s co efficient of correlation 1.6 Calculation of correlation co efficient: 1.6.1 Direct method. 1.6.2 Deviations are taken from actual mean 1.6.3 Deviations are taken from assumed mean 1.6.4 Correlation of grouped bi – variate data. 1.7 Rank correlation co efficient 1.7.1 Calculation of the rank correlation co efficient 1.8 Regression analysis and its meaning 1.8.1 Definition 1.8.2 In the view of mathematicians…. 1.9 Regression equations 1.9.1 Regression equation X on Y 1.9.2 Regression equation Y on X 1.10 Regression equations from mean 1.10.1Regression equation X on Y 1.10.2Regression equation Y on X 1.11 Regression coefficients 1.11.1 Regression co efficient of X and Y 1.11.2 Regression co efficient of Y and X 1.11.3 Properties of Regression Coefficients 1.12 Correlation and regression – A Comparison 1.12.1 Properties of co efficient of correlation 1.12.2 Properties of Regression Coefficients 1.12.3 Merits of regression 1.12.4 Correlation and regression 1.12.5 Difference between correlation and regression 1.13 Miscellaneous sums 1.14 Problems with answers
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
1
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
1.0 Introduction : Statistics is the science and practice of developing human knowledge through the use of empirical data. It is a mathematical science pertaining to the collection, analysis, interpretation or explanation, and presentation of data. It is applicable to a wide variety of academic disciplines, from the natural and social sciences to the humanities, and to government and business. Within statistical theory, randomness and uncertainty are modelled by probability theory. Because the aim of statistics is to produce the "best" information from available data, some authors make statistics a branch of decision theory. 1.1 Statistics as statistical method: Some definitions : Bowley defines statistics in the following three different ways: Statistics may be called the science of counting. Statistics may rightly be called the science of averages. Statistics is the science of the measurement of social organism, regarded as a whole in all its manifestations. According to Boddington, “Statistics is the science of estimates and probability”. This is also an inadequate definition since, estimates and probabilities constitute only a part of the statistical methods. King says, “The science of Statistics is the method of judging collective, natural or social phenomenon from the results obtained from the analysis or enumeration or collection of estimates.” Lovitt defines Statistics as “Statistics is the science which deals with collection, classification and tabulation of numerical facts as the basis for explanation, description and comparison of phenomenon.” Croxton and Cowden defines as “Statistics is the science which deals with the collection, analysis and interpretation of numerical data.” These are some definition for Statistics defined by famous authors. 1.2 Probability and expected values Introduction: The word probability and chance are quite familiar to everyone. Many time we come across statements like “There is a bright chance for Indian cricket team to win the World Cup this time”. “It is possible that our school students may get state ranks in forthcoming public examination”. “ Probably it may rain today” . The word chance, possible, probably, likely etc. convey some sense of uncertainty about the occurrence of some events. Our entire world is filled with uncertainty. We make decisions affected by uncertainty virtually every day. In order to think about and measure uncertainty, we turned to a branch of mathematics called probability. Before we study the theory of probability let us learn the definition of certain terms, which will be frequently used. Experiment: An Experiment is defined as a process for which its result is well defined. Outcome: The result of an experiment is called its outcome. Deterministic experiment: An Experiment whose out comes can be predicted with certain, under identical conditions.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
2
COMPUTER ORIENTED NUMARICAL & STATIC METHODS Random experiment: An experiment whose all possible out comes are known ,but it is not possible to predict the outcome. Example: (i) A fair coin is “tossed” (ii) A die is “rolled” are random experiments, since we cannot predict the outcome of the experiment in any trial. Event: Any possible outcome of a random experiment is called an event. It may be simple or composite. A simple event (or elementary event): Single possible outcome of a random experiment and it cannot be decomposed further. Composite event: A combination of outcomes of a random experiment. Sample space: The set of all possible outcomes of a random experiment is called a sample space. Every nonempty subset of the sample space is an event. The sample space S is called Sure event or Certain event. The null set in S is called impossible event. Example : When a single, regular die is rolled ones, the associated sample space is S= {1, 2, 3, 4, 5, 6 }… {1},{2},{3},{4},{5},{6} are the simple events or elementary events. {1},{2,3},{1,3,5},{2,4,5,6} are some of the composite events. Mutually exclusive events (or disjoint events): Two or more events are said to be mutually exclusive if they have no simple events (or out comes) in common. (i.e. They cannot occur simultaneously.) Example: when we roll a die the events {1, 2, 3} and {4, 5, 6} are mutually exclusive event. Exhaustive Events: A set of events is set to be exhaustive if no event outside this set occurs and at least one of these events must happened as a result of an experiment. Example: When a die is rolled, the set of events {1,2,3},{2,3,5},{5,6}, {4,5}are exhaustive events. Equally likely events: A set of events is set to be equally likely if none of them is expected to occur in preference to the other. Classical definitions of Probability: If there are n exhaustive, mutually exclusive and equally likely outcomes of an experiment and m of them are favorable to an event A, then the mathematical probability of A is defined as the ratio of m/n i.e., P (A) = m/n. In other words, let S be the sample space and A be an event associated with a random experiment. Let n(S) and n(A) be the number of elements of S and A respectively. Then the probability of event A is defined as
P( A)
n( A) Number of cases favorable to A n( S ) Exhaustive Number of cases in S
Axioms of Probability Given a finite sample space S and an event A in S , we define P(A), the probability of A, satisfies the following three conditions. (1) 0 ≤ P(A) ≤ 1 (2) P(S) = 1 (3) If A and B are mutually exclusive events, P(AUB) = P(A) + P(B) where P(AUB) is the probability of occurrence of A or B.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
3
COMPUTER ORIENTED NUMARICAL & STATIC METHODS Note: If A1, A2, A3, . . . ,An are mutually exclusive events in a sample space S, then P(A1 U A2 UA3U. . . UAn) = P(A1)+ P(A2)+ P(A3)+. . . + P(An). 1.3 Correlation analysis: Correlation is the statistical analysis which measures and analyses the degree (or) extent to which two variables fluctuate with reference to each other. Correlation is the basis for the concept of regression and ratio of variation. The correlation analysis refers to the technique used in measuring the closeness of the relationship between variables. The explanation of a significant degree of correlation may be any one or a combination of the following reasons. The correlation may be due to pure chance, especially in a small sample. Both the correlated variables may be influenced by one or more other variables. Both the variables may be mutually influencing each other so that neither can be designated as the cause and the other effect. The problem of analyzing the relation between different series should be broken down into three steps: Determining whether a relation exists and if it does, measuring it. Testing whether it is significant. Establishing the cause and effect relation, if any… 1.3.1 Meaning: Correlation refers to the relationship of two or more variables. For example, there exists some relationship between the height of a father and the height of a son, price and demand, wage and price index, yield and rainfall, height and weight and so on. . . 1.3.2 In the view of mathematicians…. “Correlation is an analysis of the co variation between two (or) more variables”  A.M.Tuttle “Correlation analysis attempts to determine the degrees of relationship between variables”  Ya Lun Chou “Correlation analysis deals with the association between two or more variables”  Simpson & Kafka. Types of correlation: Correlation is classified into many types, but the most important are: 1. Positive and negative 2. Simple and multiple 3. Partial and total 4. Linear and nonlinear 1.4.1 Positive and negative correlation: It depends upon the direction of change of the variables. If two variables tend to move together in the same direction. i.e., an increase in the value of one variable is accompanied by an increase in the value of the other variable, or a decrease in the value of one variable is accompanied by a decrease in the value of the other variable, then the correlation is called Positive Or direct correlation. Example: Height and weight, rainfall and yields of crops. If two variables, tend to move together in opposite directions so that an increase or decrease in the values of one variable is accompanied by a decrease or increase in the values of other variables, then the correlation is called negative (or) inverse correlation. Example: price and demand, supply and demand. 1.4.2 Simple and multiple correlations: When we study only two variables, the relationship is described as Simple correlation. Example: Quantity of money and price level, demand and supply of a commodity.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
4
COMPUTER ORIENTED NUMARICAL & STATIC METHODS But in a multiple correlation, we study more than two variables simultaneously. Example: The relationship of price, demand and supply of a commodity. 1.4.3 Partial and total correlation: The study of two variables excluding some other variables is called Partial correlation. Example: we study price and demand eliminating the supply side. The study of all the facts of variables is called Total correlation. For e.g. study about all the facts of price, demand and supply. 1.4.4 Linear and nonlinear correlation: If the ratio of change between two variables is uniform, then there will be linear correlation between them Example: consider the following data: X 5 10 15 20 Y 4 8 12 16 The ratio of change between them is same. If we plot these on the graph, we get a straight line. In a Nonlinear (or) Curvilinear correlation, the amount of change in one variable does not bear a constant ratio of the amount of change in the other variables. The graph of nonlinear relationship will form a curve. 1.5 Methods of studying correlation: The different methods of finding out the relationship between two variables are . .. Scatter diagram method Graphic method Karl Pearson’s co efficient of correlation Co efficient of concurrent deviation Method of least squares Of these, the first two are based on the knowledge of diagram and graphs , where as the others are mathematical methods. In this chapter we shall be discussed on the first three methods in detail. 1.5.1 Scatter diagram method: This is the simplest method of finding out whether there is any relationship present between two variables by plotting the values on a chart, known as Scatter diagram. Procedure: In this method, the given data are plotted on a graph paper in the form of dots. X variables are plotted on the horizontal axis and Y variables on the vertical axis. Thus, we have the dots and we can know the scatter or concentration of the various points. This will show the type of correlation. fig (1) fig (2)
(r = + 1) Perfect positive correlation
(r =  1) Perfect Negative correlation
If the plotted points form a straight line running from the lower lefthand corner to the upper righthand corner, then there is a perfect positive correlation (i.e., r =+1in fig(1). On the other hand, if the points are in a straight line, having a falling trend from the upper lefthand corner to the lower righthand corner, it reveals that there is a perfect negative correlation (i.e., r =1 in fig2 ).
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
5
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
6
If the plotted points fall in a narrow band, and the points are rising from lower lefthand corner to the upper righthand corner there will be a high degree of positive correlation between the variables (fig 3). If the plotted points fall in a narrow band from the upper left â€“ hand corner to the lower righthand corner, there will be a high degree of negative correlation between the variables (fig 4). If the plotted points fall lie scatter all over the figure, there is no correlation between the two variables (fig 5). Fig (3)
fig (4)
High degree of positive correlation
fig (5)
high degree of negative correlation
no correlation
Merits: Scatter diagram is a simple and attractive method of finding out the nature of correlation between two variables. 1) It is a nonmathematical method studying correlation. It is easy to understand. 2) We can get a rough idea at a glance whether it is positive or negative correlation. 3) It is not influenced by extreme items. 4) It is a first step in finding out the relationship between two variables. Demerits: By this method, we cannot get the exact degree or correlation between two variables. It gives only a rough idea. 1.5.2 Graphic Method: The values of the two variables are plotted on a graph paper. We get two curves, one for X variables and another for Y variables. These two curves reveal the direction and closeness of the two curves and also reveal whether or not the variables are related. If both the curves move in the same direction i.e., parallel to each other , either upward or downward , it is called to be positive. On the other hand, if they move in opposite directions, then the correlation is said to be negative. For e.g. draw a correlation graph for the following: Period Variable1 Variable2 Y
January 15 30
v1
v2
February 18 35
March 22 43
April 20 41
May 25 51
June 20 40
fig (6)
70 35 60
30
50
25
v2
40
20
v1
30
15
20
10
10
5
0
X
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS J
F
M
A
M
7
J
(months)
The Graphical method is used in the case of time series. This method does not reveal the extent to which the variables are related. 1.6 Karl Pearson’s co efficient of correlation: Correlation is a statistical technique used for analyzing the behavior of two or more variables. Its analysis deals with the association between two or more variables. Statistical measures of correlation are proof. Only of covariation between series not of functional or causal relationship. It is not always possible to obtain the exact of the other variable, if the value of a variable is known. Karl Pearson’s method is the most widely used method in practice and is known as pearsonian co efficient of correlation. It is denoted by the symbol ‘r’ and the formula is
r
xy
, x X X and y Y  Y
x 2 y 2
applied when the deviation of items are taken from the actual mean. The value of the co efficient of correlation shall always lie between +1 & 1. Calculation of correlation coefficient: 1.6.1 Direct method: The co efficient of correlation is calculated by the formula:
r
nxy xy
nx 2 x
ny 2 y
2
2
1.6.2 When the deviations are taken from actual mean.
r
xy
x 2 y 2
, x X X and y Y  Y
1.6.3 When the deviations are taken from an assumed mean.
ndxdy dxdy
r
ndx 2 dx
2
ndy 2 dy
2
where dx=XA,dy=YB
A and B are assumed mean of X and Y series respectively . 1.6.4 Correlation of grouped bi – variate data. When the number of observations is very large, the data is classified into two – way frequency distribution or correlation table.
r
nfdxdy fdxfdy nfdx 2 fdx
2
nfdy 2 fdy
2
, where n f .
Example: Direct method: Calculate the co efficient of correlation from the following data X 12 9 8 10 11 Y
14
8
6
9
11
13
7
12
3
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
8
Solution: Calculation of coefficient of correlation Y
2
XY
144
196
168
8
81
64
72
8
6
64
36
48
10
9
100
81
90
11
11
121
121
121
13
12
169
144
156
7
3
49
9
21
X
Y
X
12
14
9
∑X=70
2
2
∑Y=63
∑X =728
2
∑Y =651
∑XY=676
We know that,
nxy xy
r
nx 2 x
Hence
2
7 * 676 70 * 63
r r
ny 2 y
2
7 * 728 70
2
7 * 651 63
2
4732 4410 322 0.949 339.48 339.48
r = + 0.95
Problem: Find if there is any significant correlation between the heights and weights given below: Height (x)
57
59
62
63
64
65
55
58
57
113
117
126
126
130
129
111
116
112
In inches Weight (y) In LBS
Solution: The deviations are taken from actual mean: Calculation of coefficient of correlation X
Y
x=X X
y=Y Y
x
2
2
y
xy
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
9
57
113
3
7
9
49
21
59
117
1
3
1
9
3
62
126
+2
+6
4
36
12
63
126
+3
+6
9
36
18
64
130
+4
+10
16
100
40
65
129
+5
+9
25
81
45
55
111
5
9
25
81
45
58
116
2
4
4
16
8
57
112
3
8
9
64
24
∑X=540
∑Y=1080
∑x = 0
∑y = 0
∑x =102
∑y =472
X = ∑X/n =540/9 =60, We know that,
xy
r
x 2 y 2
r
2
2
∑xy=216
Y = ∑Y/n = 1080/9 = 120 , x X X and y Y  Y ,
216 102 472
0.984
r = + 0.984
When the deviations are taken from an assumed mean: Here n = 9
X
Y
dx=XA
dy=YB
=X64
=Y126
dx
2
2
dy
dxdy
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
10
57
113
7
13
49
169
+91
59
117
5
9
25
81
+45
62
126
2
0
4
0
0
63
126
1
0
1
0
0
64
130
0
4
0
16
0
65
129
+1
3
1
9
+3
55
111
9
15
81
225
+135
58
116
6
10
36
100
+60
57
112
7
14
49
196
+98
∑dx= 36
∑dy= 54
∑d x =246
2
∑dy =796
r
ndxdy dxdy ndx dx
2
2
r
r
ndy dy 2
2
2
∑dxdy=432
where dx=X64,dy=Y126
9 * 432 36 * 54 9 * 246 36
2
216 102 472
9 * 796 54
2
0.984
r = + 0.984 Problem : Correlation of grouped bi – variate data. Calculate the coefficient of correlation between the marks obtained students in Mathematics and Statistics as given below: Marks in
Marks in Mathematics
Statistics
20 – 30
30 – 40
40 – 50
15 – 25
5
9
3
25 – 35
10
25
2
37
35 – 45
1
12
2
15
50 – 60
60 – 70
by a batch of 100
total 17
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
45 – 55
4
55 – 65 Total
5
20
44
16
5
25
4
2
6
24
7
100
We know that by the coefficient of correlation,
r
r
nfdxdy fdxfdy nfdx 2 fdx
2
nfdy 2 fdy
2
100 * 88 8(34) 100 * 92 8
2
100 * (154) 34
2
, where n f .
, where n f N 100.
r = +0.7953 The Table calculation was done by , the following steps……
Find the mid – points of the various classes for x and y variables.
Take the step deviation of x variables; (dx)
Take the step deviation of y variables; (dy)
Multiply dx, dy and the respective frequencies of each cell and note the figure obtained in the left – hand corner of each cell.
Sum up all the values as calculated in step 4 and get the total.(i.e., ∑f dx dy).
Multiply dx by the respective frequency and get ∑f dx .
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
11
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
2
2
Multiply dx by the respective frequency and get ∑f dx .
Multiply dy by the respective frequency and get ∑f dy .
Multiply dy by the respective frequency and get ∑f dy .
Substitute the values in the above formula and find out r.
2
2
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
12
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 1.7
13
Rank correlation co efficient:
 Charles Edward Spearman(1904) This measure is useful in dealing with qualitative characteristics such as intelligence, beauty, morality, character, etc., and it is based on the ranks given to the observations. It can be used when the data are irregular or extreme items. It is applicable only to individual observations. The result we get from this method is only an approximate one, because under ranking method original value are not taken into account. 1.7.1 Calculation of the rank correlation co efficient : (a) When the ranks are given. (b) When the ranks are not given. (c) When the ranks are equal or repeated ranks. The formula for calculating Spearman’s rank correlation co efficient is,
1
6D 2 n3 n
: Rank co efficient of correlation D2 : Sum of the squares of the differences of two ranks. n : Number of period observations. The formula for calculating Spearman’s rank correlation co efficient (in the case of equal (or) repeated ranks) is,
1
6 D 2 m 3 m / 12 m 3 m 12 n3 n
m: number of items whose ranks are common. Problems: (a) when the ranks are given. Following are the rank obtained by 10 students in two subjects. To what extent the knowledge of the students in the two subjects is related? Sub1(X)
1
2
3
4
5
6
7
8
9
10
Sub2(Y)
2
4
1
5
3
9
7
10
6
8
Solution: Calculation of the Spearman’s rank correlation co efficient: Here n=10
2
X
Y
D=R1(X)R2(Y)
D
1 2 3 4 5 6 7 8 9 10
2 4 1 5 3 9 7 10 6 8
1 2 +2 1 +2 3 0 2 +3 +2
1 4 4 1 4 9 0 4 9 4
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
14
∑D2=40 We know that,
6D 2 6 * 40 240 750 1 3 1 3 1 0.758 990 990 n n 10 10
= + 0.758
(b)when the ranks are not given. A random sample of 5 college students is selected and their grades in mathematics and statistics are found to be Mathematics (x) 85 60 73 40 90 Statistics (y)
93
75
65
50
80
Calculate the Spearman’s rank correlation co efficient. Solution: Here n=5 Calculation of the Spearman’s rank correlation co efficient: 2
X
Y
R1(X)
R2(Y)
D=R1(X)R2(Y)
D
85
93
2
1
1
1
60
75
4
3
1
1
73
65
3
4
1
1
40
50
5
5
0
0
90
80
1
2
1
1 2
∑D = 4 We know that ,
1
6D 2 6*4 24 96 1 3 1 0.8 3 120 120 n n 5 5
= + 0.8
( c) when the ranks are equal or repeated ranks: From the following data, calculate the rank correlation co efficient after making adjustments for tied ranks. X
48
33
40
9
16
16
65
24
16
57
Y
13
13
24
6
15
4
20
9
6
19
Solution: Calculation of the Spearman’s rank correlation co efficient: XSeries: th
th
th
since 16 is repeated 3 times at 7 ,8 and 9 places, the rank is
th
th
789 8 3
YSeries: since 13 is repeated 2 times at 5 ,6 places, the rank is
th
th
since 6 is repeated 2 times at 8 ,9 places, the rank is
56 5.5 2
89 8.5 2
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
15 2
X
Y
R1(X)
R2(Y)
D=R1(X) R2(Y)
D
48
13
3
5.5
2.5
6.25
33
13
5
5.5
0.5
0.25
40
24
4
1
3
9
9
6
10
8.5
1.5
2.25
16
15
8
4
4
16
16
4
8
10
2
4
65
20
1
2
1
1
24
9
6
7
1
1
16
6
8
8.5
0.5
0.25
57
19
2
3
1
1 2
∑D = 41 We know that,
6 D 2 m 3 m / 12 m 3 m 12 n3 n 3 6 41 3 3 / 12 2 3 2 12 12 264 1 1 0.733 3 990 10 10
1
= 0.733
1.8 Regression analysis and its meaning: In 1877, Sir francis Galton , first introduced the word “Regression” The tendency to regression or going back was called by Galton as “The line of regression”. The line describing the average relationship between two variables is known as the line of regression. 1.8.1 Definition: The statistical method which helps us to estimate the unknown value of one variable from the known value of the related variable is called “Regression”. 1.8.2 In the view of mathematicians…. “Regression is the measure of the average relationship between two (or) more variables in terms of the original units of the data”  Blair. “Regression analysis attempts to establish the nature of the relationship between variables – that is to study the functional relationship between the variables and there by provide a mechanism for prediction or forecasting”  Ya Lun Chou. “One of the most frequently used techniques in economics and business research, to find a relation between two or more variable that are related causally is regression analysis” Taro Yamane. 1.9 Regression equations: Regression equation, also known as estimating equations (or) algebraic expressions of the regression lines. Since there are two regression lines and there are two regression equations , i. ii.
The regression equation X on Y is used to describe the variation in the value of X for given changes in Y . The regression equation Yon X is used to describe the variation in the value of Y for given changes in X.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
1.9.1 Regression equation of X on Y : It is expressed as follows: Xc = a + bY, X : Dependent variable Y : Independent variable a , b : constants a , b are obtained from the following two normal equations: ∑X = na + b∑Y ∑XY = a∑Y + b∑Y
2
n : number of observed pairs of values
1.9.2 Regression equation Y on X : It is expressed as follows: Yc = a + bX, Y : Dependent variable X : Independent variable a , b : constants a , b are obtained from the following two normal equations: ∑Y = na + b∑X ∑XY = a∑X + b∑X
2
n : number of observed pairs of values
1.10 Regression equations from mean : The above method of finding out regression equation is tedious. The calculation can very much be simplified if instead of dealing with the actual values of x and Y. we take the deviations of X and Y series from their respective means. In such a case, the two regression equations are written as follows: 1.10.1 Regression equation X on Y: It is expressed as follows:
XX r
x Y Y y
X : Mean of X – series Y : Mean of Y – series The regression co efficient of X on Y is denoted by bXY and it is defined by
b xy r
x xy y y2
1.10.2 Regression equation Y on X: It is expressed as follows:
YY r
y X X x
X : Mean of X – series Y : Mean of Y – series The regression co efficient of Y on X is denoted by bYX and it is defined by
b yx r
y xy x x2
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
16
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
17
Note:
r 2 b xyb yx r b xyb yx
Regression equations : Problem: From the following data , obtain the two regression equations : X
6
2
10
4
8
Y
9
11
5
8
7
Solution: Calculation of Regression Equations X Y XY 6 2 10 4 8 ∑X=30
9 11 5 8 7 ∑Y=40
54 22 50 32 56 ∑XY=214
X
2
36 4 100 16 64 2 ∑X =220
2
Y
81 121 25 64 49 2 ∑Y =340
(a) Regression equation of X on Y : Xc = a + bY, (1) where a , b are obtained from the following two normal equations: ∑X = na + b∑Y (2) 2 ∑XY = a∑Y + b∑Y (3) (2) and (3) becomes, 30 = 5 a + 40 b (4) 214 = 40 a + 340 b (5) Solving (4) and (5) we have, a = 16.4 and b = 1.3 Hence , the Regression equation X on Y is Xc = 16.4 – 1.3 Y (b) Regression equation Y on X : Yc = a + bX, (6) Where a , b are obtained from the following two normal equations: ∑Y = na + b∑X (7) 2 ∑XY = a∑X + b∑X (8) (7) and (8) becomes, 40 = 5 a + 30 b (9) 214 = 30 a + 220 b (10) Solving (9) and (10) we have, a = 11.9 and b = 0.65 Hence , the Regression equation Y on X is Yc = 11.9 – 0.65 X
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
18
Regression equations from mean: Problem: Calculate the regression equation taking deviation of items from the mean of X and Y series. X 6 2 10 4 8 Y
9
11
5
8
7
Solution:
X = ∑X/n =30/5 =6,
Y = ∑Y/n = 40/5 = 8
Calculation of Regression Equations X
Y
x = XX
y=YY
x
6
9
0
+1
2
11
4
10
5
4
2
2
y
xy
0
1
0
+3
16
9
12
+4
3
16
9
12
8
2
0
4
0
0
8
7
+2
1
4
1
2
∑X=30
∑Y=40
∑x=0
∑y=0
∑x =40
2
2
∑y =20
∑xy= 26
i. Regression equation of X on Y:
XX r
=
x Y Y y
xy Y Y y2
X – 6 = ( 26 / 20) (Y – 8) X = 1.3 Y + 16.4 ii. Regression equation of Y on X:
YY r
Y8
y X X x
xy X X x 2
= ( 26/40)(X6) = 0.65X + 3.9
Y = 0.65X + 11.9
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 1.11 Regression co efficients: Definition: 1.11.1 Regression co efficient of X on Y: The slope of the line of regression of Y on X is called the coefficient of regression of Y on X. It represents the increment in the value of dependent variable Y corresponding to a unit change in the value of independent variable X . More precisely, we write
b xy r
x xy y y2
(1)
1.11.2 Regression co efficient of Y on X: The slope of the line of regression of X on Y is called the coefficient of regression of X on Y. It represents the increment in the value of dependent variable X corresponding to a unit change in the value of independent variable Y . More precisely, we write
b yx r
y xy x x2
(2)
1.11.3 Properties of Regression Coefficients: 1.Correlation coefficient is the geometric mean between the regression coefficients. Proof: 2 bxy = r (σx / σy) = ( ∑xy / ∑y ). (1) 2 byx = r (σy / σx) = ( ∑xy / ∑x ). (2) (1) X (2), 2 bXY . bYX = r (σx / σy) . r (σy / σx) = r
r 2 bxy b yx r b xyb yx Hence the proof . 2. If one of the regression coefficients is greater than unity, the other must be less than unity . Proof: Let one of the regression coefficient (say) b yx >1. Claim: bxy < 1 Now, byx >1 (3) 1/ byx < 1 2 Also, r ≤1 bxy . byx ≤ 1 bxy ≤ 1/ byx < 1 ( using (3) ) Hence, bxy < 1 3. Arithmetic mean of the regression co efficients is greater than the correlation coefficient r, provided r > 0 Proof: We have to prove that ½( byx + bxy ) ≥ r (or) ½ ( r (σy / σx) + r (σx / σy) ) ≥ r (or)
( (σy / σx) + (σx / σy) ) ≥ 2 2
2
σx + σy – 2 σx σy ≥ 0 2
(σx – σy) ≥ 0 which is always true, since the square of a real quantity is ≥ 0
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
19
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
20
4.Regression coefficients are independent of the change of origin but not of scale. Proof: Let U = (X – a)/ h , V = (Y – b)/ k X = a + hU , Y = b + kV where a, b, h(>0), k(>0) are constants. We can prove bYX = r (σy / σx) = (k/h) bVU and bXY = r (σx / σy) = (h/k) bUV Hence the proof. 1.12 Correlation & regression  A Comparison
1.12.1 Properties of co efficient of correlation: The coefficient of correlation lies between 1 and +1 . i.e.,  1 ≤ r ≤ 1 (or)  r  ≤ 1. The co efficient of correlation is independent of charge of scale and origin of the variable x and y. The co efficient of correlation is the geometric mean of two regression co efficients . i.e.,
r b xyb yx
The degree of relationship between the two variables is symmetric as shown below: rxy = ryx rxy = ( (∑xy) / n . σx . σy ) = ( (∑yx) / n . σx . σy ) = r yx
1.12.2 Properties of Regression Coefficients:
Correlation coefficient is the geometric mean between the regression coefficients. i.e.,  1 ≤ r ≤ 1 (or)  r  ≤ 1. If one of the regression coefficients is greater than unity, the other must be less than unity . Arithmetic mean of the regression co efficients is greater than the correlation coefficient r , provided r > 0. Regression coefficients are independent of the change of origin but not of scale. 1.12.3 Merits of regression:
It is used in statistics in all those fields where two or more relative variables are having the tendency to go back to the average.
It is used more than correlation analysis in many scientific studies. It is widely used in social sciences like economics, natural and physical sciences.
It predicts the value of dependent variables from the values of independent variables.
We can calculate co efficient of correlation ® and co efficient of determination (r ) with the help of regression co efficient.
Regression analysis in statistical estimation of demand curve, supply curves, production function, cost function, consumption function, etc., can be predicted.
2
1.12.4 Correlation and regression: The correlation coefficients is a measure of degree of co variability between two variables while the regression establishes a functional relationship between dependent and independent variables, so that the former can be predicted for a given value of the later. Correlation should proceed regression for if the relationship is not sufficiently strong there would appear to be no sound basis for prediction.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
1.12.5 Difference between correlation and regression: Correlation Correlation is the relationship between two or more variables, which are in sympathy with the other in the same or the opposite direction. Both the variables x and y are random variables. It finds out the degree of relationship between two variables and not the cause and effect of the variable.
Regression Regression means going bacl and it is mathematical measure showing the average relationship between two variables. Here x is a random variable and y is a fixed variable. Sometimes both the variables may be random variables. It indicates the cause and effect relationship between the variables and establishes a function relationship.
1.13.Miscellaneous sums: Sum(1): 2 Find the number of items, for the data r = 0.8 ; ∑xy = 60; σy = 2.5;∑x = 90. Solution:
r
xy
(xy ) 2
r2
n x y
(0.8) 2
n x y 2
2
and
2
x2 =
2
∑x /n = 90/n
60 2 3600 n(562.5) 90 n 2 (2.5) 2 n
3600 = (0.64)(562.5)n n = 3600 / (0.64)(562.5) Hence, n = 10. Sum(2) In a question on correlation, the value of r is (0.917) and its probable error is (0.034) what would be the value of n. Solution: We know that, 2
Probable Error = 0.6745 ( (1 – r ) / 2
0.034 = 0.6745 ( (1 – 0.917) / 2
2
n (0.034) = (0.6745) (1 – 0.917) 2
n)
n )
4
2
2
n = (0.1072) / (0.034) = (3.153) n = 9.94 (or) = 10 n = 10 Hence, there were 10 pairs of observations. Sum(3) Consider the data bxy = 0.85 ; byx = 0.89 and the SD of x = 6. Find the value of ‘r’ and σy. Solution : We know that,
r (0.85) (0.89) = 0.87 r = 0.87 bxy = r (σx / σy) σy = r σx / bxy = (0.87)(6) / (0.85) = 6.14 σy = 6.14
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
21
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
sum(4) From the following data, calculate line of regression of Y on X. Measure X Y Mean 40 60 SD 10 15 Correlation co efficient = 0.7
Solution: We know that, the regression line of y on x is
YY r
y X X x
Y – 60 = 0.7 (15 / 10)(X – 40) = (1.05)X – 42 Y = (1.05)X + 18. Sum(5) The co efficient of correlation between two variates x and y is 0.64. their co variance is 16. the variance of x is 9. Find the standard deviation of y series. Solution: Given: Cov(x , y) = ( ∑xy ) / n = 16 Var(x) = 9 σ x = 3 r = 0.64 we know that r = (∑xy) / ( n σx σy ) r = (∑xy / n) (1 / σx σy ) 0.64 = 16 ( 1 / 3 σy) σy = 16 / 1.92 = 8.333 Hence , the SD of y is 8.333 1.14. Problems: Calculation of correlation co efficient: Direct method: Sum(1) Calculate the correlation co efficient from data by direct method without taking the deviations of items from actual mean or assumed mean. X 9 8 7 6 5 4 3 2 1 Y 15 16 14 13 11 12 10 8 9 Ans: r = +0.95 Sum(2) Calculate the correlation co efficient from the following data X 100 200 300 400 500 600 700 Y 30 50 60 80 100 110 130 Ans: r = +0.997 Deviations are taken from actual mean Sum(3) The students got the following percentage of marks in economics and statistics Roll 1 2 3 4 5 6 7 8 9 10 Economics 78 36 98 25 75 82 90 62 65 39 Statistics 84 51 91 60 68 62 86 58 53 47 Calculate co efficient of correlation between the marks obtained in these subjects by the students. Ans: r = +0.78
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
22
COMPUTER ORIENTED NUMARICAL & STATIC METHODS Sum(4) Calculate the correlation co efficient between the height of father and son from the given data Height of father 64 65 66 67 68 69 70 In inches Height of son 66 67 65 68 70 68 72 In inches Ans: r = +0.810 Deviations are taken from assumed mean Sum(5) Find the correlation coefficients between the income and expenditure of a wage earner and comment on the result. Month Jan Feb Mar April May June july Income 46 54 56 56 58 60 62 Expentidure 36 40 44 54 42 58 54 Ans: r = +0.769 (dx = 56 , dy = 45) Sum(6) Find a suitable coefficient of correlation for the following data: X 15 18 20 24 30 35 40 50 Y 85 93 95 105 120 130 150 160 Ans: r = +0.991 (dx = X – 29 , dy = y – 119 ) Correlation of grouped bi – variate data Sum(7) A survey regarding the incomes and savings of 100 school teachers in a certain city provide the following data: Income(Rs)
400
Savings (Rs) 50
100
8
4
150
200
Total 12
600
12
24
6
42
800
9
7
2
18
1000
10
5
15
1200
9
4
13
50
17
100
Total
8
25
Calculate the coefficients of correlation between incomes and savings. Ans: r = +0.523 Sum(8) Compute the coefficient of correlation between dividends and price of securities as given below
Security Price (in Rs) 130 – 140 120 – 130 110 – 120 100 – 110 90 – 100 80 – 90 70 – 80
6–8
Annual Dividends (in Rs) 8 – 10 10 – 12 12 – 14
1 1 2 3 2
2 1 1
1 3 2 2 1 1
3 3 3 3 1
14 – 16
16 – 18
4 3 2 2
2 1
Ans: r = +0.755
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
23
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
24
Calculation of the rank correlation co efficient : Case(1) – when the ranks are given. Sum(9) Two ladies were asked to rank 7 different types of Lipsticks. The rank given by them are given below: Lipsticks A B C D E F G Leena
2
1
4
3
5
7
6
Reena
1
3
2
4
5
6
7
Calculate spearson’s Rank correlation coefficient.
Ans: = +0.786 Sum(10) Ten competitors in a beauty contest are ranked by 3 judges in the following order: 1 J1 6 5 10 3 2 4 9 7 8 3
J2
5
8
4
7
10
2
1
6
9
6
J3
4
9
8
1
2
3
10
5
7
Use rank correlation coefficient to discuss which pair of judges have the nearest approach to common testes in beauty. Ans: J12 = 0.212, J23 = 0.297, J13 = 0.636 ; Best J13. Case(2)  when the ranks are not given. Sum(11) Calculate spearson’s coefficient of correlation between marks assigned to ten students by judges X and Y in a certain competitive test as shown below: S.no
1
2
3
4
5
6
7
8
9
10
X
52
53
42
60
45
41
37
38
25
27
Y
65
68
43
38
77
48
35
30
25
50
Ans: = +0.539 Case(3) – when the ranks are equal or repeated ranks. Sum(12) From the marks obtained by 8 students in Tamil and English compute rank coefficient of correlation: Tamil
80
78
75
75
68
67
60
59
English
12
13
14
14
14
16
15
17
Ans:
= 0.929
Sum(13) The marks obtained by 8 students in C++ and Java are given below: Students
1
2
3
4
5
6
7
8
C++
70
48
58
55
54
50
60
52
Java
62
47
53
60
55
68
51
48
Find r and the rank correlation co efficients and compare them. Ans: r = +0.246 ,
= +0.286
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
25
Calculation of Regression equation : Sum(14) From the following data, obtain the two regression equations and calculate the correlation coefficient. X
1
2
3
4
5
6
7
8
9
Y
9
8
10
12
11
13
14
16
15
Ans: x = (0.95)y – 64, y = (0.95)x + 7.25 ; r = +0.95 Sum(15) From the following data, obtain the two regression equations the correlation. X
60
62
65
70
72
48
53
73
65
82
Y
68
60
62
80
85
40
52
62
60
81
Ans: x = (0.596)y + 26.26, y = (1.168)x – 0.92; r=0.834 calculation of Regression equations from Mean Sum(16) Obtain the lines of regression from the following data X
4
5
6
8
11
Y
12
10
8
7
5
Ans: x = (0.979)y + 15.024 , y = (0.929)x + 14.717 Sum(17): Find the regression equations from the following series X
35
25
29
31
27
24
33
36
Y
23
27
26
21
24
20
29
30
Ans: x = (0.532)y + 16.7 ,
y = (0.352)x + 14.44

FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
UNIT II THEORITICAL DISTRIBUTIONS UNIT STRUCTURE: 2.0 Introduction 2.1 Binomial distribution 2.1.1 Conditions 2.1.2 Characteristics 2.2 Fitting a Binomial distribution 2.3 Poisson distribution 2.3.1 Examples 2..3.2 characteristics 2.4 Fitting a Poisson distribution 2.5 Normal distribution 2.5.1 Normal probability curve 2.5.2 properties 2.5.3 standard form 2.6 Test of significance 2.6.1 Basic concepts 2.6.2 Hypothesis 2.6.3 Level of significance 2.6.4 Critical value 2.6.5 One tailed / two tailed tests 2.6.6 Steps for testing hypothesis 2.7 Large sample Tests 2.7.1 Test of significance for proportions 2.7.2 Test of significance for difference between two proportions 2.7.3 Test of significance for means 2.7.4 Test of significance for difference between means 2.8 Small samples tests 2.8.1 Introduction 2.8.2 t – statistics 2.8.3 Degrees of freedom 2.8.4 Test of significance for means 2.8.5 Test of significance for difference between two means 2.8.6 Related samples  Paired t – test 2.9 F test 2.10 Chi – square statistic 2.10.1 Introduction 2.10.2 Properties 2.10.3 Degrees of freedom 2.10.4 Conditions for applying Chi – square 2.10.5 Test of goodness of fit (binomial & Poisson) 2.10.6 Test of independence 2.10.7 Yates’s correction 2.11 Problems with answers
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
26
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 2.0 Introduction: The frequency distributions are of two types: 1. Observed Frequency Distribution and 2. Theoretical Frequency Distribution The distributions, which are based on actual data or experimentation, are called Observed Frequency Distribution. and the distributions based on expectations on the basis of past experience is known as Theoretical Frequency Distribution. Consider the series relating to height measurements or marks obtained by students. They are all obtained by observation or measurement of data. It is also possible to start on a certain assumption and deduce what the frequency of the certain population shall be. Such distributions which are not attained by actual observations but are deduced mathematically by certain assumptions are called theoretical distributions. For example, we toss a coin 200 times. We may get 80 heads and 120 tails; but our expectation is 100 heads and 100 tails, because the chance is 50% heads and 50% tails. On the basis of this expectation we can test whether a given coin is unbiased or not. The following are important distributions. Discrete probability distributions: 1. Binomial Distribution 2. Poisson Distribution Continuous probability distributions: 3. Normal Distributions 2.1 Binomial distribution: If p be the probability of success for an event and q=1p be the probability of its failure in a single trial, then the probability of exactly x successes and (nx) failures in a series of n independent trials is x nx P(x) = nCx p q n The terms in the expansion of (q+p) give respectively the probabilities of exactly 0,1,2,…..x,…,n successes. If we consider N sets of independent trials, then the number of times we get x successes is x nx N nCx p q . n It follows that the terms in the expansion of N(q+p) give the frequencies of the occurrence of 0,1,2,3,….x,….,n successes in the sets of n independent trials. The frequency distribution of these successes is called the Binomial distribution or Bernoulli distribution.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
27
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
NUMBER OF SUCCESSES
28
FREQUENCY
n
0
Nq
1
N nC1 p q
2 . .
NnC2 p q . .
x
NnCx p q .
2
x
n1
n2
nx
. . n Np
n
n
Total
N(q+p) = N
2.1.1 Conditions: The Binomial distribution can be used under the following conditions: Trials are repeated under identical conditions for a fixed number of times. There are only two mutually exclusive outcomes, namely, success or failure for each trial. For example, if a coin is tossed, the result of each throw can be either a head or tail. o The probability of success in each trial remains constant and does not change from trial to trial. For example, the probability of getting a head in successive throws of a coin is always 1/2. o The trials are independent, ie, the probability of an event in any trial is not affected by the results of any other trial. For example, in successive throws of a coin, the occurrence of head at any subsequent trial. o o
2.1.2 Characteristic of binomial distribution: o Binomial distribution is a discrete distribution in which the random variable X (the number of successes) assumes the values 0,1,2,….n where n is finite. o Mean = np, Variance = npq. Standard deviation (σ ) = Skewness =
pq npq
o
npq and
kurtosis =
1 6 pq where q = 1p npq
The mode of the binomial distribution is that value of the variable which occurs with the largest probability. It may have either one or two modes.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS o
o
29
If two independent random variables X and Y follow Binomial distribution with parameters (n1,p) and (n2,p)respectively, their sum (X+Y) also follows binomial distribution with parameters (n1 + n2,p). If n independent trials are repeated N times, N sets of n trials are obtained and x nx the expected frequency of successes is N. nC x p q The expected frequencies of 0,1,2,…n success are the successive terms of the n binomial expansion of N(q + p) .
Illustration: 20 wrist watches in a box of 100 are defective. If 10 watches are selected at random, find the probability that (i) 10 are defective (ii) 10 are good. (iii) at least one is defective (iv) at most 3 are defective. Solution: 20 out of 100 wrist watches are defective. p = P (a defective watch)
20 100 1 1 4 p ; q 1 p 1 5 5 5 =
10 watches are selected at random. Therefore n = 10 x
P(x defective watches) =
x
n
Cx p q
1 4 10 C x 5 5
n x
10 x
1010
10
1 4 (i) P ( 10 defective watches) = 10 C10 5 5 1 = 5 (ii) P( 10 good watches)
10
= P( No defective watch) 0
1 4 = 10 C 0 5 5
10 0
4 5
10
(iii) P (atleast one watch is defective) = 1 – P(No watch is defective ) 0
1 4 1  10 C0 5 5
10 0
4 1 5
10
(iv) P (atmost 3 watches are defective) = P (0 or 1 or 2 or 3 watches are defective) = P(0) + P(1) + P (2) + P (3) 0
1 4 10 C 0 5 5 2
10 0
1 10 C1 5
1 4 10 C 2 5 5
10 2
1
4 5
101
3
1 4 10 C3 5 5
103
=1(0.107)+10(0.026)+45(0.0062) +120(0.0016) approximately
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
30
= 0.859 approximately. 2.2 Fitting of binomial distribution: First determine either p or q. If one is known, the other can be found using the formula p = 1q or q= 1p. Then find the probabilities of 0,1,2,..,n successes by expanding the n binomial (q+p) . Multiply each term of the expanded binomial by N (the total frequency) in order to obtain the expected frequency in each category. Illustration: The screws produced by a certain machine were checked by examining samples of 12. The following table shows the distribution of 128 samples according to the number of defective items they contained. No. of defectives in a sample of 12
0
1
2
3
4
5
6 7
Total
Number of samples
7
6 19 35 30 23 7 1
128
Fit a binomial distribution and find the expected frequencies. Find the mean and variance of the fitted distribution. Solution: The probability of a defective screw is p = Therefore q = 1 p = 1
1 2
1 1 = 2 2
n = 12, N = 128
1 1 Therefore the fitted binomial distribution is 2 2
12
Computation of probabilities and frequencies: No. of defectives
x
Probabilities
1 1 p( x)12 C x 2 2 120
0
1 1 P(0)12 C0 2 2
1
1 1 P(1)12 C1 2 2
2
1 1 P(2)12 C 2 2 2
3
1 1 P(3)12 C3 2 2
4
1 1 P(4)12 C 4 2 2
5
1 1 P(5)12 C5 2 2
0
1
121
2
3
66 4096
220 4096
123
12 4
5
125
1 4096
12 4096
12 2
4
12 x
495 4096
792 4096
Expected frequencies
Observed frequencies
0.03125
7
0.375
6
0.0625
19
6.875
35
15.46875
30
24.75
23
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 6
6
1 1 P(6)12 C6 2 2
7
7
1 1 P(7)12 C7 2 2
126
127
1 1 P(8)12 C8 2 2
9
1 1 P(9)12 C9 2 2
10
1 1 P(10)12 C10 2 2
8
10
129
1210
1 1 P(11)12 C11 2 2
12
1 1 P(12)12 C12 2 2
11
12
Total
66 4096
1212
495 4096
220 4096
1211
11
924 4096
792 4096
128
8
9
12 4096
1 4096
1
31
28.875
7
24.75
1
15.4687
0
6.875
0
2.0625
0
0.375
0
0.03125
0
128.00
128
Note: If the parameter p is not given it is to be estimated from the given data. We know for binomial distribution
x = np x p= is the estimate of p. n
mean = Therefore
2.3 Poisson distribution: n In the binomial distribution (q+p) ,the probability of x successes is given by x nx p(x) = nCxp q If the number of trials n is very large and the probability of successes p is very small so that the product np always exists and is finite, say m, then the resulting distribution is called Poisson distribution. Since the number of trials is very large and the probability of success is very small, it is clear that the event is a rare one. Therefore Poisson distribution relates to rare events. Poisson distribution is a discrete probability distribution defined for all positive integers in which the probability of exactly x occurrences is given by
P( x)
e m m x , x!
for x 0,1,2,...
where , m is a positive constant called the parameter of the distribution. 2.3.1 Examples of poisson distribution: The number of deaths due to a particular disease in a day in a town. The number of blinds born in a town. Conditions: Poisson distribution may be fitted to a data set under the following conditions The number of trials n is indefinitely large, ie., n → ∞
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
The probability of success p for each trial is very small, ie., p → 0 np = m (finite)
Characteristics of Poisson distribution: The Poisson distribution possesses the following characteristics. Discrete distribution: Like binomial distribution Poisson distribution is also a discrete probability distribution where the random variable assumes a countably infinite number of values 0,1,2,… The values of p and q: It is applied in situations where the probability of success (p) of an event is very small and that of its failure (q) is very high almost equal to 1 and n is also very large. The parameter: The parameter of the Poisson distribution is the mean (m = np). If the value of m is known, all the probabilities of the Poisson distribution can be ascertained. Values of constants: Mean = m = Variance, so that standard deviation = m . Poisson distribution may have either one or two modes. Additive property: If X and Y are two Poisson variates with parameters m 1 and m2 respectively, then (X+Y) also follows Poisson distribution with parameter (m 1+m2). As an approximation to Binomial distribution: Poisson distribution can be viewed as a limiting form of Binomial distribution when n is very large and p is very small in such a way that their product np = m remains constant. Assumptions: The Poisson distribution is based on the following assumptions: (i) The occurrence or non occurrence of an event does not influence the occurrence or non occurrence of any other event. (ii) The probability of success for a short time interval or a small region of space is proportional to the length of the time interval or space as the case may be. (iii)The probability of the happening of more than one event in a very small interval is negligible. Illustration: If 2 percent of electric bulbs manufactured by a certain company are defective, find the probability that in a sample of 200 bulbs, (i) less than 2 bulbs are defective (ii) more than 3 bulbs are defective. solution: P = probability of a defective bulb =
2 100
= 0.02; n = 200. Since p is small and n is large, we use Poisson distribution. Mean m = np = 200 x 0.02 = 4 Probability of x number of bulbs being defective is
P ( x) (i)
e 4 4 x x!
Probability of less than 2 bulbs defective is P(x<2) = P(x=0) + P(x=1) 4
4
=e +e x4
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
32
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
33
4
= e (1 + 4) = 0.0183 x 5 = 0.0915 (ii)
Probability of more than 3 defective bulbs is P(x>3) = 1 – P(x ≤ 3) = 1 – [P(x=0) + p(x=1) + p(x=2) + p(x=3)] =
4 2 43 1 e 4 1 4 2! 3!
= 1 – 0.0183 ( 1 + 4 + 8 + 10.67) = 0.567 2.4 Fitting a Poisson distribution: To fit a Poisson distribution, the probabilities of 0,1,2,3,… successes are found out as indicated below: (i) First of all the arithmetic mean (m) of the data is calculated. m (ii) The value of e is calculated from calculator. (iii) By using the formula
P( x)
e m m x , x!
for x 0,1,2,...
Probabilities of 0,1,2,.. Successes will be obtained. Finally, the expected or theoretical frequencies are given by f(x) = N.P(x) where N is the total observed frequency.
(iv)
Illustration: The distribution of typing mistakes committed by a typist is given below. Assuming a Poisson model, find the expected frequencies. Mistakes per page No. of pages
0 142
Solution: Mean of the mistakes is
m
1 156
2 69
3 57
4 5
5 1
fx N 0 142 1 156 2 69 3 27 4 5 5 1 = 400 400 = 400
m =1 Given that the data set follows a Poisson distribution. Therefore Parameter of distribution is m = 1. Frequency of pages containing x mistakes is given by
e 11x x! e 1 = 400 x! 0.3679 f(x) = 400 x!
f(x) = N. P(x) = 400
(or)
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
34
COMPUTATION OF EXPECTED FREQUENCIES Number of Mistakes
Expected frequency f(x)= 400
0.3679 x!
0.3679 147.16 ≈ 147 0! 0.3679 400 = 147.16 ≈ 147 1! 0.3679 400 = 73.58 ≈ 74 2! 0.3679 400 = = 24.52 ≈ 25 3! 0.3679 400 = 6.13 ≈ 6 4! 0.3679 400 = 1.22 ≈ 1 5! 0.3679 400 = 0.0203 6!
0
400
1 2 3 4 5 6 . .
Observed frequency
142 156 69 27 5 1 0 . 0
. . 2.5 Normal distribution: n In the binomial distribution (q+p) , if p = q = ½ and n is infinitely large, then the distribution becomes symmetric about the mode. This symmetric distribution is called the normal distribution. Thus we find the normal distribution is the limiting case of the binomial distribution. It is defined by the probability distribution function
f ( x)
(x )2 exp 2 2 2 1
where x can take any value in the range (∞, +∞), μ is the mean, σ is the standard deviation, = 3.1428, e = 2.71828. 2.5.1 Normal probability curve: The curve representing the Normal distribution is called the Normal probability curve. The curve is symmetrical about the mean (μ),bellshaped and the two tails on the right and left extends to infinity. The shape of the curve is as follows:
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 2.5.2 Properties of normal distribution: 1. The normal curve is perfectly symmetrical about the mean (μ) and is bell shaped. 2. The mean and median coincide with the mode. 3. It has only one mode. (ie) unimodal. 4. The points of inflexion are at x= μ ± σ . 5. The first and the third quartiles are equidistant from the median. 6. Measure of skewness β1 = 0, and measure of kurtosis β2 = 3 7. The mean deviation about mean is 0.8σ. 8. Quartile deviation = 0.6745σ. 9. The curve is asymptotic to the base line, i.e., it continues to approach but never touches the base line. 2 10. If x and y are independent normal variates with means μ 1 and μ2 and variances σ1 2 and σ2 respectively, then (x+y) is also a normal variate with mean (μ 1 + μ2 ) and 2 2 variance (σ1 + σ2 ). 11. The maximum ordinate is at x= μ. Its value is
1 2
2.5.3 Standard form of normal distribution: A random variable x is called a standardized normal variable if its mean is 0 and standard deviation is 1.The normal distribution with mean 0 and standard deviation 1 is called normal distribution in standard form or standard form of normal distribution. Therefore probability function for the normal distribution in standard form is given by
z2 , exp 2 2 1
φ(z) =
(∞ < z < +∞) where z
x
Illustration: The customer accounts of a certain departmental store have an average balance of Rs.1200 and a standard deviation of Rs.400. Assuming that the account balances are normally distributed, (i) What percentage of the accounts is over Rs.1500 (ii) What percentage of the accounts is between Rs.1000 and Rs.1500 (iii) What percentage of the accounts is below Rs.1500? (Use area table of the normal curve). Solution: Let X represent the balance of the customer accounts, then X is normally distributed with mean μ = Rs.1200 and standard deviation σ = Rs.400. We have,
Z
x
x 1200 400 (i) When x = Rs.1500,
Z
1500 1200 400
= 0.75
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
35
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
P( X> 1500) = P( Z > 0.75) = Area to the right of Z = 0.75 = (Area to the right of z = 0) – (Area between z = 0 and z = 0.75) = 0.5000 0.2734 P( X> 1500) = 0.2266 Hence 22.66% of the accounts have a balance of over Rs.1500. (ii) when x = 1000,
Z1
1000 1200 0.50 400
when x = 1500,
Z1
1500 1200 0.75 400
P( 1000 < x < 1500) = P (  0.5 < z < 0.75) = P( 0.5 < z < 0 ) + P ( 0 ≤ z < 0.75)
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
36
COMPUTER ORIENTED NUMARICAL & STATIC METHODS =P( 0 < z < 0.5 ) + P ( 0 ≤ z < 0.75) = 0.1915+ 0.2734 = 0.4649 Hence 46.49% of the accounts have an average balance between Rs.1000 and Rs.1500 (iii) when x = 1500,
Z
1500 1200 400
Z = 0.75
P(X < 1500) = P( Z<0.75) = Area to the left of z = 0.75
P(X < 1500) = (Area between z = 0 and z = 0.75) + Area to the left of z= 0 = 0.2734 + 0.5000 = 0.7734 Hence 77.34% of the accounts is below Rs.1500. 2.6 Tests of significance: 2.6.1 Basic Concept Since it is not possible to study the entire population due to cost, time and other constraints, we take small samples from the population. These samples are analyzed and they lead to generalizations which are valid for entire population. (i) a quality control manager is to determine whether a process is working properly (ii) a drug chemist is to decide whether a new drug is really effective in cursing a disease (iii) a statistician is to decide whether a given coin is biased or not. The procedure that enables us to decide on the basis of sample results, if (i) the deviation between the observed sample statistic and the hypothetical parameter (ii) the deviation between two sample statistics is significant or is due to choice of sampling.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
37
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
38
Parameter and statistic: The statistical constants used to decide the populations such as mean, variance, skeweness, correlation, proportion etc.., are known as parameters. Statistical measures determined from the samples corresponding to the parameters such as mean, variance, skeweness, etc.., are called statistics. Parameters are functions of the population values while statistics are functions of the sample observations. In general, population parameters are unknown and sample statistics are used as their estimates. There are two types of test : (i) Large sampling test , when the sample is of size > 30. (ii) Small sampling test, when the sample is of size < 30. As the distributions like Binomial, Poisson, F, t, Chisquare can be approximated closely by a normal distribution, for large sample test, we use normal distribution. Some of the well known tests of significance for studying differences between two means, standard deviations etc for small samples (n< 30) are ttest, Ftest. 2.6.2 Hypothesis: Types of Hypothesis: Null Hypothesis and Alternative Hypothesis: The approach to hypothesis testing is not to construct a single hypothesis about the population parameters, but rather to set up two different hypotheses namely Null Hypothesis and Alternative Hypothesis, these hypotheses must be so constructed that if one hypothesis is accepted, the other is rejected. Null Hypothesis: Null hypothesis is the hypothesis which is tested for possible rejection under the assumption that it is true and is denoted as Ho Null hypothesis is the hypothesis of no difference. Alternative Hypothesis: It is the statement about the population which gives an alternative to the null hypothesis and is denoted by H1. For example, if we have to test whether the population mean has a specified value μ0 then (1) the null hypothesis is H0: μ = μ0 (2) the alternative hypothesis may be (i) H1 : μ ≠ μ0 ( μ > μ0 or μ < μ0 ) (or) (ii) H1 : μ > μ0 (or) (iii) H1 : μ < μ0 The alternative hypothesis in (i) is known as two tailed alternative and the alternative hypothesis in (ii) and (iii) are known as right tailed and left tailed alternatives respectively. Sampling Error: In any test of hypothesis there are two types of errors we might commit. Rejection of the null hypothesis(H0) when it should be accepted is known as type I error. Acceptance of the null hypothesis(H0) when it should be rejected is known as type II error. In either case a wrong decision or error in judgment has occurred. Situations that may arise in any test procedure: True situation H0 is true
Decision Accept H0 Correct decision
Reject H0 Type I error Probability = α
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
H0 is false
Type II error Probability = β
39
Correct decision
Critical region: A region in the sample space which amounts to rejection of H 0 is known as Critical region or region of rejection and the complement of this rejection is called the acceptance region. 2.6.3 Level Of Significance: In testing a given hypothesis, the maximum probability with which we would be willing to risk is called level of significance of the test. That is the probability of typeI error is called the level of significance . The levels of significance usually employed in testing of significance are 0.05 (or 5%) and 0.01(or 1%).If for example 0.05 or 5% level of significance is chosen in deriving a test of hypothesis, then there are about 5 chances in 100 that we would reject the hypothesis when it should be accepted. (ie) we are about 95% confident that we have made the right decision. In such a case we say that the hypothesis has been rejected at 5% level of significance which means that we are wrong with probability 0.05. Standard Error: The standard deviation of the sampling distribution of a statistic is known as the Standard Error. For example Statistic Standard Error
X
S
2
2
S P
n
2n 2n
PQ n
2.6.4 Critical Value: The value of the test statistic which separates the sample space into rejection region and the acceptance region is called the critical value. It depends upon, both (i) the level of significance chosen and (ii) the alternative hypothesis for large samples the standard normal variate corresponding to the statistic is Z =
t E(t) ~ N(0,1) S.E (t)
The value of Z under the null hypothesis is known as test statistic. The critical value of the test statistic at level of significance α for a two tailed test is denoted by z α /2 and for a one tailed test by z α 2.6.5 One Tailed and Two Tailed Tests: In any test, the critical region is represented by the area under the probability curve of the sampling distribution of the test statistic. A test of any statistical hypothesis where the alternate hypothesis is one tailed (right or left tailed) is called a one tailed test. For example, a test for testing the mean population H0: μ = μ0 against the alternative hypothesis H1 : μ > μ0 (right tailed) or H1 : μ < μ0 (left tailed)
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS is a single tailed test. In the right tailed test H1 : μ > μ0 the critical region lies entirely in the right tail of the sampling distribution of x While for the left tailed test H1 : μ < μ0
Right tail ed test (level of significan ce )
The critical region is entirely in the left tail of distribution of
x
Left tailed test (level of significan ce )
The testing of a null hypothesis. H0: μ = μ0 against the alternative hypothesis H1 : μ ≠ μ 0 is known as two tailed test and in such a case the critical region is given by the portion of the area lying in both the tails of the probability curve of the test statistic.
Two tailed test (level of significan ce )
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
40
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
For example, suppose that there are two population brands of bulbs. one manufactured by the standard process (with mean life μ1 ) and the other manufactured by some new technique(with mean life μ2 ).If we want to test if the average life of the bulbs differ significantly, then our null hypothesis is H0 : μ1 = μ2 and alternative will be H1 : μ1 ≠ μ2 thus giving us a two tailed test. However if we want to test if the bulbs produced by new process have higher average life than those produced by standard process, then we have H0 : μ1 = μ2 and H1 : μ 1 < μ 2 thus giving us a left tailed test. Similarly for testing if the product of new process is inferior to that of standard process, then we have H0 : μ1 = μ2 and H1 : μ1 > μ2, thus giving us a right tailed test. Thus the decision about applying a two tailed or one tailed test depends upon the problem under study. Level of significance Critical value for one tailed tests
of
Critical value of for two tailed tests
Z
Zα
α
/2
0.05 or 5%
0.01 or 1%
1.645 or 1.645
2.33 or 2.33
1.96 or 1.96
2.58 or 2.58
2.6.6 Steps for testing hypothesis: 1. Set up the Null hypothesis: H0 2. Set up the alternate hypothesis H1 which is complementary to H0. The nature of H1 will indicate whether one tailed or two tailed test is to be applied. 3. choose an appropriate level of significance ( α ) 4. calculate the value of the statistic Z, under the null hypothesis by using the formula
Z
t E (t ) S .E (t )
where t is the sample statistic.
5. Compare the computed value of the test statistic with the critical value Z α /2 ( or Z α ) at the given level of significance α, (table value). If calculated value is greater than the table value, we reject the null hypothesis H0 at α % level of significance and If calculated value is less than or equal to the table value, we accept H0 at α % level of significance.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
41
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 2.7 Large Samples Tests: The tests for following cases are discussed here: Test of significance for proportion Test of significance for difference between proportions Test of significance for mean Test of significance for difference between two means 2.7.1Test of Significance for Proportion: Let X be the number of successes in n independent trials with constant probability p of success in each trial. We have p =
X is the sample n
proportion of success. It is known that
X 1 1 )= E(X) = ( nP) = P n n n X 1 1 1 Var (P) = V( ) = 2 Var ( X) = 2 nPQ = PQ n n n n PQ Therefore S.E (p) = n X X being a binomial variate is normal for large n and so is also n E (p) = E (
asymptotically normally distributed. Let the hypothesis of interest be H0 : P = P0 alternative hypothesis
against the
H1 : P ≠ P0 and
the level of significance be α. Under the null hypothesis the test statistic used Z=
pP PQ n
~
N(0,1)
For the preassigned level of significance, we refer to normal area table and identify the critical value, say Z α /2 . If the computed value of
Z ≤ Z
α/2
we accept the null hypothesis and
conclude that the sample is drawn from a population with proportion of success P 0 . On the other hand if
Z > Z
α/2
we take a decision in favour of alternative
hypothesis and conclude that the sample might have come from a population whose proportion of success is different from P0 . Note: If the alternative hypothesis is of one sided, then the critical value is determined at Z α and a decision is taken accordingly. Illustration  1: In a sample of 500 people in Madurai, 280 are tea drinkers and the rest coffee drinkers. Can you assume that both tea and coffee are equally popular in Madurai at 1% level of significance? Solution: Given that, n = 500 Number of tea drinkers = 280
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
42
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
Therefore p = Sample proportion of tea drinkers =
280 = 0.56 500
1. Null hypothesis H0 : both tea and coffee are equally popular in madurai P = Population proportion of tea drinkers in Madurai = 0.5 Alternative hypothesis H1 : P ≠ 0.5 (two tailed alternative) 2. Test statistic: under H0 , the test statistic is
P E ( P) p P S .E.( P) PQ n
Z=
=
is N(0,1)
0.56 0.50 0.5 0.5 500
= 2.68
Z = 2.68 3. conclusion: The critical value at 1% level of significance for two tailed test is 2.58. Since the computed Z ( 2.68) is greater than the critical value (2.58), it falls in the rejection. Hence the null hypothesis is rejected and we conclude that tea and coffee are not equally popular in Madurai. Illustration  2: (Small samples) Twenty people were attacked by a disease and only 18 survived. Will you reject the hypothesis that the survival rate, if attacked by this disease is 85% in favour of the hypothesis that it is more at 5% level of significance? Solution In the usual notation we have n = 20. Number of persons survived after attack by the disease: x = 18 P = proportion of persons survived in the sample
x n 18 = 20 =
P = 0.90 1. Null hypothesis H 0 : P = 0.85 (i.e) the proportion of persons survived after attack by the disease is 85% Alternative hypothesis H1 : P > 0.85 (right tailed alternative) 2. Test statistic: under H0 the test statistic is Z=
=
pP
is N(0,1)
PQ n 0.90 0.85 0.85 0.15 20
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
43
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
44
=  0.626
Z = 0.626 3. conclusion: The critical value of Z at 5% level of significance for right – tail test is 1.645. Since the computed value of Z (0.626) is less than the critical value 1.645, we accept the null hypothesis at 5% level of significance and conclude that the proportion of persons survived after attack by a disease is 0.85. 2.7.2 Test Of Significance For Difference Between Proportions: Let p1 and p2 be the two sample proportions obtained in large samples of sizes n1 and n2 drawn from respective populations having proportions P1 and P2 respectively. Consider the null hypothesis that there is no difference between the population proportions (H 0 : P1 = P2 ) indicating that the samples are really drawn from the same population. Let the alternative hypothesis be H1 : P1 ≠ P2 with a chosen level of significance α.
S,E.(P1P2) =
1 1 pq where p is obtained by n1 n2
n1 p1 n2 p 2 n1 n2
p
Under H0 , the test statistic for the difference of proportion is
p1 p 2
Z =
1 1 pq n1 n2
is N (0,1)
By referring to the area table of the normal distribution, we determine the critical value Z for the preassigned level of significance α. If
α /2
Z ≤ Z α /2 , we accept H0.
Otherwise if we take a decision in favour of the alternative hypothesis and conclude that the difference between the proportions cannot be due to sampling fluctuations. We may have reasons to relieve that the samples are drawn from the populations whose proportions differ significantly. 2.10.3 Test of Significance for Mean:
x be the mean of a sample size of n from a population with mean 2 μ and variance σ . The sample mean x will have approximately normal distribution with mean μ and Standard deviation σ/ n . Let
Let the hypothesis of interest be H 0 : μ = μ0 against the alternative hypothesis H 1 : μ ≠ μ0 and the level of significance be α. Under the null hypothesis the test statistic to test that the population has the specified mean value (i.e) μ = μ0 is Z=
x
is N(0,1)
n For the preassigned level of significance, we refer to normal area table and identify the critical value, say Z
α /2
.If the computed value of
Z ≤Z
α /2
We accept the null
hypothesis and conclude that the sample is drawn from a population with mean μ 0 . On the other hand,
Z > Z α /2 we take a decision in favour of alternative hypothesis.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS We conclude that the simple might have come from a population whose mean value is different from μ0 . Illustration: A company producing light bulbs finds that mean life span of the population of bulbs is 1200 hours with a Standard deviation of 125 hours. A simple of 100 bulbs produced in a lot is found to have a mean life span of 1150 hours. Test whether the difference between the population and sample means is statistically significant at 5% level of significance. Solution: Given that n = 100
μ = 1200 hours σ = 125 hours
x = 1150 hours
Null hypothesis H0 : μ = 1200 hours The life span of the population of bulbs has normal distribution with mean 1200 hours. Alternative Hypothesis: H1 : μ ≠ 1200 hours Test Statistic: Under H0 , the test statistic is Z=
x
is N(0,1)
n 1150 1200 = 12.5
Z = 4 Conclusion: At 5% level of significance, by referring to the area table of the normal distribution, the critical value is seen as 1.96. Since the computed value of Z is greater than the critical value 1.96, we reject the null hypothesis and conclude that the difference between the population and the simple means is statistically significant.
2.7.4 Test of Significance for Difference between Two Means: Let
x1 be the sample mean of sample size n1 from a population with mean μ1 and 2
variance σ1 and let x 2 be the mean of an independent simple of size n2 from another 2 population with mean μ2 and variance σ2 . It is known that
x1 is N ( μ1 ,
x 2 is N (μ2 ,
12 n1
22
)
)
n2
and the difference between means (x1  x2 ) is N (μ1  μ2 ,
12 2 2 + n1 n 2
)
Let the null hypothesis be that the population means are equal. (ie) H0 = μ1 = μ2 and the alternative hypothesis is H1 = μ1 ≠ μ2 (μ1 < μ2 ; μ1 > μ2 ) The test statistic to test the quality of two population means is given by:
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
45
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
x1 x 2
Z=
12 n1
22 n2
Note: 2
=σ
46
2
If the samples are drawn from the populations with common variate, ie; σ1 , then under H0 ,
= σ2
2
x1 x 2
Z=
12 n1
22 n2
By referring to the area table of Normal distribution, we determine the critical value as Z α /2 for the preassigned level of significance α. If
Z ≤ Z α /2 , we accept H0 Otherwise If
.
Z > Z α/2, we take a decision in favour of alternative hypothesis and conclude
that the difference between means cannot be assigned to sampling fluctuations. We may have reasons to believe that the samples are drawn from populations whose means differ significantly. Illustration: The means of two large samples of 1000 and 2000 items are 67.5 cms and 68.0 cms respectively. Can the samples be regarded as drawn from the same population with standard deviation 2.5 cms. Test at 5% level of significance. Solution: Given that n1 = 1000, n2 = 1000,
x1 = 67.5 cms
x 2 = 68.0 cms
σ = 2.5 cms Null hypothesis: H 0 = μ1 = μ2 i.e.; the samples have been drawn from the same population. Alternative hypothesis: H1 = μ 1 = μ 2 Test statistic: Under H0 , the test statistic is
x1 x2
Z=
is N (0, 1)
1 1 n1 n2 67.5 68
=
2.5
1 1 1000 2000
= 5.1
Z
= 5.1
At 5% level of significance for a two tailed test by referring to the area table of the normal distribution the critical value is 1.96 Conclusion: It is observed that
Z = 5.1>1.96. Hence we reject the null hypothesis 5%
level of significance and conclude that the samples have not come from the same population.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 2.8. Small Sample Tests: 2.8.1 Introduction: When the size of the sample is small (less than 30), the tests relating to large samples cannot be used because of the assumptions they are based on. In particular it will no longer be possible for us to assume (a) that the sampling distribution of a statistic is approximately normal (b) that the values given by the sample data are sufficiently close to the population values and can be used in their place for the calculation of the standard error estimate. The pioneering work in the development of exact sampling theory was done by William S. Gosset (1905) who wrote under the pen name ‘Student’ and later on developed and extended by Prof. R.A.Fisher (1926). 2.8.2 ‘t’ – Statistics: Definition: Let Xi ( i =1….n) be a random sample of size n from a normal population with mean μ 2 and variance σ . Then the Student’s – t defined by the statistic t
x
=
s
n 1
x S
n
follows Student’s t – distribution with (n1) degrees of freedom. Where
x1 = Sample mean μ = Population mean S = Standard deviation of the sample n = Number of observations in the sample.
1 2 ∑(x– x ) n 1 1 2 2 s = ∑(x–x) n S
2
=
Assumptions for Student’s t – test: 1. The parent population from which the sample is drawn is normal. 2. The sample observations are random and independent. 3. The population standard deviation σ is not known. Properties of t distribution: The following properties about the t – distribution are worth noting: 1. t distribution ranges from  ∞ to +∞ just as does a normal distribution. 2. Like the normal distribution, t distribution is symmetrical. 3. t distribution has a greater dispersion than the standard normal distribution. 4. As the sample size approaches 30, the t distribution approaches the normal distribution. 2.8.3 Degrees Of Freedom: (d.f) The table values for ‘t’ are given for various significance level over a range of degrees of freedom. For the Student’s – ‘t’ distribution, the number of degrees of freedom is the sample size minus one i.e, (n – 1). It is denoted by symbolically ν = (n – 1). Application of the t distribution: The discovery of ‘t’ distribution is regarded as a land mark in the history of statistical inference as it has a number of applications. Some of which are enumerated below: Test of significance for mean Test of significance for difference between two means Related samples paired t – test, correlation.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
47
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
48
2.8.4 Test of significance for mean: The following steps are taken in testing the significance of a sample mean. 1. Null hypothesis H0 : Let us assume that there is no significant difference between the sample mean x and population mean μ i.e., the difference is just due to fluctuations of sampling. 2. Level of significance: The level of significance which indicates whether the probability of difference (of means) is small or large is generally fixed at 5%(α=0.5). Other levels of significance used are 1% , 10% etc.
3.Computation of test statistic: Under H0 the test statistic is t
x
=
s Where
x μ S n
n 1
x S
≈ tn1
n
= Sample mean = Population mean = Sample Standard deviation = Sample size
4. Critical value: Tabulated or critical value of t for (n1) d.f at α level of significance is tα (n1) which is obtained from the ttable. 5.Conclusion: If the calculated value of t (
t ) is less than the table value of t, it falls in the
acceptance region and the null hypothesis is accepted, and if the calculated value of t (
t ) is
greater than the table value of t, the null hypothesis H 0 may be rejected at the given level of significance. Illustration: Ten flower stems are chosen at random from a population and their heights are found to be (in cms). 63, 63, 66, 67, 68, 69, 70, 70, 71, and 71. Discuss whether the mean height of the population is 66 cms. Solution: 1. Null hypothesis: let us assume that the mean height of the population is 66 cms. H 0 : μ = 66 Alternative hypothesis H1 : μ ≠ 66 2. Under H0 the test statistic is given by t
x s
n 1
≈ tn1
Since the values of x are given we have to find the mean and the standard deviation. After computing these values we have to substitute the values in ‘t’.
Calculation of mean
x and standard deviation (s): 2
X
d = x  67
d
63
4
16
63
4
16
66
1
1
67
0
0
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
49
68
1
1
69
2
4
70
3
9
70
3
9
71
4
16
71
4
∑x = 678
16 2
∑d= 8
Mean
∑ d = 88
x 678 n 10
=
=67.8 Standard deviation:
d 2 d , n n 2
s
=
where d = x  67
2
=
88 8 10 10
=
8.8 0.8 2
=
2.856
Substituting the values in t
x , we get s n 1
t
=
67.8  66 2.856 10  1
=
1.8 = 1.891 2.856 3
Hence t = 1.891 3. Degrees of freedom: ν = (n – 1) Therefore ν = (10 – 1) = 9 4. Level of significance: At 5% level of significance ( α = 0.05) the table value for 9 d.f is 2.262. 5.Conclusion: The calculated value t = 1.891 is less than the table value t = 2.262, the null hypothesis H0 is accepted and it may be concluded that the mean height of the population is 66 cms at 5% level of significance. 2.8.5 Test of Significance for Difference between Two Means: Independent samples: The samples are from different sources and it is required to know whether there is significant difference between the means, i.e., whether difference is due to chance or whether the samples belong to different population. To test such hypothesis, the distribution of difference between sample means is used. The following are the notations used in the investigation.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS Population I Population mean Population s.d.
50
Population II
μ1
μ2
σ1
σ2
Sample I
Sample II
Sample mean
x1
x2
Sample s.d
S1
S2
Sample size
n1
n2
The following steps should be taken in testing the significance of difference between two means in case of small independent samples. 1. Null Hypothesis: There is no significant difference between two sample means or the two population means do not differ significantly H0 : μ 1 = μ 2 Alternative hypothesis: H1 = μ1 ≠ μ2 2. Computation of test statistic: Under the null hypothesis H0 and under the assumption that population variances 2 2 2 are equal (i.e., σ1 = σ2 = σ ), the test statistic for H0 is
t
x1 x 2 1 1 s n1 n2
~ t n1 n2 2
follows t –distribution with (n1 + n2  2) degrees of freedom. where s
2
1 ( x1 x1 ) 2 ( x2 x2 ) 2 n1 n2 2 1 2 2 = n1 s1 n2 s 2 n1 n2 2
=
2
is an unbiased estimate of population variance σ
.
3. Conclusion: By comparing the calculated value of ‘t’ with the table value of t for ( n1 n2 2 ) d.f. at the desired level of significance, usually 5% or 1% , we reject or retain the null hypothesis. Illustration: The average number of articles produced by two machines per day is 200 and 250 with standard deviations 20 and 25 respectively on the basis of records of 25 days production. Can you conclude that both the machines are equally efficient at 1% level of significance? Solution: In the usual notation, n1 = n2 = 25 x1 = 200 s1 = 20 s2 = 25
x 2 = 250
1. Null hypothesis : Both the machines are equally efficient i.e., H0 : μ 1 = μ 2 Alternative hypothesis: H 1 : μ1 ≠ μ2
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
2. Computation of test statistic: Under H0
t
where s
therefore,
2
x1 x 2 1 1 s n1 n2
~ t n1 n2 2
1 2 2 n1 s1 n2 s 2 n1 n2 2 25 400 25 625 = 25 25 2 25625 = 533.85 48
=
t
200 250
50
1 1 533.85 0.85 25 25 50 50 = 7.65 42.705 6.535 t = 7.65 533.85
3. Level of significance α = 0.01 At 1% level of significance , the critical value of t for (25 + 25 – 2) d.f is 2.58 ( when d.f exceeds 30, t distribution approaches normal distribution) 4. Conclusion: Since the calculated value of
t = 7.65 is greater than the table value of t
= 2.58 the null hypothesis is rejected and it may be concluded that both the machines are not equally efficient at 1% level of significance. 2.8.6 Related samples – paired t – test: In the t test for difference of means , the two samples were independent of each other. Let us now consider the case where (i) two sample observations (x1, x2,…,xn ) and (y1, y2,…,yn ) are completely independent but they are dependent in pairs. (ii) the sample sizes are equal, i.e., n1 = n2 = n (say) That is we are making two observations one before treatment and another after the treatment on the same individual. Suppose a business concern wants to find if a particular media of promoting sales of a product say door to door canvassing or advertisement in papers or through T.V is really effective. The testing of such claims gives rise to situations (i) and (ii) above. In this case we apply paired – t –test. Paired t –test: Let di = ( xi – yi ) denote the difference in the observations for the ith unit, i= 1,2,…,n 1. Null hypothesis H0 : Under the null hypothesis H0 , the increments are just by chance: H0 : μ 1 = μ 2 Alternative hypothesis: H1 : μ 1 ≠ μ 2
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
51
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
52
2. Computation of test statistic: Under H0 , the test statistic is
d
t =
≈ t(n –1)
s n
n
d d=
Where
s
s
2
2
i 1
i
n 1 n = (d i d ) 2 n 1 i 1
=
1 2 (d )2 d n 1 n
3. Conclusion: By comparing the calculated value ‘t’ with the critical value of t (n1) at the desired level of significance, usually 5% or 1% we reject or accept the null hypothesis. Illustration: A certain stimulus administrated to each of 12 patients resulted in the following change in blood pressure: 5 2 8 1 3 0 2 1 5 0 4 6 can it be concluded that the stimulus will in general be accompanied by an increase in blood pressure? In this case we are given the increment d = y – x in the blood pressure readings of 12 patients. 1. Null hypothesis: Let us assume that there is no significance difference in blood pressure readings of the patient before and after the drug. In other words, the given increments are just by chance(fluctuations of sampling) and not due to the stimulus H 0 : μ 1 = μ2 Alternative hypothesis: H1: μ1 < μ2 ie the stimulus result in an increase in blood pressure. Computation of mean and S.d of difference Total d
5
2
d
d =
s
2
=
=
=
2
8
1
25 4
64
1
d n
=
3 9
0 0
2
1
5
0
4
6
31
4
1
25
0
16
36
185
31 = 2.583 12
1 ( d d ) 2 n 1 1 2 (d ) 2 d n 1 n 312 1 185 11 12
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
s
185 80.1 11
s
9.54 = 3.09
=
2. Computation of Test statistic: Under H0 , the test statistic is t =
d
≈ t(n –1)
s n
=
2.583 12 2.89 3.09
The critical value of t for 11 d.f. at 5% level of significance is t = 2.201 3. Conclusion: Since computed value of t = 2.89 is greater than critical value of t= 2.201, it falls in the rejection region. Hence the null hypothesis is rejected and it may be concluded that the stimulus will in general be accompanied by an increase in blood pressure. 2.9 ‘F’ Statistic: The ‘F’ statistic is to test whether the two independent estimates of population variance differ significantly or whether the two samples may be regarded as drawn from two normal populations having the same variance. Testing the ratio of variances: Given two independent random sample of sizes n 1 and n2 drawn from two normal populations with unknown means. We may be required to test whether the population variances are the same. In other words, the null hypothesis is that the two independent estimates of the two population variances do not differ significantly. 2 2 2 The unbiased estimates S1 and S2 of the population variances σ1 and 2 σ 2 respectively are obtained from the samples as follows.
S1
2
S2
2
1 n1 x1 x1 n1 1 i 1
1 n2 x2 x2 n2 1 i 1
2
2
ns 1 1 n1 1
2
2
n2 s 2 n2 1
where s1 and s2 are standard deviations of the samples. Under H0 the test statistic is
F
Or
S1
2 2
,
S1 S 2 2
2
S2 Larger estimate of variance F , Smaller estimate of variance
follows F distribution with ν1 = n1 1 and ν2 = n2 1 degrees of freedom. ν1 = degrees of freedom for samples having larger variance. ν2 = degrees of freedom for samples having smaller variance. The value of F at 5% or 1% level of significance for degrees of freedom ν 1 and ν2 is referred to the F table and compared with calculated value of F. If the calculated value of F is greater than the table value F 0.05 (for degrees of freedom ν1 and ν2) then the ratio is considered significant at 5% level. i.e. H0 is rejected
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
53
COMPUTER ORIENTED NUMARICAL & STATIC METHODS If the calculated value is less than the table value F 0.05 then the ratio is not significant. i.e. both the samples are taken from the populations having same variance. i.e. H0 is accepted. Note: Since F is based on the ratio of two variances it is also known as Variance ratio test. Illustration: In a sample of 8 observations, the sum of squared deviations of items from the mean was 94.5. In another sample of 10 observations, the value was found to be 101.7. Test whether the difference in the variances is significant at 5% level. Solution: 1. Null hypothesis H0 : let us assume that the difference in the variances is not significant. 2 2 i.e., H0: σ1 = σ 2 Alternative hypothesis: H1: 2
H1: σ1 ≠ σ 2 2
2. Calculation of S1 and S2 Given that
x1 x1
n1 = 8;
2 S1
2 S2
2
x1 x1 = n1 1
x2 x2 = n2 1
3. Test statistic: Since S1
2
= 94.5
x2 x2
n2 = 10;
2
2
2
2
2
= 101.7
94.5 13.5 8 1
101.7 11.3 10 1
2
> S2
Under H0 , the test statistic is
F F
S1
2
S2
2
13.5 11.3
F = 1.195 4. Level of significance: α = 0.05 At 5% level of significance, table value of F for 7 and 9 degrees of freedom is 3.29 5. Conclusion: Since the calculated value of F is less than the table value of F at 5% level of significance, the null hypothesis H0 is accepted. i.e., the difference between the variances of the two populations is not significant. 2.10 Chi – Square Statistic: 2.10.1 Introduction: There are many situations in which it is not possible to make rigid assumption about the form of the parent distribution from which the samples have been drawn. This limitation has led to the development of a group of alternative techniques known as Non – parametric tests or distribution free tests. A non – parametric test may be defined as a statistical test in which no hypothesis is made about specific values of the parameter. Chi – square statistic:
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
54
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
55
It is one of the most widely used statistical test denoted by the Greek letter Karl pearson in 1900.
2
by
The quantity describes the magnitude of discrepancy between the actual frequencies and the theoretical frequencies in a sample. 2
The computation of involves the following steps: 1. Indicate the null hypothesis and the alternate hypothesis. 2. List the observed frequencies resulting from a given investigation. 3. Calculate the expected frequencies under the null hypothesis. 4. Take the difference between observed and expected frequencies and obtain the squares of the differences, 2 i.e., obtain the values of (Oi  Ei) 2 5. Divide the quantity (Oi  Ei) obtained in the previous step by the expected frequency for 2
each class or group in the series and obtain the total
6. Find out the
2
value from the
2
Oi Ei 2 Ei
table. As in case of t distribution table the
2
table
comprises of columns headed with symbols 0.05 for 5% level of significance and 0.01 for 1% level while the rows refer to the number of degrees of freedom. It may be noted from the table that the chi – square value increases with the increase in the degrees of freedom. 2
2
7. Calculated value of is compared with the table value of for a given degrees of freedom at a certain level of significance. If at the given level (generally 5%) the calculated 2
value of
2
2
is more than the table value of
2
the difference between theory and
observation is considered to be significant. If on the other hand, the calculated value of is less than the table value, the difference between the theory and observation is considered to be not significant. 2
Chi – square distribution: The square of a standard normal variate is called a chi – square variate with 1 degree of freedom. i.e., If X is normally distributed with mean μ and standard deviation σ then ((X  μ)/σ)
2
is a chi – square variate with 1 d.f. The distribution of
the d.f. There is a different
2
2
depends upon
distribution for each number of degrees of freedom.
2.10.2 Properties of chi – square distribution: 1. The mean of the
2
2. The variance of the 3. The median of being 0.5. 4. The mode of
2
distribution is equal to the number of degrees of freedom. (ν) 2
distribution is equal to the twice the degrees of freedom. (2ν)
distribution divides the area of the curve into two equal parts, each part
2 is equal to the degrees of freedom less 2. i.e. (ν – 2)
5. Since chi – square values are always positive, the chi – square curve is always positively skewed. 6. Since chi – square value increase with the increase in the degree of freedom, there is a new chi – square distribution with every increase in the number of degrees of freedom. 7. The lowest value of chi – square is zero and the highest value is infinity. (
2
≥0)
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 8. When the two chi – squares
1 2
and
22
are independent following
with ν1 and ν 2degrees of freedom , their sum with (ν1 + ν2) degrees of freedom. When
ν (d.f) > 30, the distribution
mean of the distribution
2 2 is
1
2
+ 2
2
will also follow
56
2 2
distribution distribution
2 2 approximately follows normal distribution. The
2v 1 and the standard deviation is 1.
2.10.3 Degrees of freedom: The degrees of freedom play a very important role in test. The term degrees of freedom represent the number of independent constraints in the set of data. 2
We shall illustrate this concept by an example: Suppose there is a 2x2 contingency table and the actual frequencies of the various classes are as follows:
B β Total
A
α
(AB)
(αB)
18
42
(A β)
(α Β)
12
28
30
70
Total 60
40 100
Let us assume that the two attributes A and B are independent then the expected frequency of
the
class
(AB)
would
be
(A). (B) 30 60 18 N 100
Once we decide the expected value of the class (AB), the expected frequencies of the remaining three classes are automatically fixed. It means that there is one independent constraint and 3 dependent constraints. In such tables the degrees of freedom are calculated by the formula = (r – 1) ( c 1) where stands for d.f, r for the number of rows and c for the number of columns. Thus in a 3x3 table the d.f. are (31)(31) = 4 and in 3x4 table the d.f. are (31)(41) = 6. In case of data that are given in the form of series of variables in a row or column the d.f. will be the number of categories in a series less one. i.e. ν = k – 1. For e.g. if categories are given in a series of 10 rows or columns, the d.f. will be 10 – 1 = 9. 2.10.4 Conditions for applying test: The number of observations must be reasonably large. No theoretical cell frequency should be less than 5. If it is less than 5 , the frequencies should be pooled together in order to make it 5 or more than 5. Each of the observations which makes up the sample for this test must be independent of each other. This test wholly depends on the degrees of freedom. 2.10.5 Testing goodness of fit: Karl Pearson developed a test known as test of goodness of fit and is used to test if the deviation between observed and theoretical values can be attributed to chance or it is really due to the inadequacy of the theory to fit the observed data.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS If Oi (i = 1,2,..k) is a set of observed frequencies and E i (i = 1,2,..k) is the corresponding set of expected frequencies then the Karl Pearson’s chi – square is given by k
Oi Ei 2
i 1
Ei
2
O1 E1 2 O2 E2 2
=
E1
=
E2
.....
Ok Ek 2 Ek
2 (k 1)
If the calculated value of is less than the table value at a certain level of significance the fit is considered to be good. On the other hand if the calculated value is greater than the table value the fit is considered to be poor. The term ‘goodness of fit’ is also used for comparison between observed sample distribution with expected probability distribution such as Binomial, Poisson, Normal etc. 2
2.10.5.1 Testing the goodness of fit: Binomial distribution: Illustration: A survey of 320 families with 5 children each revealed the following distribution. No. of boys 5 4 3 2 1 0 No. of girls 0 1 2 3 4 5 No. of Families 14 56 110 88 40 12 Is the result consistent with the hypothesis that the male and female births are equally probable? Solution: Let us set up the null hypothesis that the data are consistent with the hypothesis of equal probability for male and female births. Then under the null hypothesis, P = Probability of male birth =1/2 n = 5 N = 320 k=6 According to binomial probability law, the frequency of x male births is given by x n x f(x) = Np (x) = N. nCx p q x
= 320 x 5Cx (1/2) (1/2) n
5x
5
p(0) = q = (1/2) = 1/32 therefore frequency, f(0) = N.p(0) = 320 x (1/32) = 10 1
p(1) = 5C1 (1/2) (1/2) frequency,
2
52
3
53
= 5/16
f(3) = N.p(3) = 320 x (5/16) = 100 4
p(4) = 5C4(1/2) (1/2) frequency,
= 5/16
f(2) = N.p(2) = 320 x (5/16) = 100 p(3) = 5C2(1/2) (1/2)
frequency,
= 5/32
f(1) = N. p(1) = 320 x (5/32) = 50 p(2) = 5C2(1/2) (1/2)
frequency,
51
54
= 5/32
f(4) = N.p(4) = 320 x (5/32) = 50 5
p(5) = 5C5(1/2) (1/2)
55
= 1/32
frequency, f(5) = N.p(5) = 320 x (1/32) = 10
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
57
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
O
E
(O  E)
2
58
O E 2 E
14
10
16
1.60
56
50
36
0.72
110
100
100
1.00
88
100
144
1.44
40
50
100
2.00
12
10
4
0.40
320
320
7.16
Table of observed (O) and theoretical frequencies (E)
2
=∑
O E 2 E
Tabulated χ 0.05 for 5 d.f. is 11.1 ( From table) Since the calculated value is less than the tabulated value, the null hypothesis is accepted and it may be concluded that the result is consistent with the hypothesis that male and female births are equally probable. 2
2
2.10.5.2 Testing the goodness of fit : Poisson distribution The process of testing the goodness of fit of a Poisson distribution is done as follows: The probabilities of 0,1,2,3,….successes can be obtained by computing the sample mean
x = μ from the given data. The expected frequencies are obtained by multiplying p(x) with N f(x) = N p(x) Illustration: A typist in a company commits the following number of mistakes per page in typing 325 pages. No. of mistakes x : 0 1 2 3 4 No. of pages f: 211 90 19 5 0 Does this information verify that the mistakes are distributed according to Poisson law? Solution: Null hypothesis: Let us assume that the mistakes are distributed according to Poisson law. Mean
x =m x
f
fx
0
211
0
1
90
90
2
38
38
3
15
15
4
0
0
325
143
x=
fx 325 0.44 f 143
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
59
Therefore m = 0.44
e 0.44 = 0.6440
( using calculator or by table)
Computation of expected frequencies Probabilities
No. of
P(x)= e
mistakes
0.44
Expected frequencies x (0.44)
x
f(x) = N. p(x)
x!
0
p(0)= e
0.44
p(1)= e
0.44
p(2)= e
0.44
p(3)= e
0.44
p(4)= e
0.44
x (0.44)
0
= 0.6440
325 x 0.6440 = 209.30
1
= 0.2834
325 x 0.2834 = 92.11
0! 1
x (0.44) 1!
2
x (0.44)
2
= 0.0623
325 x 0.0623 = 20.25
2! 3
x (0.44)
3
325 x 0.0091 = 2.96
= 0.0091
3! 4
x (0.44)
4
= 0.0010
325 x 0.0010 = 0.33
4!
The expected frequencies (correct to one decimal place) of Poisson distribution are x: 0 1 2 3 4 f: 209.3 92.1 20.3 3.0 0.3 The goodness of fit can be tested by applying
2
test.
O E 2
Expected
(O)
frequency(E)
211
209.3
2.84
0.014
90
92.1
4.41
0.048
19
20.3 0.16
0.007
5
24
3.0
0
0.3
325
325
2
=∑
(O  E)
2
Observed frequency
23.6
E
0.069
O E 2 E
= 0.069 2 χ 0.05
The table value of for 5112 = 1 degree of freedom is 3.841 Since the calculated value is less than the table value, the null hypothesis is accepted. The fit is good.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 2.10.6 Test of independence: When the categories of events analyzed fall into two rows and two columns, a two way classification table emerges. For more than two rows and columns we have a contingency table in which the classification is on the basis of two attributes simultaneously. The observed frequencies are indicated in various cells of the table for respective rows and columns. Suppose we designate the two attributes by A and B; A has r mutually exclusive and collectively exhaustive categories A1,A2,…,Ar while B has c categories denoted by B1,B2,…,Bc. To conduct the test, a random sample of size n drawn from the population is classified with respect to these categories and observed frequencies are presented in a cross classified contingency table in the following form: B
B2 ……
B1
Bj……
Bc
Row Totals
A A1
O11
O12 …… O1j……
O1c
O10
A2
O21
O22 …… O2j……
O2c
O20
Ai
Oi1
Oic
Oi0
Ar
Or1
Or2 …… Orj ……
Orc
Or0
Column
O01
O02 …… O0j ……
O0c
N
Oi2 …… Oij ……
totals
In this table, Oij  Frequency of occurrence of the class (Ai, Bj) out of N observations. Oi0  Total of ith row O0j  Total of jth column. The frequencies in these cells are called cell frequencies. The null hypothesis of interest is that A and B classifications are independent ie; there is no relationship or association between the two characteristics or attributes A and B. Expected cell frequencies are computed according to the rules of probability: ‘If two events are statistically independent, their joint probability is the product of two marginal probabilities’. Thus the general formula for obtaining expected cell frequencies is Eij =
O i0 x O 0j N
(i.e.) Expected (i, j) th cell frequency =
(i th row total) x (jth column tot al) Grand total
The test statistic compares the expected and observed cell frequencies as follows: r
c
2
(Oij  Eij )2
i 1 j 1
Or simply
2
=∑
E ij
O E 2 E
The distribution of statistic follows the chi – square distribution with
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
60
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
61
ν = (r – 1) (c 1) degrees of freedom. Looking at any row in a contingency table, we note that when (r – 1) of the values are th determined, the r value is automatically fixed. Likewise, for the columns, for any column, the th c value is fixed once the (c – 1) values have been determined freely and therefore (r – 1) (c 1) are the degrees of freedom. 2 The value of χ for 2x2 contingency table is obtained as follows: A
α
Total
B
a
b
a+b
β
c
d
c+d
Total
a+c
b+d
N = a+b+c+d
2
=
(ad  bc )2 x N , (a c)(b d)(a b)(c d)
where N = (a+b+c+d)
If the calculated value of is less than the table value at a certain level of significance, then the null hypothesis is accepted, i.e., the attributes are not associated. 2
On the other hand, if the calculated value is greater than the table value at a certain level of significance, the null hypothesis is rejected. i.e.,. the two attributes are associated. 2.10.7 Yate’s Correction: In a 2x2 contingency table the number of degrees of freedom is (21)(21) = 1. If any one of the cell frequency is less than 5, the use of pooling method will result in degrees of freedom = 0 which is meaningless. In this case we apply a correction given by F.Yates (1934) which is usually known as “Yates correction for continuity”. This consists in adding 0.5 to the cell frequency which is less than 5 and adjusting for the remaining frequencies accordingly. 2
Thus corrected value of χ is given as,
1 1 1 1 N a d b c 2 2 2 2 2 (a c)(b d)(a b)(c d)
2
Illustration: The table given below shows the data obtained during the epidemic of cholera. Attacked
Not attacked
Total
Inoculated
31
469
500
Not inoculated
185
1315
1500
Total
216
1784
2000
Test the effectiveness of inoculation in preventing the attack of cholera. Solution: Let us take the hypothesis that the inoculation is not effective in preventing the attack of cholera. i.e., inoculation and attack are independent.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
62
Under the hypothesis of independence, the expected frequencies can be obtained as follows:
Inoculated
Attacked
Not attacked
Total
216 x 500 = 54
1784 x 500 = 446
500
2000 Not inoculated
2000
216 x 1500 = 162
1784 x 1500 = 1338
2000
Total χ
2000
216
2 0.05
1500
1784
2000
for (2 1)(2 – 1) = 1 d.f. is 3.84
The calculated value of is greater than the table value and hence the result of the experiment does not support the hypothesis. We therefore conclude that the inoculation is effective in preventing the attack of cholera. 2
Computation of value: Observed
Expected
Frequency
frequency
O
E
31
(O –E) 2
(O – E)
(O –E)
54
23
529
9.8
184
162
23
529
3.26
469
446
23
529
1.18
1315
1338
23
529
0.39
2
E
14.63
2
=∑
O E 2 E
= 14.63 2.11. Problems: Binomial Distribution: (1) Four coins are tossed simultaneously. What is the probability of getting (i) 2 heads and 2 tails (ii) atleast 2 heads (iii) atleast one head. (2) If on an average 8 ships out of 10 arrive safely at a port, find the mean and standard deviation of the number of ships arriving safely out of a total of 1600 ships. (3) Out of 1000 families of 3 children each, how many families would you expect to have two boys and one girl, assuming that boys and girls are equally likely. (4) Find the Binomial distribution whose mean is 9 and variance is 2.25. Answers: (1) (i) 3/8 (ii) 11/16 (iii) 15/16 (2) 1280 (3) 375 12 (4) (0.25 + 0.75)
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
63
Fitting a Binomial Distributions: (1) Find the Binomial distribution whose mean is 3 and variance 2. (2) Fit a Binomial distribution for the following data and find the expected frequencies. X f
0 18
1 35
2 30
3 13
4 4
(3) 10 coins are tossed simultaneously. Find the probability of getting (i) atleast 7 heads (ii) exactly 7 heads (iii) atmost 7 heads Answers: (1)
2 1 3 3
9
(3) (i) 11/32 (ii) 15/128 (iii) 121/128
Poisson Distributions: (1) A variable X follows Poisson distribution with mean 6. Calculate (i) P(X = 0) (ii) P (X = 2) (2) If X is a discrete random variable following a Poisson distribution and if P(X = 1) = P(X = 2), find P(X = 0). (3) A factory employing a large number of workers finds that over a period of time the average absentee rate is three workers per shift. Calculate the probability that in a given shift (i) exactly 2 workers (ii) more than 4 workers will be absent (4) A manufacturer who produces medicine bottle finds that 0.1% of the bottles are defective. They are packed in boxes containing 500 bottles. A drug manufacturer buys 100 boxes from the producer of the bottles. Using Poisson distribution find how many boxes will contain (i) no defectives (ii) atleast 2 defectives. Answers: (1) (i) 0.00248 (ii) 0.938 (3) (i) 0.2241 (ii) 0.1846
(2) 0.1353 (4) (i) 61
(ii) 9
Fitting a Poisson Distributions: (1) Show that a Poisson distribution can be fitted to the following data which gives the frequency of the number of deaths due to horse kicks in 19 corps per army per annum over twenty years. (2) Fit a Poisson distribution to the following data: No. of mistakes per page 0 1 2 3 4 No. of pages 229 325 257 119 50 (3) Fit a Poisson distribution to this data. No. of accidents 0 No. of days 21
1 18
2 7
3 3
5 17
6 2
7 1
8 0
Total 1000
4 1
Answers:
e 0.61 (0.61) x (1) P(x) = x! 1.5 e (1.5) x (2) P(x) = x! 0.9 e (0.9) x (3) P(x) = x!
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
64
Normal Distribution: (1) Find the probability that the standard normal variate lies between 0 and 1.3 (use the normal table) (2) Find the probability that the standard normal variate lies between 1.42 and 0. (use the normal table) (3) Find the mean and standard deviation of marks in an examination where 44% of the candidates obtained marks below 55 and 6% got above 80 marks. (4) Students of a class were given an intelligence test, their marks were found to be normally distributed with mean 60 and standard deviation 5. What percent of students scored? (i) more than 60 marks (ii) between 45 and 65 marks. (iii) less than 56 marks. (5) In a normal distribution 7% of the items are under 35 and 89% of the items are under 63. Find its mean and standard deviation. Answers: (1) area = 0.4032 (or) probability = 40.32% (2) area = 0.4222 (or) probability = 42.22% (3) mean = 57.21; standard deviation = 14.71 (4) (i) 50% (ii) 84% (iii) 21.18% (5) μ = 50.27 σ = 10.35 F – Test : (1) Two samples are drawn from two normal populations. From the following data test whether the two populations have the same variance at 5% level. Sample 1 60 65 71 74 76 82 85 87 Sample 2 61 66 67 85 78 63 85 86 88 91 (2) The following data presents the yields in quintals of corn on 10 sub divisions of equal area of two agricultural plots. Plot 1 6.2 5.7 6.5 6.0 6.3 5.8 5.7 6.0 6.9 5.8 Plot 2
5.6
5.9
5.6
5.7
5.8
5.7
6.0
5.5
5.7
5.5
Test whether two samples taken from two populations have the same population variance. (3) Two random populations drawn from two normal populations are Sample 1 Sample 2
20 16 26 27 23 22 18 24 25 19  27 33 42 35 32 34 38 28 41 43 30 37
Obtain the estimates of the variances of the population and test whether the two populations have the same variance at 5% level of significance. Answers: (1) F = 1.467 (2) F = 2.63 (3) F = 2.14 Test for significiants for large samples : 1. A sample of 400 items is taken from a population whose Standard deviation is 1.5. The mean of the simple is 2.5. Test whether the sample has come from a population with mean 2.68. 2. The income distribution of the population of a certain village has a mean of Rs. 6,000 and a variance of Rs. 32,400. Could a sample of 64 persons with a mean income of Rs.5950 belong to this population? (Test at both 5% and 1% levels of significance) 3. Test the significance of the difference between the jeans of the simples from the following data:
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
Size of sample
Sample A Sample B
mean
100 150
Standard deviation
50 51
4 5
4. A sample survey results show that out of 800 literate people 480 are employed whereas out of 600 literate people only 350 are employed. Can the difference between the two proportions of employed persons be due to sampling fluctuations? 5. In a large city A, 20 percent of a random simple of 900 school children had a defective eyesight. In another large city B, 15 percent of random simple of 1600 children had the same defect. Is this difference between the two proportions significant? Answers: 1.
Z = 2.4
5.
Z
2.
Z
= 2.22
3.
Z
= 1.75
4.
Z
= 0.64
= 3.2
Test for significant for small samples : (1) Choose: i. Student’s ‘t’ distribution was pioneered by (a) Karl pearson (b) Laplace (c) R.A. Fisher (d) William S. Gosset ii. t test is applicable when the sample size is (a) large (b) greater than (c) less than 30 (d) less than 5 iii. ‘t’ distribution ranges from (a)  ∞ to 0 (b) 0 to ∞ (c) ∞ to ∞ (d) 0 to 1 2. A soap manufacturing company was distributing a particular brand of soap through a large number of retail shops. Before a heavy advertisement campaign the mean sales per week per shop was 140 units. After the campaign , a sample of 26 shops was taken and the mean sales was found to be 147 units with standard deviation 16. Can you consider the advertisement effective? (t = 2.19) 3. Prices of shares of a company on the different days in a month were found to be 66, 65, 69, 70, 69, 71, 70, 63, 64 and 68. Discuss whether the mean price of shares in the month is 65. 4. Ten cartons are taken at random from an automatic filling machine. The mean net weight of 10 cartons is 11.8 kg and standard deviation is 0.15 kg. Does the sample mean differ significantly from the intended weight of 12 Kg? 5. Two horses A and B were tested according to time (in seconds) to run a particular track with following results: Horse A 28 30 32 33 33 29 34 Horse B 29 30 30 24 27 29 Test whether the two horses have the same running capacity. 6. Two different types of drugs A and B were tried on a certain patients for increasing weight. 6 persons were given drug A and 8 persons were given drug B. The increase in weight in Kg. is given below. Drug A 7 10 13 12 4 8  Drug B 12 1 6 18 16 9 8 3
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
65
COMPUTER ORIENTED NUMARICAL & STATIC METHODS Answers: (2)
t = 2.19 (3) t = 2.825 (4) t
= 4
(5)
t = 2.5 (6) t = 0.0133
Choose The Best Answer: 1. Standard error of number of successes is given by (a)
PQ n
(b)
npq
(c) npq
(d)
np q
2. Large simple theory is applicable when (a) n > 30 (b) n < 30 (c) n = 30 (d) n is atleast 100 3. If p is the sample proportion of success, then Var (p) is: (a)
P2 Q 2 n
(b)
Answers: 1. (b)
PQ n
(c)
2. (a) 3.
n PQ
(d)
PQ n
(d)

FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
66
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
UNIT III NUMERICAL METHODS UNIT STRUCTURE:
3.0 Introduction 3.1 Errors 3.1.1 Inherent error 3.1.2 Truncation errors 3.1.3 Absolute errors 3.2 Machine Computation 3.3 Transcendental And Polynomial Equations 3.4 Initial Approximations 3.5 Iterative method 3.5.1 Bisection Method 3.5.2 Newton Raphson Method 3.5.3 The Secant Method 3.5.4 The Muller Method 3.5.5 The Chebyshev Method 3.5.6 Multipoint Iteration Method 3.5.7 BirgeVieta Method 3.5.8 Bairstow’s Method 3.5.9 Graeffe’s Root Squaring Method (Direct method) For your practice 3.6 Problems
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
67
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 3.0 Introduction: In this chapter we discuss the various forms of errors, Machine Computation and iterative methods of solving Transcendental and polynomial equations. 3.1 Errors: Error is defined by the formula, Error = true value – approximate value In performing numerical calculation, three types of errors occurred. Errors
Inherent error
Truncation error
Absolute error
3.1.1 Inherent error: Most numerical computations are in exact , due to. . . the given data being approximate. the limitations of the computing aids, mathematical tables, desk calculators (or) the digital computers. This limitations, numbers have to be roundedoff casuing, called ‘Rounding errors’. In computations… Inherent errors can be minimized by obtaining better data , by correcting obvious errors in the data and by using computing aids of higher precision. In hand computations… The round – off error can be reduced by carrying the computations to more significant figures at each step of the computation. RULE: At each step of the computation retain at least one more significant figure than that given in the data perform the last operations and then roundoff. 3.1.2 Truncation errors: These type of error caused by using approximate formulae in computations – such as the one that arises when a function f(x) is evaluated from an infinite series for x after “truncating” it at a certain stage. The study of this type of error is associated with the problem of convergence. In a problem , it can be evaluated and it is desirable to make it as small as possible. 3.1.3 Absolute errors: The absolute value of the difference between the actual and the approximate value is said to be “Absolute errors” If X is the exact value of a result and X A is its approximate value obtained by numerical computations, then error εx =XXA and the Absolute error =
X  XA .
Like absolute errors, there are two errors namely Relative error and Percentage of error. Relative error:
Error Relative error = True value
=
X  XA X
= εx / X
Percentage of error: Percentage error = 100 times of relative error = (100 εx) / X
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
68
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 3.2 Machine Computation : In this section , we discuss about computation steps, control instructions, computer programming languages, characteristics of computer programs. Computation steps: To obtain meaningful results for a given problem using computers, there are five distinct phases: Choices of a method Designing the algorithm Flow charting Programming Computer execution Choices of a method: A method is defined to be a mathematical formula for finding the solution for the given problem. There may be more than one method available to solve the same problem. We should choose the method which suits the given problem best. The inherent assumptions and limitations of the method must be studied carefully. Algorithm: Once a method has been selected , we must describe a complete and unambiguous set of computational steps to be followed in a particular sequence to obtain the solution. This description is called an “Algorithm”. Flow chart: A flow chart is a graphical representation of a specific sequence of steps to be followed by the computer to produce the solution of a given problem. Computer programming: A program is a sequence of instructions that can be executed by a computer to solve a given problem. The instructions must be unambiguous and must be written in a language that can be understood by a computer programming languages are languages in which the instructions of a program are written. Computer execution: In order that a program be executed , it is necessary that the program is stored into the memory. The individual instructions are brought into the control unit at a time. In the control unit , the instruction is interpreted and accordingly, the control unit sends necessary control signals to various other units for the execution of the instruction. After the execution of the current instruction, the next instruction is brought from the memory to the control unit .Thus the control unit functions alternately in two phases Instruction reading phase & Instruction execution phase. Control instructions: Normally, the instructions of a program are executed in the sequence in which they appear within it. However, there may be specific instructions which direct the control unit to break the current sequence and to transfer control unit to an instruction located at a different place in the program. Such instructions are called control instructions. Once control has been transferred to an instruction, execution will proceed in the normal sequence until another control instruction transfers control.
Computer programming languages: A computer programming language is a software tool for communicating with computers and solving problems by using it . It has its own syntax and semantics structure and design of a programming language is governed by the application areas and the features and capabilities that the designer wants to make available to users. In addition to this, computer architecture and programming methodologies are influence the language design very closely. Highlevel programming languages may be classified as Imperative programming languages Functional programming languages Logic programming languages Objectoriented programming languages
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
69
COMPUTER ORIENTED NUMARICAL & STATIC METHODS Characteristics of computer programs: All computer programs, may be application, system or of any other type, are referred to as software. The cost of software is increasing day by day while that of hardware is decreasing. Software is becoming expensive due to its sophistication and increasing cost of human labour and scarcity of trained Manpower. Designing software system is an activity that demands much intellectual capability, logical approach, human efforts and resources. Any language, used for software development, should provide support for the following qualities in a software system. They are Reliability, Maintainability, Modifiability and Efficiency.
3.3 Transcendental and Polynomial Equations: Introduction: In the fields of Science and Engineering, the solution of f(x) = 0  (1) occurs in many applications. Equation (1) may be classified as 1. Algebraic equations. 2. Polynomial equations 3. Transcendental equations Algebraic equations: Equation of the type f(x,y) = 0 portrays a dependence between the variables x and y is said to be an Algebraic equations. Some examples are 1. 3x + 5y 7 = 0 2. 2x – 3xy – 25 = 0 these equations have an infinite number of pairs of values x and y which satisfy them. Polynomial equations: Polynomial equations are simple class of algebraic equations that are represented as n n1 anx + an1x + … +a1x + a0 = 0, nth degree polynomial and has n roots. Some examples are 5 3 2 1. 5x – x + 3x = 0 3 2 2. x – 4x + x + 6 = 0 2 3. x – 4x + 4 = 0 Transcendental equations: A non algebraic equation is called a transcendental equation. These include trigonometric, exponential and logarithmic functions. Examples of transcendental equations are 1. 2sinx – x = 0 x
2. e sinx – 2
1 x=0 2
3. logx – 1 = 0 A transcendental equation may have a finite or an infinite number of real roots or may not have real root at all. 3.4 Initial Approximations : To obtain the initial approximation to the root is based upon the “Intermediate value theorem” which states: If f(x) is a continuous function on some interval [a,b] and f(a) & f(b) < 0 then the equation f(x) = 0 has at least one root (or) an odd number of roots in the interval (a, b). We can set up a table of values of f(x) for various values of x and obtain a suitable initial approximation to the root .
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
70
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
71
Example: Obtain an initial approximation to the root of the equation x f(x) = cos x  xe = 0. Solution: We prepare a table of the values of the function f(x) for various values of x. we get x 0 0.5 1.0 1.5 2.0 f(x)
1
0.05322
2.17798
6.65180
15.19426
+ + From the table, we find that the equation f(x) =0 has at least one root in the interval (0.5, 1). 3.5. Iterative method : An iterative technique usually begins with an approximate value of the root, known as the initial guess or initial approximation, which is then successively corrected iteration by iteration. The process of iteration stops when the desired level of accuracy is obtained. We shall discuss the following methods: Iterative Methods: 1. Bisection method 2. Newtons Raphson method 3. Secant method 4. Muller method 5. Chebyshev method 6. Multipoint iterative methods Polynomial equations: Iterative Methods: 7. Bierge vieta methods 8. Bairstow method Direct method: 9. Graeffe’s root squaring method
Chapter 1 3.5.1 Bisection Method : Procedure: Let f(x) be continuos function between a and b. f(a) be –ve and f(b) be +ve .Then there is a root of f(x)=0 , lying between a and b. Let its approximate value be xo = (a+b) 2 If f(xo)=0, it means xo be a root of f(x)=0 otherwise the root lies between x o and b or between a and xo , according as f(xo) is –ve or +ve . Then as before we bisect the interval and continue the process until the root is known to the desired accuracy.
Y
(b,f (b))
x2 0
b
x1
x0
a X
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
72
(a,f(a))
In fig(1), the first approximation x0 =(a+b)
2
and f(x0) is –ve. So the root lies between b and x0. The second approximation x1 =(b + x0)
2
suppose f(x1) is +ve. The root lies between x1 and x0. We take x2 = x1 + x2 2 as the third approximation and so on. Thus, the simplest but slowly convergent method is called “Bisection method”.
the
3
Example: Find the root of the equation x x=1 correct to four decimal places by using the bisection method. Solution: 3 Here f(x) = x x1. f(1) = 111= 1= ve f(2) = 821=5= +ve. .
. . the root lies between 1 and 2. So let us take
x0 = (1+2) / 2 = 1.5 3
f(x0)=f(1.5)=(1.5) 1.51=0.8750=+ve. .
. . the root lies between 1.5 and 1. Step(1): x1 = (1.5+1) / 2 = 1.25 3
f(x1) = f(1.25)=(1.25) 1.251=0.296875=ve. .
. . the root lies between 1.25 and 1.5. Step(2): x2 = (1.25+1.5) / 2 =1.375 f(x2)=f(1.375)=+ve. .
. . the root lies between 1.375 and 1.25 Step(3): x3 = (1.375+1.25) / 2 = 1.3125 f(x3)=f(1.3125)=ve. .
. . the root lies between 1.3125 and 1.375 Step(4): x4 = (1.3125+1.375) / 2 =1.34375 f(x4)=f(1.34375)=+ve. .
. .The root lies between 1.34375 and 1.3125 Step(5): x5= (1.34375+1.3125) / 2=1.328125 f(x5)=f(1.328125)=+ve .
. .The root lies between 1.328125 and 1.3125 Step(6):
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS x6 =( 1.328125+1.3125 ) / 2 =1.320313 f(x6)=f(1.320313)=ve .
. .The root lies between 1.320313 and 1.328125 Step(7): x7 = (1.328125+1.320313) / 2 = 1.324219 f(x7)=f(1.324219)=ve .
. .The root lies between 1.324219 and 1.328125 Step(8): x8=(1.324219+1.328125) / 2 = 1.326172 f(x8)=f(1.326172)=+ve .
. .The root lies between 1.326172 and 1.324219 Step(9): x9=(1.326172+1.324219) / 2=1.325196 f(x9)=+ve. .
. .The root lies between 1.325196 and 1.324219 Step(10): x10=(1.325196+1.324219) / 2=1.324708 f(x10)=ve. .
. .The root lies between 1.324708 and 1.325196 Step(11): x11=(1.324708+1.325196) / 2=1.324952 f(x11)=+ve. .
. .The root lies between 1.324952 and 1.324708 Step(12): x12 = (1.324952+1.324708) / 2=1.324830 f(x12) = +ve. .
. .The root lies between 1.324830 and 1.324708 Step(13): x13 = (1.324830+1.324708) / 2 = 1.324769 f(x13) = +ve. .
. .The root lies between 1.324769 and 1.324708 Final step: x14 = (1.324769+1.324708 ) / 2=1.324739 Hence the root of the given equation is 1.3247 3.5.2 Newton Raphson Method: Procedure: Let x=x0 be an approximate value of one root of the equation f(x)=0;
If x=x1 is the exact root then f(x1)=0 (1)
Since x1x0 will be small ,let x1x0 =h then x1=x0+h (2) Put equation (2) in (1) we have , f(x0+h)=0 (3) By Taylor’s thearom, equation (3) can be expanded as,
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
73
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
2
f(x0) + h f '(x0) + h f''(x0) + . . . . = 0 1!
2!
2
[since h is small, omit h and all higher powers of h] f(x0) + h f '(x0) = 0
h
f ( x0 ) (4) f ( x0 )
put equation (4) in (2) ,
x1 x0
f ( x0 ) f ( x0 )
(5)
The value of x1 will be closer approximation to the root of f(x)=0 than x 0. Similarly starting with x1 we get,
x2 x1
f ( x1 ) f ( x1 )
which is a better
approximation than x1. . . . In general, for n=0,1,2,3, . . . .
xn 1 xn
f ( xn ) f ( xn )
Thus, the roots of f(x)=0 can be computed rapidly by a process called the “NewtonRaphson method”. Example: 1 Find the real root of 3xcosx1=0 correct to 6 decimal places by using NewtonRaphson method. Solution: Given:
f(x)=3xcosx1
Put x=0,
f(0)=3(0)cos01
= 2
( ve)
Put x=1,
f(1)=30.54030231=+1.4596977 (+ve)
.
. . the root lies between 0 and 1. By Newton’s rule,
x n 1 x n here,
f ( xn ) , n 0,1,2,3,.... f ( x n )
f(x)=3xcosx1 ; f '(x)=3+sinx ;
Step1: Let us take x0=0.5 as an approximate value of the root
x0=0.5
f ( x0 ) f ( x0 ) f (0.5) x1 0.5 f (0.5) x1 x0
{ f( x0 )=3(0.5)cos(0.5)1=0.377583
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
74
COMPUTER ORIENTED NUMARICAL & STATIC METHODS x1 0.5
0.377583 3.479426
75
f '(x0)=3+sin(0.5) =3.479426 }
= 0.608519 Step2: x1= 0.608519
x2 x1
f ( x1 ) f ( x1 )
x2 0.608519
f (0.608519) f (0.608519)
= 0.607102 Step3: x2=0.607102
x3 x 2
f ( x2 ) f ( x2 )
x3 0.607102
f (0.607102) f (0.607102)
x3 =0.607102 Hence , the root of the given eqn is 0.607102 Example: 2 Using NewtonRaphson method, establish the formula +N/ xn) to calculate the square root of N. hence find the
xn+1=1(xn
5
2
correct to 4 decimals.
Solution : (i)To derive the formula: If x = Let
N , then x2N=0 is the equation to be solved. 2
f (x)=x N. (1)
Then
f'(x)=2x.
(2)
By Newton Raphson rule, th
(for n iteration)
xn 1 xn
f ( xn ) f ( xn )
, n=0,1,2,3,….
using (1) & (2) in the above equation,
xn N 2 xn 2
xn 1 xn
xn N 2 xn 2
xn+1= ½ (xn +N/ xn)
, n=0,1,2,3,….
1 2
N xn xn , n=0,1,2,3,….
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
(ii) To find the value of
5
76
:
5 =2 ]
[since an approximate value of
Take N=5 and x0=2 in this formula we have,
x1
1 2
5 1 5 x0 2 2.25 x0 2 2
x1=2.25
x2
1 2
5 1 x1 x1 2
5 2.25 2.2361 2.25
x2=2.2361
x3
1 2
5 1 5 x2 2.2361 2.23605 x2 2 2.2361
x3=2.2361 Hence we find that x3= x2. Therefore ,
5 2.2361
3.5.3. The Secant Method: Procedure: The serious disadvantage of the NewtonRaphson method is the need to calculate f'(x) in each iteration. Many situations arise in which the expression f'(x) is long and much computer time is needed to evaluate the function. The secant method is such numerical method which do not calculate for f'(x). By NewtonRaphson method, we have
xn1 xn
f ( xn ) , f ( xn )
n 0,1,2,3...
but in the Secant method, f'(x) is approximated by
f ( x)
f ( xn ) f ( xn1 ) , xn xn1
n 0,1,2,3.....
Geometrical Interpretation: A geometrical interpretation of the iterative method is shown in the following figure. . . f(x)
xn
x n+1 x n+2 x n1
X
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
77
In this method a secant (or) chord is drawn connecting f(xn1) and f(xn) . The point where it cuts the Xaxis is xn+1 . Another secant drawn through f(xn) and f(xn+1) to xn+2. This is repeated till f(x) =0. An iterative formula for computation is (NR method formula)
xn1 xn
xn1 xn
f ( xn ) , f ( xn )
n 0,1,2,3...
f ( xn )( xn xn1 ) , f ( xn ) f ( xn1 )
n 0,1,2,3...
(1)
The convergence criterion is  f(xn+1)  < ε, where ε is small positive quantity. Problem : Sum(1) : x Find the root of the equation e = sin x between 0 and 1 using Secant method. Solution: Given that x f(x)=e – sin x . f(0)=1; f(1)=0.47359 .
. . The root lies in the neighbourhood of 1 .
. .x0=0 and x1=1 .
..
x2 x1
f ( x1 )( x1 x0 ) f ( x1 ) f ( x0 )
 (2)
Replacing the values of x1 and x2 as x0 and x1 we can find x2 by the same formula and so on. x0
x1
x2
f(x0)
f(x1)
f(x2)
0
1
0.67861
1
0.47359
0.12039
1
0.67861
0.56906
0.47359
0.12039
0.02722
0.67861
0.56906
0.58926
0.12039
0.02722
0.00101
0.56906
0.58926
0.58854
0.02722
0.00101
0.00001
0.58926
0.58854
0.58853
0.00101
0.00001
0.00003
0.58854
0.58853
0.58852
0.00001
0.00003
0.000018
0.58853
0.58852
0.58852
0.00003
0.000018
0.000018
Hence the root is 0.58852 Sum(2): Determine the two smallest roots of the equation by using Secant method. Solution: Given: f(x)= xsinx + cosx
xsinx+ cosx = 0
f(0)=1
f(4)=3.68085
f(1)=1.38177
f(5)=4.51096
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS f(2)=1.40245
f(6)=0.71632
f(3)=0.56663
f(7)=5.35281
78
.
. . The two roots are one lies near 2 or 3 and the other lies near 6 or 7. Choose x0=2 and x1=3. and using
x2 x1
f ( x1 )( x1 x0 ) f ( x1 ) f ( x0 )
repeatedly we get the following table of
values
2
x0 3
x1
x2 2.71224
f(x0) 1.40245
f(x1) 0.56663
f(x2) 0.21982
3
2.71224
2.79267
0.56663
0.21982
0.01503
2.71224
2.79267
2.79857
0.21982
0.01503
0.00048
2.79627
2.79857
2.79839
0.01503
0.00048
0.00001
2.79857
2.79839
2.79839
0.00048
0.00001
0.00001
f(x1)
f(x2)
For x0=6 and x1=7 and using (2) we have x0
x1
x2
f(x0)
6
7
6.11803
0.71632
5.35281
0.01945
7
6.11803
6.12122
5.35281
0.01945
0.00018
6.11803
6012122
6.12125
0.01945
0.00018
0.00003
6.12122
6012125
6.12125
0.00018
0.00003
0.00003
Hence the first root is 2.79839 and second root is 6.12125 3.5.4 The Muller Method : Introduction : Müller's method is a technique for finding the root of a scalarvalued function f(x) of a single variable x when no information about the derivative exists. It is a generalization of the secant method, but instead of using two points, it uses three points and finds an interpolating quadratic polynomial. That is if x0, x1 and x 2 are the initial approximations then x3 is obtained by solving the quadratic which is obtained by means of x 0, x 1 and x2. Then two values among x0, x1 and x2 which are close to x3 are chosen for the next iteration Given an equation f(x) = 0 Let the initial guesses be x0, x1 and x2 Let xi = x2, xi1 = x1 and xi2 = x0 Compute f(xi2), f(xi1) and f(xi) 2), fi1
and
Let f i2 = f(xi
= f(xi1), fi = f(xi) h = x  xi, hi = xi  xi1 and hi1 = xi1  xi2 i
= hi / hi1 2
gi
i
ci
i
fi2 i fi2
i
i 2 i
fi1 +

i fi1
i
i
) fi
+ fi )
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
= min ( 
i+1
i fi
79
g i  4 i f i c i ) ) 2
/ (gi
(take minimum in absolute sense) Then xi+1 = xi + ( xi  xi1
i+1
,
i = 2, 3, 4, . . .
while (none of the convergence criterion C1 or C2 is met) C1. Fixing apriori the total number of iterations N. C2. By testing the condition  xi+1  x i  (where i is the iteration number) less than some tolerance limit, say epsilon, fixed apriori. Example: Perform five iterations of the Muller’s method to find the root of the equation x f(x)=cosxxe =0. Computations are performed using the initial approximations x0=1.0, x1=0.0 and x2=1.0. Solution: Given: f(x)=cosxxe
x
x0=1.0 ;
f(x0) = 0.90818
x1= 0.0 ;
f(x1) = 1
x2= 1.0 ;
f(x2) = 2.17798
Let h1= xxk = x1; λk= (xk  xk1 ) / (xk1  xk2) = 1; δk= 1 + λk = 2.
k
xk2
xk1
xk
xk+1
λk+1
f(xk+1)
2
1.0
0.0
1.0
0.4415732
0.5585
0.2175
3
0.0
1.0
0.4415732
0.51254636
0.1272
0.1598 (1)
4
1.0
0.4415732
0.51254636
0.51769325
0.7246 (1)
0.1950 (3)
5
0.4415732
0.51254636
0.51769325
0.51775737
0.1246 (1)
0.2240 (7)
6
0.51254636
0.51769325
0.51775737
0.51775736
0.1148 (3)
0.1455 (10)
x
f(x) = cosxxe
xk+1 = xk +(xk xk1 )λk+1 λk+1 =(xxk) / (xk xk1) .
. . The root is 0.51775737
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
3.5.5. The Chebyshev Method : Procedure : 2
We assume a polynomial f(x) of degree two and write as f(x)=ax +bx+c=0, a ≠ 0 (1) We determine a,b and c using the conditions 2 fk = axk + bxk +c f 'k = 2axk + b f ''k = 2a On eliminating a,b, and c we obtain 1
1
a = ( /2)f ''k
; f 'k = 2( ( /2)f ''k ) xk +b ;
b = (f 'k f ''k xk) ;
f k = ((1/2)f ''k) xk2 +Xk(f 'k f ''k xk)+c 1
2
2
c = fk( /2)f ''k xk f 'kxk +f ''kxk .
. . Equation (1) becomes , 1
2
1
2
2
(( /2)f ''k) x +(f 'k f ''k xk)x+fk( /2)f ''k xk f 'kxk +f ''kxk =0
fk + f 'k (xxk)+f ''k( (1/2)x2 xxk (1/2) xk2 + xk2 ) =0
1
2
2
fk + f 'k (xxk)+ ( /2)f ''k(x 2xxk +xk ) =0
fk + (xxk) f 'k+ (1/2)(xxk)2 f ''k =0 (2) Which is the taylor series expansion of f(x) about x=x k such that the terms of order (x3 xk) and higher powers are neglected . The equation(2) is a quadratic equation and can be solved easily . only one of the two roots converges to the correct root. In order to get the next approximations to the correct root, we write (2) as (divide by f 'k)
fk /f 'k )+ (xxk) + ( /2)(xxk) (f ''k/f 'k) =0
fk /f 'k )+ (xk+1xk) + ( /2)( xk+1xk) (f ''k/f 'k) =0
1
1
2
2
1
2
xk+1 = xk  fk /f 'k )  ( /2)(xk+1xk) (f ''k/f 'k) (3)
xk+1xk= ( fk/ f 'k) (4)
But we know that, xk+1=xk( fk/ f 'k) Put (4) in (3) we have , 1
2
xk+1 = xk  fk /f 'k )  ( /2)( fk / f 'k) (f ''k/f 'k) 1
= xk  fk /f 'k )  ( /2)f ''k( f xk+1 =xk  fk /f 'k )  (f ''k f
2 k
2 k
3
/(f'k) ) 3
/2(f'k) )
The relation define above is known as “Chebyshev’s algorithm”. Remark : This method requires three evaluations for each iteration.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
80
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
81
If (xk+1xk) in replaced by the secant or Regularfalsi method, the order of the method is reduced. Problem: Using Chebyshev method, find the root of the equation X cos xxe =f(x) correct to six decimal places. Solution: X Given : f(x)= cosxxe f(0)=1 ; f(1)= 2.17798 . . . The root lies between 0 and 1. x x f '(x)=sin xx e  e x x =(sin x+x e + e ) x x x f ''(x) =(cos x +xe +e +e ) x x =( cos x +xe +2e ) By Chebyshev algorithm we have , 2 3 xk+1 =xk  fk /f 'k ) – (f ''k f k /2(f'k) ) 2
k 0
xk 1.0
fk 2..17798
(fk) 4.74360
f 'k 6.27803
f ''k 8.69514
1
0.56973
0.16512
0.02726
3.31436
5.38479
2
0.51789
0.00040
0.0000002
3.04280
5.09510
3
0.51776
0.72369(4)
0.52373(8)
3.04214
5.09440
(f 'k)
3
2
fk/f 'k
247.44014
0.34692
(fk) f ''k 3 2(f'k) 0.08335
xk+1
f( xk+1)
0.56973
0.16512
36.40819
0.04982
0.00202
0.51789
0.00040
28.17216
0.00013
0.18086(7)
0.51776
0.72369(4)
28.15384
0.000238
0.47384(7)
0.51752
0.72195(3)
Hence the root of the given equation is 0.51752
3.5.6. Multipoint Iteration Method: Recall 1 2 fk + (xk+1xk) f 'k+ ( /2)(xk+1xk) f ''k = 0 [ equ (2) of Chebyshev method ] . 1 2 . . (xk+1xk) f 'k+ ( /2)(xk+1xk) f ''k =  fk Divid throughout by x+1xk we have, 1
2
(xk+1xk) f 'k+ ( /2)(xk+1xk) f ''k (xk+1xk)
=
1
f 'k+ ( /2)(xk+1xk)f ''k = 1
fk . (xk+1xk) fk . (xk+1xk)
(xk+1xk) [f 'k+ ( /2)(xk+1xk)f ''k ] = fk
x
k 1
 xk
 fk f ' k ((x k 1  x k )f ' ' k /2)
Again, replace xk+1xk by (fk/ f 'k ) on the R.H.S of (1) to get the next approximation to the root
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
x
x
k 1
 xk
k 1
xk 
82
 fk f ' k (f k f ' ' k /2 f ' k ) fk , f ' k (f k f ' ' k /2 f ' k )
k 0,1,2,.....
(2)
is called the “Multipoint iteration method”. For calculation purpose we write (2) as the two stage method. .
*
..
*
xk+1 = x k+1  ( f k+1 / f 'k) * * where f k+1 = f(x k+1) , * and x k+1 = xk  (fk / f 'k) These method require three evaluations for each iteration as in Chebyshev method but we avoid evaluating the second derivative which may be advisable in many cases. Example: Perform three iterations of the Multipoint iteration method to find the root of the X equation f(x) = cos x – x e . Solution: X Given: f(x) = cos x – x e f(0) = 1 and f(1) = 2.17798 . . . the root lies between 0 and 1 . X X f ' (x) =  sin x – x e  e X X =  (sin x + x e + e ) By Multipoint iteration method, * x k+1 = xk  (fk / f 'k) * * Xk+1 = x k+1  ( f k+1 / f 'k) * * where f k+1 = f(x k+1) *
*
k
xk
fk
f 'k
x k+1
f (xk+1)
0 1 2 3
1.0 0.579706 0.518044 0.517757
2.17798 0.19845 0.000872 0.00000111
6.27803 3.36836 3.04358 3.04212
0.65308 0.52079 0.517757 0.517757
0.46064 0.00925 0.00000111 0.00000111
xk+1
f (xk+1)
0.579706 0.518044 0.517757 0.517757
0.19845 0.000872 0.00000111 0.00000111
Hence the root of the given equation is 0.517757 . 3.5.7. BirgeVieta Method : Principle: In this method, first divide the given equation by a real number using synthetic division to reduce the degree of the equation and after find the roots by Newton – Raphson iterative method. Procedure: In this method , we seek to determine a real number p such that (xp) is a factor of the polynomial equation. n n1 Pn(x) = x + a1 x + . . . + an1 x + an (1) If we divide Pn(x) by the factor (Xp) then we get a quotient Qn1(x) of degree (n1). Qn1(x) = xn1 + b1 xn2 + … + bn2 x + bn1 (2) And a remainder R. Thus we have Pn(x) = (xp) Qn1(x) + R
(3)
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS The value of R depends on P, starting with an initial approximation P 0 to P, we use some iterative method to improve the value of p such that R(P) = 0 (4) This is a single equation in one unknown and the Newton Raphson method or any other iterative method can be applied to improve the assumed value P0.The Newton – raphson method for (4) becomes Pk+1 = Pk  (Pn(Pk) / P'n(Pk)) , k=0 , 1, …. (5) For polynomial equations, the computation of P n(p0) and P'n(p0) can be systematized with the help of synthetic division .On comparing the coefficients of like powers of X on both sides of (3) we’ve a1 = b1P b1 = a1 + P a2 = b2 P b1 b2 = a2 + P b1 . . . . . . ak = bk P bk1 bk = ak + P bk1 . . . . an = R P bn1 bn = R + P bn1 let us introduce a quantity bn and define by the recurrence relations. bk = ak + P bk1 , k=1,2,3,… (7) with b0=1. Put X=p in (3) we have, Pn(P) = R = bn (8) To find P'n(P) : Differentiate (7) with respect to P we have, d bk/ dP = bk1 + P (d bk1 / dP ) (9) let ck1 = d bk / dP (10) then (9) becomes, ck1 = bk1 + P ck2 which can also be written as, ck = bk + P ck1 , k=1,2, … ,n1 Differentiate (8) with respect to P and using (10) we have, d Pn / dP = d R/dP =d bn / dP = cn1 (11) By (8) and (11) , equation (5) becomes Pk+1 = Pk (bn / cn1) , k=0,1,2, … & n degree of the polynomial.(12) The relation (12) is known as “ Birge – Vieta method ”. Note: The coefficient ck are determined from bk in a similar way as bk are obtained from ak . The calculation of the coefficients bk and ck can be carried out as given below: P
1 0 1
a1 P b1 P
1
c1
c2
a2 … an2 an1 Pb1 Pbn3 Pbn2 b2 bn2 bn1 Pc1 Pcn3 Pcn2 cn2 cn1 = dR/dP
an Pbn1 bn = R
Example: 4 3 2 Use synthetic division algorithm to find the smallest +ve root of the equation x 3x +3x 3x+2=0 Solution:
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
83
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
84
Iteration(1): 0.5
Initial approximation: 1 3 0.5 1 2.5 0.5 1
2.0
P0=0.5 3 1.25 1.75 1.0 0.75
3 0.875 2.125 0.375
2 1.065 0.9375= b4
1.75= c3
By Birge – Vieta algorithm, Pk+1 = Pk (bn / cn1) , k=0,1,2, … P1 = P0 (b4 / c3) = 0.5 –(0.9375/1.75) = 1.0357 P1 = 1.0357
Here,
Iteration(2): Take P1=1.0357 1.0357
1
3 1.0357
1
1
3
3
2.0344 1.0001
2.0713
1.9643
0.9656
1.9999
1.0357
0.9618
0.0040
0.9286
0.0038
2
0.0713= b4
1.9959= c3
P2 = P1 (b4 / c3) = 1.0357 (0.0713/1.9959) = 0.9999767≈0.1 P2 = 1.0 Hence , the exact root is 1.0 3.5.8 Bairstow’s Method : Principle : We know that if all the coefficients are real valued in a polynomial , then the complex roots occurs in pairs (as conjugates). This method is used to determine the quadratic factors that are the product of the pair of complex roots. Procedure: Consider the polynomial Pn(X) by n n1 Pn(x) = a1 x + a2 x + . . . + an+1 (1) 2
Let (x rxs) be a trial quadratic factor which is near to the desired factor of this polynomial. . 2 . . Pn(x) = (x rxs) Qn2(x) + R 2 n2 n3 = (x rxs)(b1 x + b2 x + . . . + bn1 )+ bn(xr) +bn+1 (2) The remainder is a linear term, bn(xr)+bn+1 we take in this form for convenient. The negative 2 sign in the factor are also for latter simplification. If (x rxs) is an exact factor (divisor) of P n(x) ,then bn,bn+1 both be zero.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
85 2
Now we would like to make bn and bn+1 both be zero so that (x rxs) be a quadratic factor of the polynomial Pn(x). If we change the value of r and s we can make the remainder zero (or) at least near to zero. Equating the coefficient of the equations (1) & (2) we have, a1 = b1 a2 = b2 r b1 a3 = b3 r b2s b1 a4 = b4 r b3s b2 . . . an = bn r bn1s bn2
b1 b2 b3 b4
bn
= = = = . . . =
a1 a2 + r b1 a3 + r b2+ s b1 a4 + r b3+ s b2
an + r bn1+ s bn2
an+1 = bn+1 r bns bn1 bn+1 = an+1 + r bn+ s bn1 (3) Thus the both bn & bn+1 are functions of the parameters r and s. Expanding this as * * * * taylor’s series for a function of two variables interms of (r  r) and (s  s) , where (r  r) and (s  s) are small so that the terms of higher order than the first order are negligible , we obtained *
*
*
*
bn (r , s ) = bn(r,s)+ (∂bn /∂r)(r  r) +(∂bn /∂s)(s  s) * * * * bn+1 (r , s ) = bn+1(r,s)+ (∂bn+1 /∂r)(r  r) +(∂bn+1 /∂s)(s  s) *
*
let us take (r , s ) as the point at which the remainder is zero and * * (r  r) =∆r , (s  s)=∆s , then we have * * bn (r , s ) = 0 = bn+ (∂bn /∂r) ∆r + (∂bn /∂s) ∆s (4) and * * bn+1 (r , s ) = 0 = bn+1+ (∂bn+1 /∂r) ∆r + (∂bn+1 /∂s) ∆s (5) * * i.e., ∆r and ∆s are increment to add to the original r and s to get new values r and s for which the remainder is zero . All the terms on the RHS are to be evaluated at (r,s) . now we have to solve these two equations simultaneously for the unknown ∆r and ∆s , so we need to evaluate the partial derivatives. For, we define a set c1,c2, … , cn as below: c1 = b1 c2 = b2 +r c1 c3 = b3 + r c2 +s c1 c4 = b4 + r c3 +s c2 . . . cn = bn+ r cn1+ s cn2 Then the partial derivatives becomes , (∂b1 /∂r) = (∂a1 /∂r) =0 (∂b2 /∂r) = (∂a1 /∂r)+ b1 + r (∂b1 /∂r) = b1 = c1 (∂b3 /∂r) = r (∂b2 /∂r) + b2 + s(∂b1 /∂r) = r c1 + b2 + 0 = c2 (∂b4 /∂r) = r (∂b3 /∂r) + b3 + s(∂b2 /∂r) = rc2 + b3 + sc1= c3 . . (∂bn /∂r) = r (∂bn1 /∂r) + bn1 + s(∂bn2 /∂r) = rcn2 + bn1 + scn3 = cn1 In the same way, (∂b1 /∂s) = (∂a1 /∂s) =0 (∂b2 /∂s) = r (∂b1 /∂s) =0 (∂b3 /∂s) = r (∂b2 /∂s) + b1 + s(∂b1 /∂s) = 0 + b1 + 0 = c1
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
(∂b4 /∂s) = r (∂b3 /∂s) + b2 + s(∂b2 /∂s) = rc1 + b2 + s(0) = c2 . . . (∂bn /∂s) = r (∂bn1 /∂s) + bn2 + s(∂bn2 /∂s) = rcn3 + bn2 + scn4 = cn2 By using these partial derivatives in equations (4) and (5), bn+ cn1 ∆r + cn2 ∆s =0 and bn+1+ cn ∆r + cn1 ∆s =0 cn1 ∆r + cn2 ∆s
= bn
and cn ∆r + cn1 ∆s
=bn+1
Applying crammer’s rule we have, bn cn2 bn+1 cn1
∆r =
cn1 cn
cn2 cn1
and cn1 bn cn bn+1
∆s =
cn1 cn
cn2 cn1 *
*
Hence we get a better approximate values (r , s ) for r and s so that * * r = r + ∆r and s = s + ∆s. repeating this process we get successive approximate values. Thus we get a quadratic factor 2 (x rxs) for Pn(x) . Example: Find the quadratic factor of the equation 4 3 2 x – (1.1)x + (2.3)x +(0.5)x+ 3.3=0 using r=s=1 solution:
4
3
2
Given: x – (1.1)x + (2.3)x +(0.5)x+ 3.3=0
r=1 s=1
1
1.1 1.0
2.3 2.1 1.0
0.5 3.4 2.1
1
2.1 1.0
3.4 3.1 1.0
0.8 bn 5.5 3.1
1
3.1cn2
5.5cn1
0.8 0.7
3.3 0.8 3.4 0.7 bn+1
3.2 cn
3.1 5.5
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
86
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
∆r =
=
2.23 = 0.1097 20.23
5.5 3.1 3.2 5.5 and 5.5 0.8 3.2 0.7
1.29
∆s =
= 5.5 3.2
.
= 0.0635
3.1 5.5
20.23
*
r = r + ∆r = 1+0.1097 = 0.8903 * s = s + ∆s = 1 0.0635 = 1.0635
.. and
so for the second trial:
r=0.89 s=1.06 1
r = 0.89 & s = 1.06
1
1.1 0.89
2.3 0.5 3.3 1.77 2.68 0.06 1.06 2.11 3.19
1.99
3.01 0.89
0.07 bn 0.17 bn+1 2.56 4.02 1.06 3.05
1
2.88cn2
4.51cn1 1.03 cn
0.07 2.88 0.17
4.51
∆r =
0.1739 =
4.51 2.88 1.03 4.51
= 0.010 17.3737
and 4.51 0.07 1.03 0.17 ∆s =
0.6946 =
4.51 2.88 1.03 4.51 .
.. and .
= 0.040 17.3737
*
r = r + ∆r = 0.89  0.010 = 0.9 * s = s + ∆s = 1.06  0.040 = 1.1 2
. . the quadratic factor is X  (0.9) X  1.1
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
87
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
Verification:
2
x 2x+3 4
3
2
3
2
x  (1.1)x + (2.3)x + (0.5)x + 3.3 4 3 2 x + (0.9)x + (1.1)x  2 x + (1.2)x + (0.5)x 3 2  2 x  (1.8)x  (2.2)x
2
x +(0.9) x+1.1
2
3x + (2.7)x + 3.3 2 3x + (2.7)x + 3.3 0
Hence , the exact quadraric factors of the given equation are 2 2 (x +(0.9) x+1.1) and (x  2 x + 3) . Note: If no starting points were given take r = s = 0 . Here to get the quadratic factor, we can use the double synthetic division scheme. 3.5.9. Graeffeâ€™s Root Squaring Method : Principle: It is a direct method.The given equation is transformed into another whose roots are high powers of those of the original equation. The roots of the transformed equations are widely separated and because of this fact the roots are easily found. For example: If two of the roots of the original equation 2 and 3 .The corresponding m m roots of the equation are 2 and 3 , where m is the power to which the roots of the given equation have been raised. Thus if m = 64 , we have 64
2 = 1.84467 X 10 64
3
19
= 3.43368 X 10
30
The two roots of the given equation where of the same order of magnitude but in the transformed equation the larger root is more than a 100 million times as large as the small one. In other words, the ratio of the roots in the given equation is (2/3), but in the transformed equation it is 19.266 30.536 11.27 (10 ) / (10 ) = 1 / 10 64 64 i.e., 2 / 3 < 0.00000000001 . Hence, the smaller root in the transformed equation is negligible in comparison with the larger one. The root of the transformed equation are said to be separated if the ratio of any root to the next larger is negligible in comparison with unity. Root squaring process : First, transform the given equation into another whose roots are the squares of the original equation. This second equation is then transformed into a third equation whose roots are the squares of those of the second, and therefore the fourth power of those of the
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
88
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
89
original equation. The root squaring process is continued in this manner until the roots of the last transformed equation are completely separated. Consider the equation n n1 f(X) = a0 X + a1 X + . . . + an = 0 (1) Let x1, x2, x3, . . . , xn be the roots of the equation (1). Collecting all the even terms of (1) on one side and all the odd terms on the other side, we get n n2 n4 n1 n3 ( a0 X + a2 X + a4 X + . . . ) =  (a1 X + a3 X + . . . ) Squaring both sides, n
( a0 X + a2 X
n2
+ a4 X
n4
2
+ . . . ) = (a1 X
n1
+ a3 X
n3
+...)
2
i.e., 2
a0 X
2n
2
+ (2a0a2 – a1 ) X
2n2
2
+ (a2 + 2a0a4  2a1a3) X 2
+ ( 2a0a6 +2a2a4 – a3 2a1a5) X
2n6
2n4 n
2
+ . . . + (1) an = 0
2
Put –X = y , we get the new equation 2
n
n
a0 (1) y +(1)
n1
2
n1
(2a0a2a1 ) y
+(1)
n2
2
n2
(a2 +2a0a4 2a1a3) y n
2
+ … + (1) an
=0
n
÷ by (1) , we have 2
n
2
n1
+ (a2 +2a0a4 2a1a3)y
n1
+ (a2 +2a0a4 2a1a3)y
i.e., a0 y  (2a0a2a1 ) y 2
n
2
i.e., a0 y + (a1  2a0a2)y
2
n2
+ . . . + an = 0
2
n2
+ . . . + an = 0
n2
+ . . . + bn = 0 (2)
n
i.e.,
n1
b0 y + b1 y 2 b0 =a0
where
, b1 =
2 (a1 
2a0a2) , b2 = 2
+ b2 y
2
2
2 (a2 +2a0a4 2a1a3) 2
2
2
, . . . , bn =an .
2
the roots of the equation (2) are x1 , x2 , x3 , . . . , xn . Hence we obtain an equation whose roots are the square of those of f(x) = 0 and this process is known as, “Root Squaring Process”.
In practice the new coefficients of the equation(6) is obtained as follows:
a0
a1
2
a2 2
a0
a1
2 a0 a2
2
a3
a4
2
a2
2
a3
2a1a3 2a0a4
a4
 2a2a4 2a1a5
....
2a3a5 2a2a6
2a0a6
b1
b2
 2a1a7
b3
....
....
 2a0a8 b0
....
....
.... b4
....
In forming the above table we proceed as follows: (i)
In the first row, we write down the detached coefficients a0,a1,a2,…
(ii)
In the next row, we write their squares a0 ,a1 ,a2 , . . . which are the headings for
2
2
2
columns. (iii)
The terms in the various columns alternate in sign, starting with a +ve sign.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS th
(iv)
The (k+1) column can be obtained as follows:
The first term is the square of the (k+1) coefficient.i.e., ak.
The 2
th
nd
term is twice the product of the nearest neighbouring coefficients a k1
and ak+1.
The 3
rd
term is twice the product of the next neighbouring coefficients a k2
and ak+2.
Thus, this procedure is continued until there are no available coefficients to form the crossproducts. Then bk will be the sum of the elements of the th
(k+1) column.
Illustration: Find the equation whose roots are the negatives of the squares of the roots of 4
3
2X + 4X 7X+1 = 0 Solution: We find the coefficients of the required equation by the following scheme: 2
4
0
7
1
4
16
0
49
1
0
56
0
here, 0 = 2 x 2 x 0 56 = 2 x 4 x 7
4 4
16
0 = 2 x 0 x 1
60
59
1
4
4= 2x2x1
3
2
Hence , the required equation is 4X +16X + 60X + 49X +1 = 0 Note: In writing the first row, we have supplied the number 0 for the missing co efficients of 2 X. Case1: Roots are real and distinct: th
n
Consider the general n order equation a0 X + a1 X
n1
+ . . . + an = 0
Let x1, x2, . . . , xn be the n real distinct roots of these equation. Then by the relation between roots and coefficients we have, a1/ a0= ( x1+ x2+ x3+ . . . + xn) a2/ a0= +( x1 x2 + x2 x3 + . . .
)
a3/ a0= ( x1 x2 x3+ x1 x2 x4+ . . . ) . . . n
an/ a0= (1) ( x1 .x2 .x3 . . . xn)
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
90
COMPUTER ORIENTED NUMARICAL & STATIC METHODS m
m
m
91
m
Let the transformed equation whose roots are x1 , x2 , x3 , . . . , xn , have the coefficients b0, b1, b2, . . . , bn . Then the transformed equation is m n
m n1
m
b0 (x ) + b1 (x )
+ . . . + bn1 (x ) + bn = 0.
For this equation we have, m
m
m
b1/ b0 = ( x1 + x2 + . . . + xn ) m
m
m
m
m
m
m
=  x1 (1 + x2 / x1 + x3 / x1 + . . . + xn / x1 ) m
m
m
m
b2/ b0 = ( x1 x2 + x1 x3 + . . . ) m
m
m
m
= x1 x2 (1 + x3 / x2 + . . .) . . . n
m
m
m
m
bn/ b0= (1) ( x1 . x2 . x3 . . . xn ) m
m
Assume that x1 > x2 > . . . > xm .Hence, when the roots are separated the ratios (x2 / x1 ), m
m
(x3 / x2 ), . . . are negligible in comparison with unity. Hence the above ratio becomes, m
b1/ b0 =  x1
m
m
b2/ b0 = + x1 x2 m
m
m
b3/ b0=  x1 x2 x3 . . . n
m
m
m
m
bn/ b0= (1) ( x1 . x2 . x3 . . . xn ) Dividing each of these equations after the first by the proceeding equation we have, m
m
m
b2/ b1 =  x2 , b3/ b2 =  x3 , bn/ bn1 =  xn . m
Hence from the equations and equation b1/ b0 =  x1 m b0 x1
+b1= 0,
m b1 x 2
+b2= 0, . . . ,
m bn1 xn
we have
+bn= 0
Hence the root squaring process has broken up the equation into n – simple equations from which the required roots can be found.
Note: We find that x1 > x2 as it should be. Also, the sign of the given equations are + ,  ,  . Hence there is only one change of sign. By Descrate’s rule of signs, the number of +ve roots cannot exceed 1. so after finding that x1 is +ve, we can say x2 is –ve.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
92
Illustration: 2
Find the roots of X – 4X – 5 = 0 by two squaring. Solution: The working is shown in a compact form as below…
m
m
2m
2
0
root (x )
1
x
X
2
X
constant
1
4
5
1
16
25
10(= 2x1x5) 1
2
x
2
1
26
25
1
676
625
50(=2x1x25) 2
4
x
4
1
626
625
We have applied the squaring process two times. We find from the final equation, b0 = 1, b1 = 626, b2 = 625. If x1 and x2 are the roots , we have 4
 x1 = b1/ b0 = 626 / 1  x1  = (626)
1/4
= 5.0020
m
 x2 = b2 / b1 = 625 / 626  x1  = (625 / 626)
1/4
= 0.9996
By Descarte’s rule , 5.0020 and 9 nearly satisfy the given equation. Hence, x1 = 5 and x2 = 1 Case2: Roots are repeated: After a few squaring, if the magnitude of one of the coefficients is half the square of the magnitude of corresponding coefficient in the previous equation, then the corresponding root is a double root. The method of finding double roots is shown by the following illustration. Illustration: 3 2 Find all the roots of x – 4x + 5x 2 = 0 by Graeffe’s method.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
93
Solution:
m
m
2
0
1
1
2
3
4
2
4
8
16
Coefficients 1
4
5
2
1
16
25
4
10
16
1
6
9
4
1
36
81
16
18
 48
1
18
33
16
1
324
1089
256
66
576
1
258
513
256
1
66564
263169
65536
1026
131073
65538
131073
1 1
4295229444 262146
5
32
1
4294967298
17180131329
65536 429467276
8590196736 8589934593
4294967276
Since the magnitude of the coefficient 8589934593 is half of the square of the magnitude of the corresponding coefficient, 131073, in the previous equation, x 2 is double root.
x1 x2
32
32
4294967298 4294967298 1 4294967298 32 x3 1 4294967298
x1 32 429994967298 2 x 2 x3 1
Verifying the signs, we have the roots 2, 1, 1. Case3: If complex roots occurs. If an equation has complex roots (which will occur in conjugate pairs) , after a few squaring , the coefficients will fluctuate in magnitude and sign. The method of finding complex roots is shown by the following illustration.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS Illustration: 3 Solve the equation x – x – 1 = 0
94
 (1)
Solution: m
m
2
x 2 (root)
0
1
x
m
1
2
2
x
4
3
x
8
x
Coefficients
2
4
8
1
0
1
1
1
0
1
1
2
0
1
2
1
1
1
4
1
1
2
4
1
2
3
1
1
4
9
1
6
4
10
5
1
1
2
At this stage, we find the co efficient of x i.e., b1 is of the same sign in the equations and while the co efficient of x i.e., b2 is fluctuating in sign. This shows that x1 is the real root and x2 and x3 are complex. The real root is got from
x1 8
10 1
x1 8 10
x1 1.3335
We find that 1.3 nearly satisfies the given equation. So x1 = 1.3335 (+ve ). Complex roots: Since the complex roots occur in conjugate pairs, Let us take x2 = p + iq
x3 = p – iq.
and
From the given equation (1), x1 + x2 + x3 = sum of the roots
=
coefficien t of x 2 0 0  (2) 1 coefficien t of x 3 cons tan t term (1) 1  (3) 1 coefficien t of x 3
x1 x2 x3
= product of the roots =
i.e.,
x1 + (p + iq) +(p – iq) = 0, 2p p
sub x2 and x3 in (2)
= x1 = 0 1.3335 =  0.6668
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS and
x1 (p + iq)(p – iq) = 1, 2
2
2
2
sub x2 and x3 in (3)
x1 (p + q ) = 1 (p + q ) = 1 / 1.3355 q
2
q
2
= 0.7499 – ( 0.6668) = 0.7499 – 0.4446 =
0.3053 = 0.5525
q = 0.5525 The complex roots are (0.6668) ± i(0.5525) Hence the roots of the given equation are 1.3335 , (0.6668) ± i(0.5525)
3.16 Problems: Bisection method: Sum(1): Obtain the root of the following equations correct to four decimal places, using the bisection method. 3 3 2 (i) x  9x + 1 = 0 (iv) x + x – 1 =0 3 X (ii) x  4x + 9 = 0 (v) e – 3x = 0 (iii) x  cos x = 0 (vi) x sin x + xcos x = 0 Ans: (i)2.9429 (ii) 2.7065 (iii) 0.7388 (iv) 0.754869 (v) 0.6190 (vi) 2.7984 Newton – Raphson Method : Sum (2) : 3 (i) Find the root of the equation x  2x  5 = 0 by Newton – Raphson Method, correct to 3 decimals. X (ii) Find the root of the equation e = 4x by Newton – Raphson Method, correct to 6 decimals. 3 2 (iii) Find the root of the equation 4x – 12.3x – x + 16.2 = 0, correct to 2 decimals by Newton – Raphson Method.(the root lying between 1&2) (iv) find the square root of 20 correct to two decimal places , by Newton – Raphson Method. Ans: (i) 2.095 (iii) 1.55 (ii) 2.153292 (iv) 4.47 Secant method : Sum(3) 3 Find the root of the equation x 2x5=0,correct to 3 significant digits using Secant method. (Ans: 2.095) Sum(4): Find the root of the following equations by using Secant method 1. 2x3sinx5 (Ans: 2.8832) 3 2. x 18 (Ans:2.6207) 3 3. x 4x+1 (Ans: (0,1)0.255, (1,2)1.861, (2,3)2.115) 4 4. x x9 (Ans:1.8134) Sum(5) : Using Secant method to determine the root of the equation X cosxxe =0 (Ans:0.5177573) Sum(6) : 2 Find all the roots of cosxx x=0 to five decimal places. (Ans:0.55001, 1.25115) Muller method : Sum(7) : Using Muller method to find the root of the following equations : 3 (i) X – 2X – 5 = 0 (iv) 2X – 3sin X 5 =0 3 X (ii) X –4X + 1 = 0 (v) 3X + sin X  e = 0 X 2 (iii) cos X –Xe = 0 (vi) cos X – X – X = 0 Ans : (i) 2.095 (ii) ( 0.255 , 1.861, 2.115) (iii) 0.5177573 (iv) 2.8832 (v) 0.36042170 (vi) ( 0.55001 , 1.25115 )
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
95
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
Chebyshev method : Sum(8) Find the root of the following equations by using Chebyshev method 2X3sinX5 (Ans: 2.8832) 3 X 18 (Ans:2.6207) 3 X 4X+1 (Ans: (0,1)0.255, (1,2)1.861, (2,3)2.115) 4 X X9 (Ans:1.8134) 3 X 2 (Ans:1.25694) Multipoint method: Solve the sums given in Chebyshev and Muller method by using Multipoint method. Birge – vieta method : Sum(9): Use Birge – vieta method to find a real root correvt to three decimals of the following equations 3 2 (i) X  11X +32X – 22 = 0 ; P = 0.5 5 (ii) X – X + 1 = 0 ; P = 1.5 6 4 3 (iii) X  X  X  1 = 0; P = 1.5
Sum(10): Find the real and complex roots correct to two decimals of the equation 5 X = 3x – 1 Ans: (9): (i) 1.000 (ii) 1.167 (iii) 1.404 (10): (0.33 , 1.21 , 1.39 , 0.08 ± (1.33)i ) Bairstow’s method: Sum(11): Perform two iteration, using Bairstow’s method to obtain the quadratic factor of the following equations : 4 3 2 (i) x – 3x +20x +44x + 54 = 0 with ( 2,2 ) 4 3 2 (ii) x – x +6x +5x + 10 = 0 with ( 1.14 , 1.42 ) 3 2 (iii) x – (3.7)x + (6.25)x – 4.069 = 0 with (2.5 , 3 ) Ans:
(11): (i) (1.9420 , 1.9543),(1.9413 , 1.9538) (ii) (1.1446 , 1.4219) (iii) (2.3826 , 3.0974)(2.4001 , 3.1299)
Graeffe’s Root Squaring Method : Sum(12) 3 2 Solve the equation (i) x – 2x – 5x +6 =0 3 2 (ii) x + 3x – 4 =0 3 2 (iii) x – 4.956x – 8.228x  5.128 =0 Ans:
(i) (iii)
(3.0144 , 1.9914 , 0.9995), (1.2501) ±i(0.7248) , 2.4558
(ii) 2, 2, 1

FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
96
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
UNIT IV SYSTEM OF LINEAR ALGEBRAIC EQUATIONS UNIT STRUCTURE 4.0 Introduction 4.1 Eigen value problems Direct method 4.2 Gauss elimination 4.3 Gauss Jordan 4.4 Triangularisation 4.5 Cholesky method Iterative Method 4.6 Gauss Jacobi method 4.7 Gauss Siedel method 4.8 Problems
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
97
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 4.0 INTRODUCTION: In Lower classes, we have solved Simultaneous linear equations by Cramer’s rule or by matrix methods. These methods become tedious when the number of unknowns in the system is large. After the availability of computers, we go to numerical methods which are suited for computer operations.
Some methods of solving Simultaneous linear equations: Direct method 1
Gauss Elimination method
2
Gauss Jordan method
3
Triangularization method
4
Cholesky method
Indirect method 5
Gauss Seidal method
6
Gauss Siedel method
Frame work: SYSTEM OF LINEAR EQUATIONS
DIRECT METHOD
ITERATIVE METHOD
Guass Elimination
Gauss Jacobi
Gauss Jordan Triangularization
Gauss Siedel
Cholesky
4.1 Eigen value problems: Consider a linear system of homogeneous equations of the type
(a11 ) x1 a12 x2 ... a1n xn 0
a21x1 (a22 ) x2 ... a2n xn 0
(1)
……………
where
an1 x1 an 2 x2 ... (ann ) xn 0
is a scalar constant. Equation (1) may be expressed as [A  I][X] = 0 (2) where I is the identity matrix and [A  I] is the characteristic matrix of the coefficient matrix A.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
98
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
99
The homogeneous equations (2) will have a non trivial solution if, and only if, the characteristic matrix is singular. Then we have
A I 0
(3)
Expansion of the determinant will result in a polynomial of degree n in
n p1n1 p2 n2 ... pn1 pn 0
.
(3)
Equations (3) will have n roots 1, 2,…. n. Equations (3) is known as the characteristic equation and the roots are known as the characteristic values or eigenvalues of the matrix A. The solution vectors X 1 , X 2 ,.. X n corresponding to the eigenvalues 1, 2,…. n are called the eigenvectors, and the entire system is called an Eigenvalue problem or the characteristic problem. The n roots 1, 2,…. n representing the eigenvalues of A may be distinct or repeated, real or complex. The largest eigenvalue in modulus is called the spectral radius of A. Corresponding to each eigenvalue λ i, there exists an eigenvector Xi, which is a non trivial solution of (A λiI) X = 0. Power Method: The iterative procedure for finding the dominant eigenvalue of a matrix is known as the power method. Power method is a ‘single value’ method used for determining the ‘dominant’ eigenvalue of a matrix. It is an iterative method implemented using an initial starting vector X. The starting vector can be arbitrary if no suitable approximation is available. Power method is implemented as follows. Y=AX (4) X=
1 Y k
(5)
The new value of X obtained from (5) is used in (4) to compute a new value of Y and the process is repeated until the desired level of accuracy is obtained. The parameter k, known as the scaling factor, is the element of Y with the largest magnitude. Let us assume that the eigenvalues are
1 2 .... n
and the
corresponding eigenvectors are X1,X2,…,Xn. After repeated applications of equations (4) and (5), the vector X converges to X1 and k converges to 1. Example: Find the largest eigenvalue 1 and the corresponding eigenvector X1 of the following matrix using power method.
1 2 0 2 1 0 0 0 1 Solution: Let assume the starting vector as
0 X 1 0 Equations (4) and (5) are repeatedly used as follows Iteration 1
1 2 0 0 2 Y 2 1 0 1 1 0 0 1 0 0
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
100
2 1 1 X 1 0.5 2 0 0 Iteration 2
1 2 0 1 2 Y 2 1 0 0.5 2.5 0 0 1 0 0 2 0.8 1 X 2.5 1 2.5 0 0 The process is continued and the results are tabulated below: Itreation Y 0 1 0
X
1 2.0 1.0 0.0
2 2.0 2.5 0.0
2 2.8 2.6 0.0
4 2.86 2.93 0.0
5 2.98 2.96 0.0
6 2.98 2.99 0.0
7 3.0 3.0 0.0
1.0 0.5 0.0
0.8 1.0 0.0
1.0 0.93 0.0
0.98 1.0 0.0
1.0 0.99 0.0
1.0 1.0 0.0
1.0 1.0 0.0
The final entry in the table shows that 1 = 3.0 (element of Y with the largest magnitute) and the corresponding eigenvector is the last X. i.e.
1 X 1 0
DIRECT METHOD: 4:2 Gauss elimination method: Procedure: Consider the general system of equations. a11x1+a12x2+a13x3=b1
(1)
a21x1+a22x2+a23x3=b2
(2)
a31x1+a32x2+a33x3=b3
(3)
Step 1: Form the augumented matrix, a11 a12 a13 b1 a21 a22 a23 b2 a31 a32 a33 b3
(4)
Step2: Elimination of x1 from (2): Multiply (1) by –a21 / a11 and add it to (2). Elimination of x1 from (3):
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
101
Multiply (1) by –a31/a11 and add it to (3), Therefore (4) becomes, a11 a12 a13 b1 –a21 / a11 a21 a22 a23 b2 –a31/ a11 a31 a32 a33 b3
(5)
Here –a21 / a11 and –a31/ a11 are called multipliers. Assume a11 ≠ 0. The first equation is called pivotal equation and the leading coefficient is called the first pivot. Now (5) becomes, a11 a12 a13 b 0 a22 ′ a23 ′ b2 ′ ′ 0 a32 ′ a33 b3′
(6)
a22 ′ = a22 –(a21 / a11) * a12 ; a23 ′ = a23 –(a21 / a11) * a13 ;
where
b2 ′ = b2 – (a21 / a11) * b1
a32 ′ = a32 –(a31/a11) * a12 ′ a33 = a33 –(a31/ a11) * a13
;
–(a31/ a11)* b1
b3′ = b3
Step 3: rd
Elimination of x2 from 3 equation of (6): Now a22 ′ is the new pivot. Multiply 2
nd
equation of (6) by –a32′ / a22 ′
and add it to the third.
Therefore (6) becomes,
–a32′ / a22 ′
a11 a12 a13 b 0 a22 ′ a23 ′ b2 ′ ′ 0 a32 ′ a33 b3′
(7)
After multiplying (7) becomes, a11 a12 a13 b ′ ′ ′ 0 a22 a23 b2 ′′ ′′ 0 0 a33 b3
(8) ′′
′
, a33 = a33 –(a32′ / a22 ′) * a23 ′ b3
′′
= b3′–a32′ / a22 ′ * b2
Thus we have to reduce the given augmented matrix to a upper triangular matrix. [i.e., triangular zero in the lower left corner as in (8)] Now x1, x2, x3 can be got by back substitution. Example: Solve the given system by gauss elimination method. 2x + y + 4z = 12 8x  3y + 2z = 20 4x + 11y z = 33
(1) (2) (3)
Solution: STEP1: The augmented matrix is 2
1
4
12
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 8 4
3 11
2 1
102
20 33
STEP2: Elimination of x from (2) and (3): Therefore we have, 2 1 4 12 8 3 2 20 4 11 1 33
4 2
(4)
[Since –a21 / a11 = 8/2 = 4 and –a31 / a11 = 4/2 = 2] Multiply the first equation successively by 4 and 2.then add the products to the second and third equations respectively. Therefore (4) becomes, 2 0 0
1 7 9
4 14 9
12 28 9
(5)
[since 4* (2)+(8)=0, 4*(1)+(3) = 7, 4*(4)+2 = 14, 4*(12)+20 = 28 Similarly for 2 also] STEP3: rd
Elimination of y from 3 equation of (5): Take the second row of (5) as the pivotal row, Multiply 2
nd
equation by 9/7 and add the product to the third.
Therefore (5) becomes, 2 0 0
9/7
1 7 9
4 14 9
12 28 9
After multiplying,
2 0 0
1 7 0
4 14 27
12 28 27
Now (6) can be written as, 2x + y + 4z = 12 7y  14z = 28 27z = 27 Back substitution:
(6)
(7) (8)
Consider, 27z = 27 Therefore Substitute z=1 in (8),
z =1 7y = 28 + 14 y =2
Substitute y=2 and z=1 in (7), 2x + 2 + 4(1) = 12 x=3
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
103
Therefore the solution is (x, y, z) = (3, 2, 1) 4:3 Gauss Jordan method: After eliminating one variable by gauss’s method, in the subsequent stage, the elimination is performed not only in the equations below but also in the equations above. This is Jordan’s modification and is called GaussJordan method. Procedure: The procedure is similar to the gauss elimination method up to step1. [Refer Gauss elimination method] rd
st
In step2, we eliminate x2 not only from the 3 equation of (6) but also from the 1 equation. Therefore (6) becomes, –a12 / a22 ′ –a32′ / a22 ′
a11 a12 a13 b 0 a22 ′ a23 ′ b2 ′ ′ 0 a32 ′ a33 b3′
The matrix becomes, ′
′
a11 0 a13 b1 ′ ′ ′ 0 a22 a23 b2 ′′ ′′ 0 0 a33 b3 where, ′ ′ ′ a13 = a13 –a12 / a22 * a23 ′′ ′ ′ ′ ′ b3 = b3 –a32 / a22 * b2
′′
′
′
a33 = a33 –a32 / a22 * a23 ′ ′ ′ b1 = b1 –a12 / a22 * b2
′
Thus we have to reduce the given system to an upper triangular matrix and also nd we have to make the 2 element of the first row zero as in the above matrix. Now x1,x2,x3 can be got by back substitution. Example Solve the following system by gauss Jordan method. 2x+y+4z=12 8x3y+2z=20 4x+11yz=33 solution: First proceed as in case of illustration of Gauss Elimination.. STEP1: The augmented matrix is 2 1 4 12 8 3 2 20 4 11 1 33 STEP2: nd rd Elimination of x from 2 and 3 equations. Therefore we have, 4 2
2 1 4 12 8 3 2 20 4 11 1 33
After multiplying we have, 2
1
4
12
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 0 0
7 9
14 9
28 9
104
(5)
STEP3: Elimination of y from first and third equations of (5): nd st nd Multiply the 2 equation by 1/7 and add to the 1 and multiply 2 equation by 9/7 and add to the 3rd.Here second row is pivotal row. Therefore we have, 1/7 2 1 4 12 0 9/7
0
7 9
14 9
28 9
After multiplying we have, 2
0
2
8
0
7
14 28
0
0
27  27
We have, 2x + 2z = 8 7y  14z = 28 27z = 27
from the first row from the second row from the third row
Back substitution: 27z = 27 z=1 substitute z=1 in
7y14z =28 y=2
Substitute z=1 in
2x +2z = 8 x =3
Therefore solution is (x, y, z) = (3, 2, 1)
4.4 Method of triangularization: This is based on the fact that the matrix A can be represented as the product of a lower triangular matrix and an upper triangular matrix. (i.e.) A=LU, where L is a lower triangular matrix and U is an upper triangular matrix. This is also known as method of factorization (or) LU Decomposition method.
Procedure: Consider the system of equations, a11x1+a12x2+a13x3 = b1 a21x1+a22x2+a23x3 = b2 a31x1+a32x2+a33x3 = b3 The above equations can be written in the matrix form as, ďƒ (1)
AX = B Where
a11
a12 a13
x1
b1
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS A=
a21 a22 a23 a31 a32 a33
Let
where
X=
x2 x3
B=
b2 b3
(2)
A = LU 1 0 0 l21 1 0 l31 l32 1
L=
105
U=
0
u11 u12 u13 u22 u23 0 0 u33
Therefore (1) becomes, (3)
LUX = B Let
(4)
UX = Y
Then (3) becomes , (5)
LY = B (i.e.) 1 l21 l31
0 1 l32
0 0 1
y1 y2 y3
=
b1 b2 b3
On multiplying we have, y1 = b1 y1 l21 + y2 = b2 y1 l31 + y2 l32 + y3= b3 From these y1, y2, y3 can be solved by forward substitution. Now (4) becomes, u11 u12 u13 x1 y1 0 u22 u23 x2 = y2 0 0 u33 x3 y3 On multiplying we have, u11 x1+ u12 x2+ u13 x3 = y1 u22 x2+ u23 x3 = y2 u33 x3 = y3 From these x1, x2, x3 can be solved by back substitution. Now we have to find the 3 Lelements and the 6 Uelements. Since LU=A, We have, 1 0 0 u11 u12 u13 a11 a12 a13 l21 1 0 0 u22 u23 = a21 a22 a23 l31 l32 1 0 0 u33 a31 a32 a33 On multiplying we have, u11 u12 l21 u11 l21 u12+ u22 l31 u11 l31 u12+ l32 u22
u13 l21 u13+ u23 l31 u13+ l32 u23 + u33
=
a11 a12 a13 a21 a22 a23 a31 a32 a33
(6) Now equating the corresponding elements of both the matrices, we have 9 equations to determine the 9 unknowns. First equate the corresponding elements of first row in both side of (6), we have, u11= a11 , u12= a12 , u13= a13
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
106
Next equate the remaining corresponding elements of first column of (6), l21 u11 = a21 (i.e)
l21= a21 / u11
and
l31 u11= a31
and
l31= a31/ u11
= a21 / a11
= a31/ a11
Equate the remaining corresponding elements of 2nd row in both sides of (6), l21 u12+ u22= a22
and l21 u13+ u23 = a23
u22 = a22 – (a21 / a11) a12
and u23 = a23– (a21 / a11) a13
Equating the remaining corresponding elements of the third row in both sides of (6), we get , l31 u12+ l32 u22 = a32
and
l31 u13+ l32 u23 + u33= a33
therefore l32= (a32 – (a21 / a11) a12)/ u22
u33 = a33– (a31/ a11) a13  l32 u23
We first determine the first row of U and the first column of L; then the second row of U and the second column of L and lastly the third row of U. Illustration: Solve by method of Triangularisation. 2x+y+4z=12 8x3y+2z=20 4x+11yz=33 Solution: Here
2 8 4
A=
1 3 11
4 2 1
Let L=
1 l21 l31
0 1 l32
be such that Therefore,
0 0 1
and
U=
u 11 u12 u13 0 u22 u23 0 0 u33
LU=A
u11 l21 u11 l31 u11
u12 l21 u12+ u22 l31 u12+ l32 u22
u13 l21 u13+ u23 l31 u13+ l32 u23 + u33
2 =
8 4
1 3 11
4 2 1
Equating the first row elements, u11= 2 , u12=1, u13 = 4 . Equating the first column elements l21 u11 = 8
l31 u11 = 4
l21 = 8/ 2
l31= 4/ 2
=4
=2
Equating the remaining second row elements, l21 u12+ u22 = 3 and l21 u13+ u23 = 2 Therefore , u22 = 34 x 1 = 7 and u23 = 2 4 x 4 = 14 Equating the remaining third row elements, l31 u12+ l32 u22 = 11
and
l31 u13+ l32 u23 + u33 = 1
Therefore l32 = 9/ 7
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
107
u33 = 27
Hence, 1 0 0 4 1 0 2 9/7 1
A=
2 1 4 0 7 14 0 0 27
Hence the given system of equations can be written as, 1 0 4 1 2 9/7
0 0 1
2 0 0
1 4 7 14 0 27
x y z
=
12 20 33
(1)
(i.e) 1 4 2
0 0 1 0 9/7 1
2 0 0
1 7 0
x1 x2 x3
4 14 27
=
x y z
=
12 20 33 x1 x2 x3
(2)
(3)
the system (2) can be resolved by forward substitution. Therefore we have, x1 = 12 x2 = 28 x3=27 (3) becomes, 2 1 4 0 7 14 0 0 27
x y z
=
12 28 27
(4)
Solving (4) by back substitution we have, x=3
,
y=2
,
z=1
4.5 Cholesky method : Procedure: This method is also known as square root method. Consider the system of equations, a11x1+a12x2+a13x3 = b1 a21x1+a22x2+a23x3 = b2 a31x1+a32x2+a33x3 = b3 The above equations can be written in the matrix form as, (1)
AX = B Where A=
a11 a12 a13 a21 a22 a23 a31 a32 a33
X=
x1 x2 x3
B=
b1 b2 b3
If the coefficient matrix A is symmetric and positive definite , then the matrix A can be decomposed as T
A=LL
(2)
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
108
where L= (lij), lij=0, i<j, lower triangle matrix. alternatively, A may be decomposed as A=UU
T
(3)
where U an upper triangle matrix. Equation (1) is
AX = B
Using (2) we have T
LL X = B T
(4)
which may be written by taking, L X = Z
as
(5)
LZ = B
The intermediate solution values zi, i= 1,2,3 are determined from (5) by forward substitution and the solution values xi, i=1,2,3 are determined from (4) by back substitution. 1
Alternatively, only one inverse Lˉ is obtained, 1
Z = Lˉ B T 1 1 T X = (L ) ˉ Z =( Lˉ ) Z
and
The inverse of A is obtained from, 1 1 T 1 Aˉ = ( Lˉ ) Lˉ Hence the Cholesky method. Illustration1: Solve by Cholesky method. 1 2 3
2 8 22
3 22 82
x1 x2 x3
Solution: Since A = LL
A=
1 2 3
2 3 8 22 22 82
5 6  10
=
T
=
l11 l21 l31
0 l22 l32
=
l11 l21 u11 l31 u11
0 0 l323
2
l11 l21 l31 0 l22 l32 0 0 l33 l11 l21 2 2 l21 + l22 l31 l21+ l32 l22
l11 l31 l21 l13+ l22 l32 2 2 2 l31 + l32 + l33
Comparing the corresponding elements on both sides, we get First row:
l
2 11
=1
l11 l21 = 2 l11 l31 = 3 Second row: l
2 2 21 + l 22 =
8 l31 l21 + l32 l22 = 22 Third row:
2
2 2 32 + l 33
l 31 + l T Here we get A = LL , where
L=
1 2 3
= 82
0 2 8
l11 = 1
l21 = 2 l31 = 3
l22 = 2 l32 = 8 l33 = 3
0 0 3
We write the given system of equations as
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
109
T
LL X=b T
Or
L Y = b , where L X = Y.
From LY = b, we obtain 1 2 3
0 2 8
0 0 3
y1 y2 y3
=
5 6 10
x1 x2 x3
5 = 2 3
y3
y1 y2 = 3
5 2
T
From L X =Y, we obtain 1 0 0
2 2 0
3 8 3
x1 x2 x3
2 =
3 1
Hence, x1 = 2 ; x2 = 3 ; x3 = 1. Illustration 2: 1 Solve by Cholesky method, also find A . 4 1 0 0
1 4 1 0
0 1 4 1
0 0 1 4
x1 x2 x3 x4
l11 l21 l31 l41
0 l22 l32 l42
0 0 l33 l43
0 0 0 l44
l11
0
0
0
l11
l21
l31
A = LL = l21
l22
0
0
0
l22
l32
l42
l31
l32
l33
0
0
0
l33
l43
l41
l42
l43
0
0
0
0
=
1 0 0 0
Solution: Let
L=
We write T
2
l
l11l21
11
2 l 21
l21l11 A=
l31l11 l41l11
+
l11l31 2 l 22
l21l31 + l22l32
l41
l44
l11l41 l21l41 + l22l42
l31l21+ l32l22
2 2 2 l 31+l 32+l 33
l41l21+l42l22
2 2 2 2 l41l31+l42l32+l43l33 l 41+l 42+l 43+l 44
l31l41+l32l42+l33l43
Comparing the corresponding elements on both sides, we get. First row:
l11= 2, l21 = 1/2, l31 = 0, l41 = 0.
Second row:
l
2 21
2
+l
22
= 4,
l22 = √ 15/4
l21 l31 + l22 l32 = 1,
l32 = √4/15
l21 l41 + l22 l42 = 0,
l42 = 0,
l33 = √ (56/15)
Third row: 2
l
32
2 32
+l
2 33
+l
= 4,
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
l32l41 + l32l42 + l33l43 = 1,
110
l43 = √ (15/56)
Fourth row: 2
l
+l
41
2 42
2
+l
43
2 44
+l
l44 = √ (209/56)
= 4,
The solution of the system LY = b, that is 2
0
1 2
15 4
0
4 15
0
0
y1
0
0
y2
0
y3
0
y4
0
56 15
15 56
0
0
y1 = ½, y2 =
209 56
1 =
0
60 , y3 = 1 840 , y4 = 1 11704
1
T
The solution vector is now obtained from L X=Z, that is 2
1/2
0
4 15
15 4
0
0
0
0
56 15
0
0
0
x1
1/2 =
1
60
0
x2
15 56
x3
1 840
209 56
x4
1 11704
Back substitution gives the solution x4 = 1/209, x3 = 4/209,
x2 = 15/209, x1 = 56/209
We also find 1/2 1
L =
0
0
60
4 / 15
1/
840
2 / 105
15 / 56
1/
11704
2 / 1463
15 / 11704
1/
1
L
=
0
0
0
0.5
0
0
0.1291
0.5164 0
0
0
56 / 209
0
0.0345
0.1380
0.5176
0
0.0092
0.0370
0.1387 0.5176
Hence we obtain
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 0.2679 1
A
1 T
1
= (L ) L
=
0.0718
0.0718 0.2871
0.0191 0.0766
111
0.0048 0.0192
0.0191
0.0766
0.2871
0.0718
0.0048
0.0192
0.0718
0.2679
Hence the method. ITERATIVE METHOD:
We shall now describe the iterative or indirect method of solving the system of simultaneous linear equations. Iterative methods are those in which the solution is got by successive approximations. Thus in an indirect (or) iterative method, the amount of computation depends on the degree of accuracy required. But the method of iteration is not applicable to all system of equations. In order that the iteration may succeed, each equation of the sytem must contain one large coefficient and it must be attached to a different unknown in that equation. This requirement will be got when the large coefficients are along the leading diagonal of the coefficients matrix.
The two particular methods of iteration are… 1. Gauss Jacobi Method Of Iteration 2. Gauss Siedel Method Of iteration 4.6 Jacobi method of iteration (or) Gauss Jacobi method: Procedure: Consider the system of equations, a 1 x + b1 y + c1 z = d 1
a 2 x + b2 y + c2 z = d2
(1)
a 3 x + b3 y + c3 z = d3 suppose in the above, in each equation, the coefficients of the diagonal terms are larger, compared to other coefficients. Solving for x, y, z respectively ,
1 [ d 1 – b 1 y – c1 z] a1 1 y= [ d 2 – a 2 x – c 2 z] b2 1 z= [ d 3 – a 3 x – b 3 y] c3
x=
(0)
(0)
(2)
(0)
suppose x ,y ,z are initial estimates for the values of the unknowns x,y,z. substituting these values in the RHS of (2), we have a system of 1st iterates given by,
1 (0) (0) [ d 1 – b1 y – c1 z ] a1 1 (1) (0) (0) y = [ d2 – a 2 x – c2 z ] b2 1 (1) (0) (0) z = [ d3 – a 3 x – b3 y ] c3 x
(1)
=
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS (1)
(1)
(1)
112 nd
substituting the values of x ,y ,z
in the RHS of (2), we have a system of 2
iterates
given by,
1 (1) (1) [ d 1 – b1 y – c1 z ] a1 1 (2) (1) (1) y = [ d2 – a 2 x – c2 z ] b2 1 (2) (1) (1) z = [ d3 – a 3 x – b3 y ] c3
x
(2)
=
..... (r)
(r)
(r)
th
if x y , z are the r iterates then, x
=
1 (r) (r) [ d 1 – b1 y – c1 z ] a1
(r+1)
=
1 (r) (r) [ d2 – a 2 x – c2 z ] b2
(r+1)
=
1 (r) (r) [ d3 – a 3 x – b3 y ] c3
(r+1)
y
z
the process is continued till convergence is occurred. Illustration: Solve the following system of equations by Gauss – Jacobi method. 8x  y + z= 18 ; 2x + 5y  2z = 3 ; x + y  3z = 6 Solution: Given: 8x  y + z = 18 2x + 5y  2z = 3 x + y  3z = 6 The given system is diagonally dominant. Solving for x, y, z respectively , x = 1/8 [18 + y – z]
(1) (2) (3) (4)
y = 1/5 [3 + 2z –2x]
(5)
z = 1/3 [6 + x + y]
(6)
Let the initial value be (0, 0, 0). First Iteration: x1 = 18 / 8 = 2.25
.
..
y1 = 3 / 5
= 0.6
z1 = 6 / 3
= 2.0
x1 = 2.25 ; y1 = 0.6 ; z1 = 2.
Second Iteration: x2 = 1/8 [18 + 0.6 – 2]
= 2.075
y2 = 1/5 [3 + 2(2) –2(2.25)] = 0.5 z2 = 1/3 [6 + 2.25 + 0.6 ] .
..
= 2.95
x2 = 2.075 ; y2= 0.5 ; z2 = 2.95.
Third Iteration:
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS x3 = 1/8 [18 + 0.5 – 2.95]
= 1.9438
y3 = 1/5 [3 + 2(2.95) –2(2.075)] = 0.95 z3 = 1/3 [6 + 2.075 + 0.5 ] .
..
= 2.8583
x3 = 1.9438 ; y3 = 0.95 ; z3 = 2.8583.
Continuing in this way, we got the iteration values and the results are tabulated as follows : Iteration
x
y
z
1
2.25
0.6
2.0
2
2.075
0.5
2.95
3
1.9438
0.95
2.8583
4
2.0115
0.9658
2.9646
5
2.00016
0.98125
2.99243
6
1.99860
0.99691
2.99380
7
2.0039
0.99808
2.99850
8
1.99995
0.99924
2.99949
9
1.99997
0.99982
2.99973
10
2.00001
0.99990
2.99993
11
1.99999
0.99996
2.99997
12
1.99999
0.99999
2.99998
th
th
We find that the values in the 11 and 12 iterations are close to each other. So we can stop the iteration process. Hence the values of the system are x= 1.9999, y = 0.9999, z = 2.9999. 4.7 Gauss Siedel method Procedure: Consider the system of equations,
a 1 x + b1 y + c1 z = d 1 a 2 x + b2 y + c2 z = d2
(1)
a 3 x + b3 y + c3 z = d3 Suppose in the above, in each equation, the coefficients of the diagonal terms are larger, compared to other coefficients. Solving for x, y, z respectively ,
1 [ d 1 – b 1 y – c1 z] a1 1 y= [ d 2 – a 2 x – c 2 z] b2 1 z= [ d 3 – a 3 x – b 3 y] c3 x=
(0)
(0)
(0)
Suppose x ,y ,z
(2) (3) (4)
are initial estimates for the values of the unknowns x,y,z.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
113
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
114
Iteration1: (0)
Substituting y
(0)
and z
in the equation (2) we have, x
Then we substitute x
(1)
(1)
=
(0)
for x and z for z in (3) we have, (1)
y = We substitute x
(1)
1 (0) (0) [ d 1 – b1 y – c1 z ] a1 1 (1) (0) [ d2 – a 2 x – c2 z ] b2
(1)
for x and y for y in (4) we have, (1)
z =
1 (1) (1) [ d3 – a 3 x – b3 y ] c3
thus as soon as a new value for a variable is found, it is used immediately for the next iteration..... (r)
(r)
(r)
th
if x y , z are the r iterates then, x
(r+1)
=
1 (r) (r) [ d 1 – b1 y – c1 z ] a1
1 (r+1) (r) [d2 –a2 x – c2 z ] b2 1 (r+1) (r+1) (r+1) z = [ d3 – a3 x – b3 y ] c3 (r+1)
y
=
The process is continued till convergence is occurred. Since the current values of the unknowns at each stage of iteration are used in proceeding to the next stage of iteration. Remark: The convergence in Gauss Siedel method will be more rapid than in Gauss – Jacobi method. The rate of convergence of Gauss – Siedel method is roughly twice that of Gauss – Jacobi. The process of iteration will converge if in each equation of the system, the absolute value of the largest coefficient is greater that the sum of the absolute values of all the remaining coefficients. Example: Solve the following system of equations by Gauss – Siedel method. 28x +4y  z= 32 ; x + 3y +10z = 24 ; 2x +17 y +4z = 35 Solution: Given: (rearrange the given system ) 28x +4 y  z = 32 2x + 17y +4z = 35 x + 3y +10z = 24
(1) (2) (3)
The given system is diagonally dominant. Solving for x, y, z respectively , x = (1/28) [32 4 y + z]
(4)
y = (1/17) [35 4z –2x]
(5)
z = (1/10) [24  x 3y]
(6)
Let the initial value be (0, 0, 0).
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS First Iteration: Put y = z = 0 in (4), x1 = [32 – 0] / 28 = 1.142857 put x = 1.142857 and z = 0 in (5), y1 = (1/17) [ 35 – 4(0) – 2(1.142857) ] = 1.924370 put x = 1.142857 and y = 1.924370 in (6), z1 = (1/10) [24 1.142857 – 3(1.924370)] =1.708403 .
..
x1 =1.142857; y1 = 1.924370 ; z1 =1.708403.
Second Iteration: x2 = (1/28) [ 32 – 4(1.924370)+ 1.708403] =0.928962 y2 = (1/17) [35 2(0.928962)4(1.708403)] =1.547557 z2 = (1/10) [24 – 0.928962 – 3(1.547557)] =1.842837 .
..
x2 =0.928962; y2=1.547557; z2 =1.842837.
Third Iteration: x3 =(1/28) [324(1.547557+1.842837)]
= 0.987593
y3 =(1/17) [35 – 2(0.987593) – 4(1.842837)] = 1.509027 z3 =(1/10) [24 – 0.987593 – 3(1.50927)] .
..
= 1.848533
x3 = 0.987593; y3 = 1.509027; z3 =1.848533.
Fourth Iteration: x4 =(1/28)[32 4(1.509027)+1.848533]
= 0.993301
y4 = (1/17)[35 – 2(0.993301) – 4(1.842837)] = 1.507016 z4 = (1/10)[24 – 0.992201 3(1.507016)] .
..
= 1.848565
x4 =0.993301; y4 =1.507016; z4 = 1.848565.
Fifth Iteration: x5 = (1/28) [32 4(1.507016) +1.848565]
= 0.993589
y5 = (1/17) [35 – 2(0.993589) – 4(1.848565)] = 1.506974 z5 = (1/10) [24 – 0.993589 3(1.506974)]
= 1.848549
x6 = (1/28) [32 – 4(1.506974)+(1.848549)]
=0.993595
y6 = (1/17) [35  2(0.993595) 4(1.818549)]
=1.506977
z6 = (1/10) [24  0.993595 3 (1.506977)]
=1.848547
Sixth Iteration:
The results are tabulated as follows: Iteration
x
y
z
1
1.142857
1.924370
1.708403
2
0.928962
1.547557
1.842837
3
0.987593
1.509027
1.848533
4
0.993301
1.509016
1.848565
5
0.993589
1.506974
1.848549
6
0.993595
1.506977
1.848547
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
115
COMPUTER ORIENTED NUMARICAL & STATIC METHODS th
116
th
The values in 5 and 6 iterations are partially the same to four decimal places. So we can stop the iterative process. Hence the values of the system are x=0.99359, y = 1.50697, z =1.84854. 4.8 Problems: Solve by Gauss elimination method: (i) x+ 2y + z = 3 2x + 3y + 3z = 10 3x â€“ y + 2z = 13 (ii)
3xy+2z =12,
(iii)
x+2y+3z =11,
Ans: (2,1,3) 2x2yz = 2
Ans:(3,1,2)
3.15x1.96y+3.85z =12.95 2.13x+5.12y2.89z =8.61 5.92x+3.05y+2.15z =6.88 Ans:(1.7089, 1.8005, 1.0488)
(iv)
5xy2z =142,
x3yz = 30,
2xy3z = 5 Ans:(39.345,16.785,18.97)
(v) 3x+4y+5z = 18
2xy+8z = 13,
5x2y+7z = 20 Ans:(3,1,1)
Solve by Gauss Jordan method: (i) 2x3y+z=1
(ii) 10x+y+z=12
x+4y+5z=25 3x4y+z=2
12x+10y+z=13 Ans: (8.7,5.7,1.3)
x+y+5z=7
(iii) x+2y+z=3
Ans:(1,1,1)
(iv) 10x+y+z=12
2x+3y+3z=10 3xy+2z=13
x+10y+z=12 Ans:(2,3,4)
x+y+10z=12
(v) 6xy+z=13
Ans:(1,1,1)
vi) 4x+y+3z=11
x+y+z=93
x+4y+2z=11
10x+yz=19
Ans:(2,3,4)
2x+3y+z=7
Ans:(1,1,2)
Solve by triangularization method: (i)
2x+y+3z=13 x+5y+z=14 3x+y+4z=17
Ans :(1,2,3)
(ii) A=
(iii) A=
1 3 1 1 4 2 1 2 3
3 3 6
1 1 1 1 4 3 1 6 3 5 3 4
Ans: (1, 1,1)
Ans :( 1, 1/2,1/2)
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
117
Solve by Cholesky method.
(i)
4 1 0
X1
1 4 1
X2
0
1 4
X3
1 =
0 0
Gauss – Jacobi iteration: (i)Using Gauss – Jacobi iteration method solve the system of equation correct to 4 decimal places. 10x  2y + z = 12 x + 9y  z = 10 2x  y + 11z = 20 Ans: (x = 1.2624 , y = 1.1591 , z = 1.6940) (ii) Using Gauss – Jacobi iteration method solve the system of equation correct to 5 decimal places. 8x  3y + 2z
= 20
6x + 3y + 12z = 35 4x +11y  z
= 20 Ans: (x = 2.99984 , y = 2.000007 , z = 1.00006)
Gauss siedel method: th
(i) Using Gauss siedel method solve the equation and tabulating the results upto 5 iteration. 27x + 6y – z = 85 6x + 15y +2z = 72 x + y +54z
= 110
Ans: (x = 2.4255, y = 3.5730, z=1.9260) th
(ii)Using Gauss siedel method solve the equation and tabulating the results upto 5 iteration. 10x – 5y  2z = 3 4x – 10y +3z = 3 X + 6y + 10z = 3
Ans: (x =0.34147, y = 0.28504, z = 0.50517)
(iii) Solve the system of equations 13p + 5q – 3r + s =18 2p + 12q + r  4s = 13 3p – 4q +10r + s = 29 2p +q 3r +9s = 31 (a) Using Jacobi method proceed upto 9 iterations. (b) Using Siedel method proceed upto 6 iterations. Ans:
(a) p = 1.001 , q = 2.000 , r = 2.999 , s = 4.001 (b) p = 1.000 , q = 1.999 , r = 3.000 , s = 4.000

FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
UNIT – V INTERPOLATION AND APPROXIMATION UNIT STRUCTURE 5.0 Introduction 5.1 Interpolation 5.2 Methods on interpolation 5.2.1 Newton Gregory forward interpolation formula 5.2.2 Newton Gregory backward interpolation formula 5.2.3 Divided differences 5.2.4 Newton’s interpolation formula 5.2.5Lagrange’s interpolation formula 5.3 Numerical differentiation 5.3.1 Derivatives Using Newton’s Forward Formula 5.3.2 Derivatives Using Newton’s Backward Formula 5.3.3 Derivatives Using Stirling’s Formula 5.3.4 Derivatives Using Newton’s divided difference Formula 5.4 Numerical integration 5.4.1. The Trapezoidal Rule 5.4.2 Simpson’s Rule 5.4.3 Romberg’s method 5.5 Problems with Answers
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
118
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
119
5.0 Introduction: The interpolation denotes the process of computing the values of a function for any value of the independent variable within an interval for which some values are given. Extrapolation is the process of finding the values of a function for any value of the independent variable which lies outside the given set of values. In the problem of Numerical Differentiation given the set of values of x and y , we derive formula to the derivatives of the function. The problem of Numerical Integration is solved by first approximating the integrand by a polynomial with the help of an interpolation formula and then integrating the expression between the desired limits. 5.1 Interpolation: The set of tabular values (x0,y0) (x1,y1) … (xn,yn) satisfying the relation y = f(x) where the explicit nature of f(x) is not known, it is required to find a simple function say Φ(x) such that f(x) and Φ(x) agree at the set of tabulated points. Such a process is called “Interpolation”. If Φ(x) is a polynomial then the process is called “Polynomial Interpolation” and Φ(x) is called “Interpolating polynomial”. 5.2 Methods on Interpolation: Interpolation with Equal Intervals : Interpolation is the method of finding the value of y for a given x from the given set of values (xi, y)i. If the values of x’s are given in equal intervals we use the newton’s forward, backward formulae. 5.2.1 Newton Gregory forward interpolation formula: Derivation : Let y = f(x) be a function which takes the values y0, y1, y2, ..........., yn corresponding to x0,x1,................,xn of the independent variable x. Let the values of x be equally spaced. ie., x1=x0+h, x2=x0=2h, ......,xn = x0+nh, where h is the interval of differencing. xi=x0+ih, i= 1,2,..................n Let y(x) be a polynomial of nth degree in x. The same values of y corresponding to x = x0, x1…………xn ie, y(x0) = y0 & y(x1) = y1 ………………….. y(xn) =yn and we can assume that y(x) = A0+A1(xx0)+A2 (xx0) (xx1) +..+ An (xx0) (xx1).(x xn1) where the (n+1) constants A1, A2, …………….An can be determined by putting x = x0, x1,…………………., xn successively in (1), Put x = x0 in (1) y(x0) = A0 y0 = A0 Put x =x1 in (1), y(x1) = A0+A1 (xx0) y1 = A0+A1h y1 = y0 + A1h
A1 =
y1 y 0 y 0 A1 h h
Put x = x2 in (1) y(x2) = A0+A1 (x2x0) + A2 (x2x0) (x2 – x1)
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS y2
120
= A0+A1 (2h) + A2 (2h) (h)
y2
y2
y0 2h A 2 2h h h y0 2y0 2h A2 h y0
2h 2 A 2 y 2 y0 2 y0
y 2 y0 2y1 y0 y 2 2y1 y0 2 y0
A2
2 y 0 2h 2
Similarly by putting x = x3, x4, …………, xn we get
A3
1 3 y 0 1 , ..........., A n n y 0 3 n 3! h n!h
Now substituting these values of A0, A1,…………..,An in (1),
yx y0
y0 x x 0 1 2 2 y0 x x 0 x x1 ............ h 2h
n y 0 x x 0 x x1 ............x x n 1 n!h n y0
x x 0 x x1 2 y ....... x x 0 x x1 .......x x n 1 x x0 y 0 0 h h 2 2! n!h n n y 0
x x 0 x x1 x x 0 h x x 0 , 1 u 1 h h h h u u 1 2 u u 1......u n 1 n yx 0 uh yx y 0 uy 0 y 0 ..... yn 2! n!
Let u =
where u Illustration: Find the value of y and x= 23 from the data given below: x: 20 25 30 35 40 45 y: 354 332 391 360 231 204 Solution: Let u =
x x 0 23 20 3 5 h 5
x 20
Y 354
25
332
∆y
2
∆y
3
∆y
4
∆y
5
∆y
22 19 41 30
291
29 10
31 35
260
37 8
2
45 8
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
x x0 h
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 127 40
121
0
231
2
27 45 204 By Newton forward Gregory interpolation formula is,
uu 1 2 uu 1......u n 1 n y 0 .............. yn 2! n! 3 3 3 1 3 5 1 19 29 y23 354 3 22 5 5 5 5 2! 3! 3 3 1 3 2 3 3 3 3 1 3 2 3 3 3 4 5 5 5 5 5 5 5 37 5 5 4! 5! 66 3 203 777 3213 1,08,4298 = 354 = 19 25 5 125 625 3125 3125 yx y 0 uy 0
y(23) = 346.97. 5.2.2 Newton Gregory backward interpolation formula: Derivation: Let y = f(x) be a function which takes the values y0, y1, ……., yn corresponding to x0, x1,………….., xn of the independent variable x. Let the values of x be equal spaced. ie., x1 = x0+h, x2 = x0+2h, …………………, xn = x0+nh. xi = x0+ih, i= 1,2,……………..,n. th Let y(x) be a polynomial of n degree of x. Taking the same values of yx corresponding to x = x0,x1,………..xn ie., y(x0) = y0, y(x1) = y1, ………………, y(xn) = yn. and we assume that,
yx An A1 x xn A2 x xn x xn1 ............................ An x xn x xn1 ............................ x x1
(1)
where the (n +1) constants can be determined. By putting x = xn in (1)
yx n A n y n A n
Put x = xn1 in (1)
yx n 1 A 0 A1 x n 1 x n
y n 1
y n A1 h
A1h y n y n 1 y n y n 1 h y n A1 h
A1
put x = xn2 in (1)
yx n 2 A 0 A1 x n 2 x n A 2 x n 2 x n x n 2 x n 1
y n 2
yn
y n 2h A 2 2h h h
y n 2y n y n 1 A 2 2h 2
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
2h A 2
2
y n 2 y n 2y n 2y n 1 y n 2 2y n y n 2 y n
A2 Similarly,
A3
122
2 yn 2!h 2
2 yn 2 yn , ................................................, A n 3!h3 h!h n
Now substituting A0, A1, A2,……………..An values in (1),
x xn x x n x x n 1 2 y n yx y n y n .................................. h 2! h2 x x n x x n 1 ....... x x1 n y n n! hn x xn Let us put v h x x n 1 x x n x n x n 1 x x n x n x n 1 h Then, v = v+1 h h h h h x x n 2 x x1 v 2 , .................., v n 1 h h and also vh = x xn x = xn + vh. vv 1v 2.....v n 1 n vv 1 2 yxn vh y n vy n y n ...... y n1 2! n! x xn where v= h Illustration: Find the value of y and x = 17 from the data given below. x : 0 4 8 12 24 y= Tan x : 0 0.0699 0.1405 0.2126 0.4452. Solution: Let v
16
20
0.2867
0.3640
x x n 17 24 7 1.75. h 4 4
x
y
0
0
∆y
2
∆y
3
∆y
4
∆y
5
∆y
6
∆y
0.0699 4
0.0699
0.0007 0.0706
8
0.1405
0.0008 0.0015
0.0721 12
0.2126
0.0005 0.0020
0.0741 16
0.2867
0.3640
0.0010 0.0007
0.0012 0.0032
0.0773 20
0.003
0.0022 0.0012
0.0005 0.0007
0.0039
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
123
0.0812 24
0.4452
By Newton backward Gregory formula is,
vv 1 2 y n .......................... 2! 1.75 0.750.0039 y17 0.4452 1.750.0812 2 1.750.750.25 0.0007 1.75 0.750.251.25 0.005 6 24 1.75 0.750.251.252.25 0.0012 1.75 0.750.251.252.253.25 0.0022 5! 6! yx y n vy n
= 0.44520.1421+0.0026+0+0…….. = 0.3057 ; y(17) = 0.3057. Interpolation with Unequal Intervals: 5.2.3 Divided Differences: Let the function. y = f(x) assume the values f(x 0), f(x1), ……….. f(xn) corresponding to the arguments x0, x1, ……. xn respectively. Where the intervals x1 – x0, x2 – x,……. xn – xn1 need not be equal. st
The 1 divided difference of f(x) for the arguments x 0, x1 is defined as It is denoted by f(x0, x1) or [x0, x1] or
f(x0).
f x 1 f x 0 . x1 x 0
x1
In other words,
f x 0 , x1 x 0 , x1 x f x 0 1
f x1 f x 0 x1 , x 0
(1)
In the same notation we’ve
f x 1 , x 2 x2 f x 1
f x 2 1 f x x 2 , x1
f x n 1 , x 0 x f x n 1 n
f x n f x n 1 x n , x n 1
n 1,2,........................n
nd
The 2 divided difference of f(x) for three arguments x0, x1, x2 is,
f x 0 , x 1 , x 2
2
f x 0
x1,x2
f x 1 , x 2 f x 0 , x 1 x2 x0
(2)
rd
In the same way we define the 3 divided difference of f(x) for the four arguments x0, x1, x 2, x 3 are,
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 3
x1,x2,x3 f x 0 f x 0 , x 1 , x 2 , x 3
124
f x 1 , x 2 , x 3 f x 0 , x 1 , x 2 x3 x0
Illustration:1 Form the divided differences table for the following datas x
:
2
0
3
5
7
8
y=f(x)
:
792
108
72
48
144
252
Solution: We form the table below: x 2
2
∆y
y
∆y
3
∆y
4
∆y
792
108 792 450 0 2 0
60 450 120 3 2
108
72 108 60 30 0
72
48 72 60 53 5
48
144 48 96 75 7
144
24 102 18 5 2 60 60 24 50
96 60 39 73
108 96 60 30
39 24 9 70
4 39 7 83
9 18 3 72
79 2 80
252 144 108 87 8
252
Illustration :2
S.T
3 1 a
abcd
1 abcd
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS Solution: If f(x)
125
= 1/x, f(a) = 1/a
f a , b
1 / a 1 / b 1 / a
1 ab
ba b f b, c f a, b 1 / bc 1 / ab f a, b, c ca ca f(a,b,c,d)
=
1 ca 1 abc c a abc
f b, c, d f a , b, c da
1 1 bcd abc 1 a d 1 = da abcd d a abcd 3
abcd 1 / a
1 abcd
Properties of divided differences: 1. The value of any divided difference is independent of the order of the arguments ie., The divided differences are symmetrical in all their arguments. 2. The Operator ∆ is linear. 3. The nth divided differences of a polynomial of degree n are constants. 5.3 Newton’s interpolation formula (for unequal intervals): Let Y=f(x) take values f(x0), f(x1)…..f(xn) Corresponding to the arguments x0, x1,………, xn
By definition,
f x, x 0
f x f x 0 x x0
f x f x .0 x x 0 f x 1 , x 0
Sly f x, x 0 , x 1
(1)
f x 1 , x 0 f x 0 , x 1 x x1
f x, x 0 f x 0 , x 1 x x 1 f x, x 0 , x 1 Using this value of f(x1, x0) in (1) we’ve f(x) = f(x0) + (xx0) f(x0, x1) + (xx0) (xx1) f(x,x0,x1) Again
f x, x 0 , x 1 , x 2
(2)
f x, x 0 , x 1 f x 0 , x 1 , x 2 x x2
f x, x 0 , x 1 , f x 0 , x 1 , x 2 x x 2 f x, x 0 , x 1 , x 2 Using this value in (2), we get
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
126
f x f 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 2 f x, x 0 , x 1 , x 2
(3)
Continuing in this manner we get, 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 2 f x 0 , x 1 , x 2 , x 3 ....
x x 0 x x1 x x 2 ............x x n 1 f x 0 , x1 , x 2 .........x n x, x 0 x x 1 x x 2 ............x x n f x, x 0 , x 1 .........x n If f(x) is a polynomial of degree n, then
(4)
f x, x 0 , x 1 ,....................x n 0
Equation (4) becomes, 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
(5)
which is the Newton’s divided differences formula . Illustration : Using Newton’s divided difference formula, find the values of f(2), f(8) & f(5) given the following table: x 4 5 7 10 11 13 f(x)
48
100
294
900
1210
2028
Solution : We form the divided differences table since the intervals are unequal. X 4
f(x) 48
4
100
∆f(x)
100 48 52 54
294 100 97 75 7
294
900 294 202 10 7 10
900
1210 900 310 11 10 11
1210
2028 1210 409 13 11 13
2
∆ f(x)
97 52 15 74
202 97 21 10 5
310 202 27 11 7
3
∆ f(x)
4
∆ f(x)
21 15 1 10 4 0
27 21 1 11 5 0 22 27 1 13 7
409 310 33 13 10
2028
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
127
By Newton’s divided difference interpolation formula, 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 2
f x 0 , x 1 , x 2 , x 3 ....................
In our problem,
x0 4
x1 5,
f x 0 48
x2 7
x 3 10,
x 4 11,
f x 0 , x1 52 f x 0 , x1 , x 2 15
x 5 13
f x 0 , x1 , x 2 , x 3 1
Hence, f(x) = 48+(x4)52 + (x4) (x5) (15) + (x4) (x5) (x7) (1) f(2) = 48104+9030 = 4 f(8) = 48+(4) (52) + (4) (3) + (4) (3) (1)1 = 448 f(15) = 48+11x52 + 11x10x15 + 11x10x8 = 3150 5.2.4 Lagrange’s Interpolation Formula : Let y=f(x) be a function such that f(x) takes the values y0, y1,……y2 corresponding to x = x0, x1, x2,…….xn). Ie.,
y i f x i ,
i 0,1,2, .........n
Now, there are (n+1) paired values (x i,yi) i=0,1,2,……n & hence f(x) can be represented by a polynomial function of degree ‘n’ in x. We will select that f(x) as follows.
f x a 0 ( x x 0 ), ( x x 2 )...........(x x n ) a1 ( x
x0 ) ( x x 2 ) ( x x 3 ) .....................(x x n )
a 2 ( x x0 ) ( x
x1 ) ( x x 3 ) ( x x 4 ) .....................(x xn ) a ( x x 0 ) ( x x 1 ).....( x x i 1 ) ( x i 1 ) . ....................( x x n ) ....... i
a n ( x x 0 ) ( x x 1 ) .....................(x x n )
(1)
This is true for all values of x, Substituting in (1), x = x0, y=y0, we get
y 0 a 0 (x 0 x 1 ) ( x 0 x 2 ) .........( x 0 x n )
a0
y0 ( x 0 x 1 ) ( x 0 x 2 )....... ( x 0 x n )
Similarly setting x = x1, y = y1, we’ve
a1
y1 ( x 1 x 0 ) ( x 1 x 2 ) ( x 1 x 3 )....... ( x 1 x n )
In the same way we’get
a2
y2 ( x 2 x 0 ) ( x 2 x 1 ) ( x 2 x 3 )....... ( x 2 x n )
an
yn ( x n x 0 ) ( x n x 1 ) ....... ( x n x n 1 )
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
128
Substituting these values of a’s in (1), we have
y f x
x x 1 x x 2 ................. x x n y x 0 x 1 x 0 x 2 ................. x 0 x n 0 x x 0 x x 2 ................. x x n y ........... x 1 x 0 x 1 x 2 ................. x 1 x n 1 x x 0 x x 2 ................. x x n 1 y x n x 0 x n x 1 ................. x n x n 1 n
This is called Lagrange’s interpolation formula. It is applicable for both equal and unequal intervals. Illustration: Find y(10) from the following table using Lagrange’s interpolation formula. X Y
: :
5 12
6 13
9 14
11 16
Solution:
x x 0 x x 2 ....... x x n x x 1 ....... x x n y0 x 0 x 1 x 0 x 2 ....... x 0 x n x 1 x 0 x 1 x 2 ....... x 1 x n x x 0 x x 1 ....... x x n 1 .............. y x n x 1 x n x 2 ....... x n x n 1 n y
Let
x 0 5;
x 1 6;
x 2 9;
y1
x 3 11 & x 10
y 0 12; y
y1 13;
y 2 14;
y 3 16
x x 1 x x 2 x x 3 x x 0 x x 2 x x 3 y0 y x 0 x 1 x 0 x 2 x 0 x 3 x 1 x 0 x 1 x 2 x 1 x 3 1 x x 0 x x 1 x x 3 x x 0 x x 2 x x 3 y2 y x 2 x 0 x 2 x 1 x 2 x 3 x 3 x 0 x 3 x 1 x 3 x 2 3
10 510 610 11 12 10 510 910 11 (13) 5 65 95 11 6 56 96 11 10 510 610 11 14 10 510 610 9 (16) 9 59 69 11 11 511 91 91 41 1 5 x1x 1 5x4 x 1 14 5x4 x1 16 12 (13) 1 4 6 4 x3x 2 4 x3x 2 6 x5 x2
y(10) = 14.67
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
129
5.3 Numerical Differentiation : Numerical differentiation is the process of calculating the derivatives of a given function by means of a table values of the function. (i.e) if (xi,yi) are the given set of values then the process of computing the values of dy/dx, 2
2
d y/dx ……is called numerical differentiation.
5.3.1 Derivatives Using Newton Forward Formula: Newton’s forward interpolation formula is
f x0 uh f x y0 uy0
u u 1 2 u u 1......u n 1 n y0 ..... yn 2! n! where u
df df du 1 df df hf dx du dx h du du
Differentiating with respect to x we get,
hf ' x0 uh y0
x x0 h
2u 1 2 y
2
2
3
3
(3u 2  6u 2) 3 (2u 3  9u 2 11u  3) 4 y0 y0 .........1 0 6 12
2
3
2
4
h f ′′ (x0+uh) = ∆ y0 + (u1) ∆ y0 + (6u 18u+11) ∆ y0/12 +.......(2) 4
h f′′′ (x0+uh) = ∆ y0 + (2u3) ∆ y0 /2 +……………………….....(3) Similarly we can find all other derivatives. If we want to find the derivatives at a point x=x0 then u = 0 .Hence on substituting this value of u =0 in (1), (2) and (3) we get, 2
3
4
f′(x0) = 1/h[∆y0 – (1/2) ∆ y0 + (1/3) ∆ y0 – (1/4) ∆ y0…. ] 2
2
3
4
f′′(x0) = 1/h [∆ y0  ∆ y0 + (11/12) ∆ y0  …. ] 3
3
(4) (5)
4
f′′′(x0) = 1/h [∆ y0  (3/2) ∆ y0 +…. ]
(6)
5.3.2 Derivatives Using Newton’s Backward interpolation Formula: Newton’s backward difference formula is
f xn vh yn vyn
vv 1 2 vv 1v 2.........v n 1 n yn ....... yn 2! n! where v=
x xn h
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
Differentiating with respect to x, we have,
hf xn vh yn
2v 1 2 y
n
2
df df dv 1 df df hf dx dv dx h dv dv
3v 2 6v 2 3 2v3 9v 2 11v 3 4 yn yn ........7 . 6 12
h2 f xn vh 2 yn (v 1) 3 yn
h 3 f x n vh 3 y n
130
6v 2 18v 11 4 yn .......................8 12
2v 3 4 y n ........................................9 2
Similarly we can find the remaining derivatives. At the point x=xn, we have v=0,
7, 8and 9 becomes
1 1 1 hf ( xn ) yn 2 yn 3 yn 4 yn ....................................10. 2 3 4 h2 f ( xn ) 2 yn 3 yn
h3 f xn
11 4 yn .............................................11. 12
3 yn 3 4 yn .........................................................12 2
5.3.3. Derivatives Using Stirling’s Formula:
u u 2 1 y y 1 u 2 2 yx yx 0 uh y 0 u 0 y 1 2! 2 3! where u =
Differentiating (13) with respect to x we get,
x x0 h
2
y 3
1
3 y 2 u 2 u 2 1 4 y 2 .... 2! 4!
…………..(13)
dy dy du 1 dy 1 dy y dx du dx h du h du
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
2
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
131
1 y y1 3u 2 1 3 2u 3 u 4 2 3 yx yx0 uh 0 u y y y y 2 ... ........14 1 1 2 h 2 12 12
yx yx0 uh
1 h2
y x y x 0 uh
2 u 3 6u 2 1 4 3 y 2 ............... ......................15 y1 y1 y 2 2 12
1 1 3 y 1 3 y 2 u 4 y 2 .... ........... ............16 3 h 2
Similarly we can find the remaining derivatives. If we want to find the derivative at x = x0 then u= 0. (14), (15) and (16) becomes
1 y0 y1 1 3 y1 3 y 2 ............... ............17 h 2 12 1 2 1 4 18 yx yx0 2 y1 y 2 ............... h 12
yx yx0
y x y x 0
1 h3
1 3 3 2 y 1 y 2 .... ...........
19
Similarly the other derivatives can also be found.
Example: 1 Find the first, second, third derivatives of the function tabulated below at the point X = 1.5 x:
1.5
f (x) : 3.375
2
2.5
3
3.5
4
7
13.625
24
38.875
59
Solution: The table of difference is as follows:
x
y =f(x)
1.5
3.375
2
7
∆y
2
∆y
3
∆ y
4
∆y
3.625 3 6.625 2.5
13.625
0.75 3.75
10.375 3
24
4.5 14.875
3.5
0 0.75
38.875
0 0.75
5.25 20.125
4
39
The Newton’s forward difference formula for derivatives at x = x 0 we have,
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 2
3
4
f′(x0) = (1/h)[∆y0 – (1/2) ∆ y0 + (1/3) ∆ y0 – (1/4) ∆ y0…. ] 2
2
3
(1)
4
f′′(x0) = (1/h ) [∆ y0  ∆ y0 + (11/12) ∆ y0  …. ] f′′′(x0) =
3 3 (1/h )[∆ y0 
132
(2)
4
(3/2) ∆ y0 +…. ]
(3)
Here x0=1.5, h=0.5
(1), (2) and (3) becomes f′(1.5) = (1/0.5) [3.625 – (1/2)(3.0)+(1/3)(0.75)] = 4.75 2
f′′(1.5) = (1/(0.5) ) [ 3 0.75] = 9 3
f′′′(1.5) =( 1/(0.5) ) [ 0.75]
=6
Example: 2 The population of a certain town is shown in the following table Year
:
Population : (in thousands)
1931
1941
40.6
60.8
1951 79.9
1961 1971 103.6
132.6
Find the rate of growth of the population in the year 1961. Solution: Rate of growth = rate of change , we have to find first derivative at 1961. The difference table is as follows: X y =f(x) 1931
40.6
1941
60.8
y
2y
3y
4y
20.2 1.1 19.1 1951
79.9
5.7 4.6
23.7 1961
103.6
4.9 0.8
5.4 29.1
1971
132.7
Here h=10, xn = 1971 We know the derivative of Newton backward formula as,
hy xn vh yn
xn+vh = 1961
2v 1 2 y 2
n
3v 2 6v 2 3 2v3 9v 2 11v 3 4 yn yn ........1. 6 12
1971 + 10v = 1961
v = (1961 1971)/10 = 1
Substituting v=1, h=10 in (1) y′( 1961) = (1/10) [29.1 + (1/2) (5.4) + (1/6)(0.8) + (1/12)(4.9)]
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
133
= (1/10) [29.12.70.1334+0.4083] = 2.6775 Example: 3 A function is according to the table given below: x:
0.35
y (x) : 1.521
0.4
0.45
1.506
1.488
0.5
0.55
0.6
0.65
1.467 1.444
1.418
1.389
Find the value of y′( 0.5) Solution: We have to find the value of f′( 0.5) We make use of the Stirling’s formula for derivatives. The difference table is given below: x
y =f(x) y
u
0.35
3
1.521
0.4
2
1.506
2y 3y
4y
5y
0.015 0.003 0.018 0.45
1
1.488
0 0.003
0.001
0.021 0.5
0
1.467
0.55
1
1.444
0.6
2
1.418
0.65
3
1.389
0.001 0.002
0.003 0.002
0.023
0.001 0.003
0.003 0.001
0.026
0 0.003
0.029
Here we have to find the derivative at the point x= 0.5 which is in the middle of the table. Therefore we apply Stirling’s formula for derivatives. Here h=0.05, take x0=0.5 u =
x x0 =0 h
We know that the Stirling’s formula for first derivative is
yx yx0
1 y0 y1 1 3 y1 3 y 2 ............... ............17 h 2 12
=
1 0.023 0.021 1 1 0.001 0.001 0.003 0,003 0.5 2 12 60
=
0.22 =  0.44 0.5
y′(x0) = 0.44
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
134
5.3.4 Differenciatión  unequal intervals: Example: 4 Given the following data,find y′(6) x: 0 2 3 4 7 9 y: 4 26 58 112 466 922 Solution: Since the arguments are not equally spaced,we use divided difference formula or Lagrange’s formula. Divided difference table X
y
0
4
2
26
y
y2
y3
y4
11 7 32 3
58
1 11
54 4
112
16 118
7
0 1
466
0 1
22 228
9
922
By Newton’s divided difference interpolation formula, y f x f x 0 x x 0 f x 0 , x1 x x 0 x x1 f x 0 , x1 , x 2 x x 0 x x1 x x 2
f x 0 , x1 , x 2 , x 3 ....................
y =4 + (x0)11 + (x0)(x2)7 + (x0)9x2)(x3)1 + 0. 3
2
=x + 2x + 3x + 4. 2
y′(x) = 3x + 4x + 3 2
y′(6) = 3(6) + 4(6) + 3 = 135.
5.4 Numerical integration:
b
The exact value of the definite integral ∫a
f(x) dx can be computed only when the
function f(x) is integrable in finite terms .
Whenever the function f(x) cannot be exactly integrated in finite terms , integration can be more conveniently performed by numerical methods.
In such cases , Numerical integration enables us to compute the value of the definite integral .
Amoung the most widely used and most practical procedures for numerical integration , are the Trapezoidal Rule and the Simpson’s Rule .
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
135
5:4.1 The Trapezoidal Rule: Y
C
D y1 0
A
y2 A1
y3 A2
yn+1 An1
B
X
Let DC be the curve whose equation is y = f(x) and let DA and CB be the ordinates of the terminal points D , C of the curve. Let OA = a and OB = b. Then AB = OB – OA = b – a. Divide the segment AB into n equal parts AA1, A1A2, A2A3, . . . , An1B so that each part = ( b – a ) / n = h (say ). Draw the ordinates through A, A1, A2, . . . , An1,B and let them be called y1, y2, . . . , yn, yn+1 (resp). By joining the ends of consecutive ordinates by straight lines, we get n Trapeziums all having the same width. Let A1, A2, . . . ,An be their respective areas. Then A1 = ½( y1 + y2 ) h A2 = ½( y2 + y3 ) h A3 = ½( y3 + y4 ) h : : : An = ½( yn + yn+1 ) h Adding the above equations, The sum of the areas of these trapeziums = h/2 (y1+ y2+ y2+ y3+ y3+ y4+. . .+ yn+ yn+1) = h/2 ( (y1+yn+1) + 2 (y2+ y3+. . . +yn) ) = h/2 (sum of the first and last ordinates+2(sum of the remaining ordinates) ) b
But the whole area ABCD =
y dx
a b
Hence,
y dx = h/2 [ (y1+yn+1) + 2 (y2+ y3+. . . +yn) ]
a
= h/2 [sum of the first and last ordinates + 2(sum of the remaining ordinates) ] This is the well – known trapezoidal rule, so called because it approximates the integral by the sum of n trapezoidals.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
136
Example: 6
x
Solve the integral by trapezoidal rule ,
2
dx .
1
Solution: 2 Here, y = x let us divide the range (1,6) into 5 sub intervals. i.e., n =5 Hence h = (b  a)/ n =(6  1)/ 5 h=1 By Trapezoidal rule, 2
ydx = h/2 ( (y +y 1
n+1)
+ 2 (y2+ y3+. . . +yn) )
1
6
x
2
dx = 1/2 ( (y1+y6) + 2 (y2+ y3+y4+y6) )
1
X y=x
2
1
2
3
4
5
6
1
4
9
16
25
36
( y1
y2 y3
y4
y5
y6 )
6
x
2
dx = 1/2 ( (1 + 36) + 2 (4 + 9 + 16 + 25) )
1
= 1/2 (37 + 2(54)) = 72.5 6
Hence
x
2
dx = 72.5
1
5:4.2 Simpson’s one – third Rule:
Y C
P1
P2
D y1 0
A
y2
y3 A1
A2
y2 n+1 A2n1
B
X
Procedure:
Let DC be the curve whose equation is y = f(x) and let DA and CB be the ordinates of the terminal points D , C of the curve.
Let OA = a and OB = b.
Then AB = OB – OA = b – a.
Divide the segment AB into 2n equal parts such that,
each part = ( b – a ) / n = h (say ).
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
137
Let x1, x2, . . . , x2n+1be the abscissae of the points A, A1, A2, . . .,An1,B and Through these points of division, draw the ordinates y1, y2, . . . , yn, y2n+1 (resp) to the curve.
Now the parabola passing through D,P1 and P2 is a close approximation to the curve D P1 P2.
Hence replace the arc DP1P2 of the curve y = f(x) by an arc of a parabola whose axis is parallel to the y axis.
Hence the area DAA2 P2 is approximately equal to the area under the replacing parabolic arc.
Hence A1=
h (y1 + 4y2 + y3) approximately. 3
Let A1, A2, . . . ,An be their respective areas joining y1, y2, . . . , yn, yn+1. Then by the parabolic rule, A1= h / 3 (y1 + 4y2 + y3) approximately. A2 = h / 3 (y3 + 4y4 + y5) approximately. A3 = h / 3 (y5 + 4y6 + y7) approximately. …………… An = h / 3 (y2n1 + 4y2n + y2n+1) approximately.
Adding the above equations,
The sum of the areas = (h/3) ((y1 + 4y2 + y3)+(y3 + 4y4 + y5)+(y5 + 4y6 + y7)+…+(y2n1 + 4y2n + y2n+1)) = (h/3) ( (y1+y2n+1) + 4(y2+ y4+. . . +y2n) + 2 (y3+ y5+ y7…+y2n1 ) ) = (h/3) ((sum of the first and last ordinates) + 4(sum of the even ordinates) + 2(sum of the odd ordinates) ) b
But the whole area ABCD =
ydx a
b
ydx = (h/3) ( (y +y 1
2n+1)
+ 4(y2+ y4+. . . +y2n) + 2 (y3+ y5+ y7…+y2n1 ) )
a
= (h/3) ( (sum of the first and last ordinates) +4(sum of the even ordinates)+2(sum of the odd ordinates)) This is known as Simpson’s one third rule.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
138
5:4.3 Simpson’s threeeighths rule Putting n=3 in Newtoncotes formula
x3
f ( x)dx h 3 y
0
9 1 9 1 81 y 0 2 y 0 27 9 3 y 0 2 2 2 6 4
x0
9 9 3 h 3 y 0 ( y1 y 0 ) ( E 1) 2 y 0 ( E 1) 3 y 0 2 4 8 9 9 9 3 h 3 y 0 y1 y 0 ( y 2 2 y1 y 0 ( y 3 3 y 2 3 y1 y 0 ) 2 2 4 8 3h [ y 3 3 y 2 3 y1 y 0 ] 8 If n is a multiple of 3, x 0 nh
f ( x)dx
x0 3h
x0
f ( x) dx
xo 6 h
x o nh
x0 3h
x 0 ( n 3) h
f ( x)dx .............
x0
f ( x)dx
3h ( y0 3 y1 3 y2 y3 ) ( y3 3 y4 3 y5 y6 ) ........ ( yn 3 3 yn 2 3 yn 1 yn ) 8 3h ( y0 yn ) 3( y1 y2 y4 y5 ........ yn 1 ) 2( y3 y6 y9 .....) 8
This is called Simpson’s threeeights rule which is applicable only when n is a multiple of 3. Example: Estimate the area of xy = 12 between x=1 and x=4 by the Simpson’s rule. And check the accuracy of the result by integration. Solution: Here, y = 12/x. Let us divide the range (1,4) into 6 sub intervals. i.e., n =6 Hence h = (b  a)/ n =(4  1)/ 5 h = 0.5 x
1.0
1.5
2.0
2.5
3.0
3.5
4.5
y=12/x
12
8
6
4.800
4
3.4286
3
( y0
y1
y2
y3
y4
y5
y6 )
By Simpson’s onethird rule, 4
12 dx = (h/3) ( (y0+y6) + 4(y1+ y3+.y5) + 2 (y2+ y4) ) x 1
Here, 4
12 dx = (0.5/3) ( (12+3) + 4(8+4.8+3.4286) + 2 (6+ 4) ) x 1
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
139
= (0.1667) ( (15)+(64.9143)+(20) ) = (0.1667)(99.9143) = 16.6557 4
Hence
12 dx = 16.6557 . x 1
By Simpson’s threeeights rule, b
ydx = a
3h ( y 0 y n ) 3( y1 y 2 y 4 y5 ... y n1 ) 2( y3 y 6 y9 ...) 8 4
12 3h ( y0 y6 ) 3( y1 y2 y4 y5 ) 2( y3 ) dx = 8 x 1
=
3(0.5) (12 3) 3(8 6 4 3.4286) 2(4.8) 8
= 16.6660875 . Actual integration: 4
12 dx x 1
4
= 12(log x)1
= 12[log 4 – log 1] =12 log4 =12(1.38629) = 16.6355 4
12 dx x 1
= 16.6355
5.4.4 Romberg’s method: Procedure: A simple modification of the Trapezoidal rule can be used to find a better approximation to the value of an integral. This is based on the fact that the truncation error of 2
the Trapezoidal rule is nearly proportional to h . 2
For an interval of size h , error in the Trapezoidal formula = ch . Where c =  (b  a) y″(ξ)
,(a < ξ < b ).
12 If y″(ξ) , the second derivative of y, is reasonably constant, c may be taken to be a constant.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS b
Suppose we evaluate the definite integral I = ∫ a
140
y dx by the Trapezoidal rule with two
different subintervals of h1 and h2 and let the approximate values be I1 and I2 with corresponding errors E1 and E2 respectively. 2
Then
I = I1 + E1 = I1 + ch1
Also
I = I2 + E2 = I2 + ch2
2
.
2
..
2
I1 + ch1 = I2 + ch2
c
.
..
I1 I 2 h1 h2 2
2
I I2 2 h I I 1 21 2 1 h h 2 1
I 1 h2 I 2 h1 2
I
h2 h1 2
2
 (1)
2
This will be a better approximation to I than I1 or I2. This method is called “Richardson’s deferred approach to the limit”. For a systematic evaluation of I using I1 and I2 , we take h1 =h and h2 =h/2 . Then (1) becomes,
I 1h2 I 2 h1 2
I
h2 h1 2
2
2
¼I1 h 2 I 2 h 2 ¼h 2 h 2
I = I2 + ( I2 I1 ) / 3
(2)
We can apply the trapezoidal rule several times, successively halving h. thus every time, the error is reduced by a factor of ¼ .let the successive results be A1 , A2 , A3 , A4 , . . . we apply the formula (2) to each pair of the A’s. i.e., for A1 , A2 ; A2 , A3 ; etc. Let the results be B1, B2, B3, . . . we apply formula (2) to each pair of the B’s and we get new results C1 , C2 . the following array of results is obtained . A1
A2 B1
A3
B2 C1
B3 C2
D1
A4
....
....
....
....
The computation is continued until two successive values are close to each other. This systematic refinement of Richardson’s method is called “Romberg method”.
Illustration:
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 1
Use Romberg’s method , compute an approximate value of Solution:
1
1 x
2
dx correct to 4 decimal places. Hence deduce
0
.
Let us find the value of the given integral by Trapezoidal Rule . And taking h = 0.5, h = 0.25 and h = 0.125 (respectively). Part(i) By Trapezoidal rule, b
y dx = h/2 [ (y1+yn+1) + 2 (y2+ y3+. . . +yn) ]
a 2
Here y = 1/(1 + x ) and h = 0.5; x 2
y= 1/(1 + x )
1
Here,
1
1 x
dx =
2
0
0.0
0.5
1.0
1
0.8
0.5
( y0
y1
y2 )
0 .5 ( (y0+y3) + 2 y1 ) 2 1
1
1 x
Let I =
0 .5 ( (1 + 0.5) + 2 (0.8) ) 2
2
dx =
2
dx = 0.7750
0
= 0.775 1
Hence I =
1
1 x 0
Part(ii) By Trapezoidal rule, b
y dx = h/2 [ (y1+yn+1) + 2 (y2+ y3+. . . +yn) ]
a 2
Here y = 1/(1 + x ) and h = 0.25; x 0 0.25 y
1 (
y1
0.9412 y2 y3
0.5
0.75
1
0.8
0.64
0.25
y4
y5
)
Here, 1
1
1 x
2
0
1
Let I =
1
1 x 0
2
dx =
0.25 ( (y1+y5) + 2 (y2+ y3+y4) ) 2
dx =
141
0.25 ( (1+0.25) + 2 (0.9412+0.8+0.64) 2 = 0.7828
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 1
Hence I =
1
1 x
2
142
dx = 0.7828
0
Part(iii): By Trapezoidal rule, b
y dx = h/2 [ (y1+yn+1) + 2 (y2+ y3+. . . +yn) ]
a 2
Here y = 1/(1 + x ) and h = 0.125; x
0
0.125
0.25
0.375
0.5
0.625
0.75
0.875
1.0
y
1
0.9846
0.9412
0.8767
0.8
0.7191
0.64
0.5664
0.5
( y1
y2
1
Here,
y3 y4
1
1 x
2
dx =
0
I=
y5
y6
y7
y8
y9 )
0.125 ( (y1+y9) + 2 (y2+ y3+y4 +y5+ y6+y7+y8) 2
0.125 ((1+0.5)+2(0.9846+0.9412+0.8767+0.8+0.7191+0.64+0.5664) 2
= 0.78475 1
Hence I =
1
1 x
2
dx = 0.78475.
0
Now we have three different values of the given definite integral. They are tabulated below. (If I1,I2, I3 are these there integrals) I1
I2
I3
0.7750
0.7828
0.78475
We apply the formula I = I2 + ( I2 I1 ) / 3 between I1,I2 and I2,I3. We get two improved values
0.7828
0.7828 0.7750 , 3
( 0.7854 )
0.78475  0.7828 3
0.78475 ,
( 0.7854 )
As these two values are same we conclude that the value of the given integral is 0.7854 Deduction: 1
1
1 x
By Romberg’s method,
2
(a)
dx = 0.7854.
0
1
By actual integration,
1 0 1 x 2 dx =
tan
1
(x)
1
0 1
1
= tan 1  tan 0
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS 1
1
1 x
2
dx = П / 4
143
(b)
0
.
. . From (a) and (b)
П/4
Hence,
= 0.7854 П
= 3.1416 (approximately).
5.9 Problems: Interpolation with equal intervals: Sum(1): Find the number of students who got more marks from the following data by using forward formula marks got: 3040 4050 5060 6070 7080 students : 25 35 22 11 7 [Ans:27] Sum(2): 1.85 Find the value of e by using forward formula x : 1.7 1.8 1.9 2 2.1 2.2 2.3 x y=e : 5.4739 6.0496 6.6859 7.3891 8.1662 9.0250 9.9742 [Ans:6.3598] Sum(3): Estimate the value of sin 38° x : 0 10 20 30 40 sin x : 0 0.17365 0.54202 0.5 0.64276 [Ans:0.61564] Divided difference: Sum(4): Form the divided difference table: X : 1 3 6 11 f(x) : 4 32 224 1344 Central differences: Sum(5): Use Gauss’s forward formula to get f(3.75) given that X : 2.5 3.0 3.5 4 f(x) : 24.145 22.043 20.225 18.644
4.5 5 17.262 16.047 [Ans : 19.407]
Sum(6): Apply Gauss’s forward formula to obtain f(x) at x = 3.5 form the table below: X : 2 3 4 5 f(x) : 2.626 3.454 4.784 6.986 [Ans : 4.033] Sum(7): Apply Gauss’s backward formula to obtain the value of cos 51°42’ form the table below. x 50° 51° 52° 53° 51° y=cosx 0.6428 0.6293 0.6157 0.6018 0.5878 [Ans : 0.6198] Sum(8): 0.644 From the following table, estimate e correct to five decimals using stirling’s formula X 0.61 0.62 0.63 0.64 0.65 0.66 0.67 x e 1.840431 1.858928 1.877610 1.896481 1.915541 1.934792 1.954237 Sum(9): Given the following table, find y(35) by using stirling’s formula. X : 20 30 40 50
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS Y
:
512
439
346
144
243
[Ans: 395] Sum(10): From the following table, using stirling’s formula estimate the value of tan 16° x : 0° 5° 10° 15° 20° 25° y = tan x 0 0.0875 0.1763 0.2679 0.364 0.4663 [Ans : 0.2867]
30° 0.5774
Newton’s formula for unequal intervals: Sum(11): Form the following table find (x) & hence f(6) using newton’s interpolation formula X : 1 2 7 8 F(x) : 1 5 5 4 [Ans: 6.23809] Sum(12): The following table given same relation between steam pressure and temperature Find the pressure at temperature 372.1° T : 361° 367° 378° 378° 399° P : 154.9 167.9 191 212.5 244.5 Lagrange’s formula for unequal intervals Sum(13): Use Lagrange’s formula of interpolation find y(9.5) given: X : 7 8 9 10 Y : 3 1 1 9 [Ans: 3.625] Sum(14): Use Largange’s formula, prove that y1=y30.3 (y5y3) + 0.2 (y3y5) nearly. Sum(15): Use Largange’s formula to fit a polynomial to the data, X : 1 0 2 3 Y : 8 3 1 12 [Ans: 21] Numerical Differentiation: Sum(16): 2 2 Calculate dy/dx, d y/dx at x = 1.35 from the following data: x: 1.1 1.2 1.3 1.4 1.5 1.6 f (x) : 1.62628 0.15584 2.45256 5.39168 9.125 13.83072 [Ans: 29.34, 71.33] Sum(17): Find the first and second derivatives of √x at x=15. x : 15 17 19 21 23
x :
3.873
4.123
4.354
25
4.583 4.796 5 [Ans: 0.12916, 0.00465]
Sum(18): Determine the third derivative of the function tabulated below at the point x = 1.5 x : 1.5 2 2.5 3 3.5 4 f(x) : 3.375 7 13.625 24 38.875 59 Ans: 6 Sum(19): Find the numerical value of the first derivative at x = 0.4 of the function defined as follows: x: 0.1 0.2 0.3 0.4 f (x) : 1.10517 1.22140 1.34986 1.49182 Ans: [f′(0.4) =4.49134]
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
145
Trapezoidal rule: Sum(20): Find the value of integral by Trapezoidal rule. 8
x
1 x
dx
2
(Ans: 1.991)
0
Sum(21): Find the value of the integral using Trapezoidal rule 8
0
x 36 x 2
dx
(Ans: 2.6636)
Sum(22): Using Trapezoidal rule, find the value of the integral varies from 0 to П/2 (take 6 strips ), ∫ x cot x dx (Ans: 0.94934) Sum(23): Using Trapezoidal rule, find the value of the integral varies from 0 to П ∫ sin x dx (Ans: 1.984) Simpson’s Rule: Sum(24): Find the value of integral by Simpson’s rule. 8
x
1 x
2
dx
(Ans: 2.08213)
0
Sum(25): Find the value of the integral using Simpson’s rule. 8
0
x 36 x 2
dx
(Ans: 2.27427)
Sum(26): Using Simpson’s rule, find the value of the integral varies from 0 to П/2 (take 6 strips ), ∫ x cot x dx (Ans: 0.94928)
Sum(27): Using Simpson’s rule, find the value of the integral varies from 0 to П ∫ sin x dx (Ans: 2 approximately) Romberg method: Sum(28): 1
Use Romberg’s method, compute
1
1 x dx
correct to 4 decimal places. Hence deduce an
0
approximate value of loge2. Sum(29): Solve the sums given in Trapezoidal and Simpson’s rule by Romberg’s method.
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
COMPUTER ORIENTED NUMARICAL & STATIC METHODS
THE END
FOR MORE DETAILS VISIT US ON WWW.IMTSINSTITUTE.COM OR CALL ON +919999554621
146
COMPUTERORI ENTEDNUMARI CAL & STATI CMETHODS
Publ i s he dby
I ns t i t ut eofManage me nt& Te c hni c alSt udi e s Addr e s s:E4 1 , Se c t o r 3 , No i da( U. P) www. i mt s i ns t i t ut e . c o m Co nt a c t :+9 1 9 2 1 0 9 8 9 8 9 8
Published on Jun 19, 2014
IMTS PGDCA (Computer oriented numarical & static methods)