Nondeterministic Procedure of Solving Simultaneous Equations
Nondeterministic Procedure of Solving Simultaneous Equations
Nondeterministic Procedure of Solving Simultaneous Equations
Com
Abstract:This paper revises the study of computational complexity of solving the simultaneous equations. An
equation is an expression of the form W1.W2.........Wk=id where each Wi is a variable with operator and id is the identity element. A solution to such an equation is the assignment of variables which realizes the equality. A system of equations is a collection of such equations; a solution is the assignment of values to unknown variables which simultaneously realizes each equation. We show that the problem of determining the solution is NP. The system of simultaneous equations is probably one of the most important topics in modern engineering computations. The paper examines the Methods of solving the Simultaneous Equations. Section 1 presents introduction. Section 2 discusses the Simultaneous Equations solution as NP. Section 3 describes Method of solving Simultaneous equations in detail. Section 4 Concludes.
Many natural computational problems can be viewed as problems about the solvability of certain equations. When asked to characterize computation and to describe all of the problems that are solved through computation, a computer scientist will usually begin by describing a programming language in which to do the computation. Most of us would present an imperative language such as C++, but some might mention functional languages or logic programming languages. All however, would probably then discuss computation in terms of the resources required to perform the required task. There is another way, namely mathematical programming. This is where a problem is defined as the solution to a system of simultaneous equations. In fact, every one of the problems which can be computed using programs written in any favourite languages can also be described in terms of mathematical programming. The term Simultaneous equations or system of equations refer to conditions where two or more unknown variables are related to each other through an equal number of equations. A pair of equations with more than one value to be found is called simultaneous equations. The two equations cannot be solved on their own. Each one by itself has infinitely many solutions. For example x + y = 10 has infinitely many values for x and y for which this is true, like x=1, y=9 or x=10, y=0 or x=100, y=-90, etc. But two equations can be solved together to make one equation that has only one solution. The x and y values of this solution will solve both of the original equations at the same time. This is why they are called simultaneous equations, because of solving them both with the same values for x and y.Systems of simultaneous equations can be found in many engineering applications and problems. Systems that consist of small number of equations can be solved analytically using standard methods from algebra. Systems of large number of equations require the use of numerical methods and computers. The system of simultaneous equations is probably one of the most important topics in modern engineering computations. This is not an exaggeration if one considers that recent technological advances were made possible by the ability of solving larger and larger systems of equations. Few examples of Simultaneous equations are as below: example1 X 1 + 3 X 2 + 2 X 3 = 15 2 X 1 + 4 X 2 + 3 X 3 = 22 3 X 1 + 4 X 2 + 7 X 3 = 39 example2 X 1 + 2 X 2 4 X 3 + .........= 20.1 2 X 1 + X 2 3 X 3 + .........= 2 2 X 1 7 X 2 4 X 3 + .........= 6.5 ........ 8 X 1 2 X 2 + 8 X 3 + .........= 11
49
50
2X1+4X2+3X3 = 22 3X1+4X2+7X3 = 39 Solving the equation using exhaustive search method, X1=1 X2=2 X3 = 4 The exhaustive search method takes large time duration as the Data set range increases (Number to be chosen from the range) ex:- 10 Data set Range indicates that the randomly number to be chosen is from 0 to 10, which takes approximately 16 MilliSeconds as the dataset range increases the execution time increases for 2000 the time is 2047578 MilliSeconds. In reality the Data Set Range happens to be infinity hence the time taken is very very high, hence it is an NP.
51
Nondeterministic Procedure Of Solving Simultaneous Equations III Solving Simultaneous Equations Deterministically:
Problem Transformation: P Problem
NP Problem
The System of Simultaneous equations can be solved by using any of the deterministic procedures like Substitution method, matrix method, graphical method or the Gauss elimination procedure which is feasible to deal with the System of equations of n unknowns. number of unknowns. Substitution Method : Consider a set of linear equations also known as a linear system of equations 2x + y =8 x+y=6 Solving this involves subtracting x + y = 6 from 2x + y = 8 (using the elimination method) to remove the yvariable, then simplifying the resulting equation to find the value of x, then substituting the x-value into either equation to find y. The solution of this system is: x= 2 and y=4, which can also be written as an ordered pair (2, 4), representing on a graph the coordinates of the point of intersection of the two lines represented by the equations. Algorithm overview The process of Gaussian elimination has two parts. The first part (Forward Elimination) reduces a given system to either triangular or echelon form, or results in a degenerate equation, indicating the system has no unique solution but may have multiple solutions (rank<order). This is accomplished through the use of elementary row operations. The second step uses back substitution to find the solution of the system above. Stated equivalently for matrices, the first part reduces a matrix to row echelon form using elementary row operations while the second reduces it to reduced row echelon form, or row canonical form. ALGORITHM : 1. Locate the diagonal element in the pivot column. This element is called the pivot. The row containing the pivot is called the pivot row. Divide every element in the pivot row by the pivot (ie. use E.R.O. #1) to get a new pivot row with a 1 in the pivot position. 2. Get a 0 in each position below the pivot position by subtracting a suitable multiple of the pivot row from each of the rows below it (ie. by using E.R.O. #2). 3. Apply Back substitution method to obtain the values of unknowns. 4. Verify the Solution set. Program : /*Gaussian Elimination.C*/ #include <stdio.h> #include <conio.h> #define N 100 float coeff[N][N+1]; /* Co-efficient inputing variables */ void gauss(int n); /* deterministically solves the equations */ void verify(int x[]); /*Verifies whether the solution set is correct or not */ void main() { int i,j,k; /* Loop variables */ int n; /* Number of equations */ float pivot; /* pivoting variables */ float sum; /* Back substitution sum storing variable */ float x[N]; /* values of the variables i.e. x's */ char ch; /* choice inputing variable */ do
52
53
T i m e in s e c
IV
Conclusion.
The Gaussian elimination can be performed over any field. Gaussian elimination is numerically stable for diagonally dominant or positive-definite matrices. For general matrices, Gaussian elimination is usually considered to be stable.
References:
[1] [2] [3] [4] Ron Larson, Elementary Linear Algebra, 5th Edition, The Pennsylvania State University, The Behrend College Mikael Goldmann, Alexander Russeli, The complexity of solving Equations over finite group, 2003 Gary D. Knott, "Gaussian Elimination and LU-Decomposition", www.civilized.com, Feb 28, 2012 Joseph F. Grcar, Mathematicians of Gaussian Elimination, Notices of the AMS, June 2011
54