Jump to content

System of linear equations

From Wikipedia, the free encyclopedia
A linear system in three variables determines a collection ofplanes.The intersection point is the solution.

Inmathematics,asystem of linear equations(orlinear system) is a collection of two or morelinear equationsinvolving the samevariables.[1][2] For example,

is a system of three equations in the three variablesx,y,z.Asolutionto a linear system is an assignment of values to the variables such that all the equations are simultaneously satisfied. In the example above, a solution is given by theordered triple since it makes all three equations valid.

Linear systems are a fundamental part oflinear algebra,a subject used in most modern mathematics. Computationalalgorithmsfor finding the solutions are an important part ofnumerical linear algebra,and play a prominent role inengineering,physics,chemistry,computer science,andeconomics.Asystem of non-linear equationscan often beapproximatedby a linear system (seelinearization), a helpful technique when making amathematical modelorcomputer simulationof a relativelycomplex system.

Very often, and in this article, thecoefficientsand solutions of the equations are constrained to berealorcomplex numbers,but the theory and algorithms apply to coefficients and solutions in anyfield.For otheralgebraic structures,other theories have been developed. For coefficients and solutions in anintegral domain,such as theringofintegers,seeLinear equation over a ring.For coefficients and solutions that are polynomials, seeGröbner basis.For finding the "best" integer solutions among many, seeInteger linear programming.For an example of a more exotic structure to which linear algebra can be applied, seeTropical geometry.

Elementary examples

[edit]

Trivial example

[edit]

The system of one equation in one unknown

has the solution

However, most interesting linear systems have at least two equations.

Simple nontrivial example

[edit]

The simplest kind of nontrivial linear system involves two equations and two variables:

One method for solving such a system is as follows. First, solve the top equation forin terms of:

Nowsubstitutethis expression forxinto the bottom equation:

This results in a single equation involving only the variable.Solving gives,and substituting this back into the equation foryields.This method generalizes to systems with additional variables (see "elimination of variables" below, or the article onelementary algebra.)

General form

[edit]

A general system ofmlinear equations withnunknownsandcoefficientscan be written as

whereare the unknowns,are the coefficients of the system, andare the constant terms.[3]

Often the coefficients and unknowns arerealorcomplex numbers,butintegersandrational numbersare also seen, as are polynomials and elements of an abstractalgebraic structure.

Vector equation

[edit]

One extremely helpful view is that each unknown is a weight for acolumn vectorin alinear combination.

This allows all the language and theory ofvector spaces(or more generally,modules) to be brought to bear. For example, the collection of all possible linear combinations of the vectors on the left-hand side is called theirspan,and the equations have a solution just when the right-hand vector is within that span. If every vector within that span has exactly one expression as a linear combination of the given left-hand vectors, then any solution is unique. In any event, the span has abasisoflinearly independentvectors that do guarantee exactly one expression; and the number of vectors in that basis (itsdimension) cannot be larger thanmorn,but it can be smaller. This is important because if we havemindependent vectors a solution is guaranteed regardless of the right-hand side, and otherwise not guaranteed.

Matrix equation

[edit]

The vector equation is equivalent to amatrixequation of the form whereAis anm×nmatrix,xis acolumn vectorwithnentries, andbis a column vector withmentries.[4]

The number of vectors in a basis for the span is now expressed as therankof the matrix.

Solution set

[edit]
The solution set for the equationsxy= −1and3x+y= 9is the single point (2, 3).

Asolutionof a linear system is an assignment of values to the variablesx1,x2,...,xnsuch that each of the equations is satisfied. Thesetof all possible solutions is called thesolution set.[5]

A linear system may behave in any one of three possible ways:

  1. The system hasinfinitely many solutions.
  2. The system has aunique solution.
  3. The system hasno solution.

Geometric interpretation

[edit]

For a system involving two variables (xandy), each linear equation determines alineon thexy-plane.Because a solution to a linear system must satisfy all of the equations, the solution set is theintersectionof these lines, and is hence either a line, a single point, or theempty set.

For three variables, each linear equation determines aplaneinthree-dimensional space,and the solution set is the intersection of these planes. Thus the solution set may be a plane, a line, a single point, or the empty set. For example, as three parallel planes do not have a common point, the solution set of their equations is empty; the solution set of the equations of three planes intersecting at a point is single point; if three planes pass through two points, their equations have at least two common solutions; in fact the solution set is infinite and consists in all the line passing through these points.[6]

Fornvariables, each linear equation determines ahyperplaneinn-dimensional space.The solution set is the intersection of these hyperplanes, and is aflat,which may have any dimension lower thann.

General behavior

[edit]
The solution set for two equations in three variables is, in general, a line.

In general, the behavior of a linear system is determined by the relationship between the number of equations and the number of unknowns. Here, "in general" means that a different behavior may occur for specific values of the coefficients of the equations.

  • In general, a system with fewer equations than unknowns has infinitely many solutions, but it may have no solution. Such a system is known as anunderdetermined system.
  • In general, a system with the same number of equations and unknowns has a single unique solution.
  • In general, a system with more equations than unknowns has no solution. Such a system is also known as anoverdetermined system.

In the first case, thedimensionof the solution set is, in general, equal tonm,wherenis the number of variables andmis the number of equations.

The following pictures illustrate this trichotomy in the case of two variables:

One equation Two equations Three equations

The first system has infinitely many solutions, namely all of the points on the blue line. The second system has a single unique solution, namely the intersection of the two lines. The third system has no solutions, since the three lines share no common point.

It must be kept in mind that the pictures above show only the most common case (the general case). It is possible for a system of two equations and two unknowns to have no solution (if the two lines are parallel), or for a system of three equations and two unknowns to be solvable (if the three lines intersect at a single point).

A system of linear equations behave differently from the general case if the equations arelinearly dependent,or if it isinconsistentand has no more equations than unknowns.

Properties

[edit]

Independence

[edit]

The equations of a linear system areindependentif none of the equations can be derived algebraically from the others. When the equations are independent, each equation contains new information about the variables, and removing any of the equations increases the size of the solution set. For linear equations, logical independence is the same aslinear independence.

The equationsx− 2y= −1,3x+ 5y= 8,and4x+ 3y= 7are linearly dependent.

For example, the equations

are not independent — they are the same equation when scaled by a factor of two, and they would produce identical graphs. This is an example of equivalence in a system of linear equations.

For a more complicated example, the equations

are not independent, because the third equation is the sum of the other two. Indeed, any one of these equations can be derived from the other two, and any one of the equations can be removed without affecting the solution set. The graphs of these equations are three lines that intersect at a single point.

Consistency

[edit]
The equations3x+ 2y= 6and3x+ 2y= 12are inconsistent.

A linear system isinconsistentif it has no solution, and otherwise, it is said to beconsistent.[7]When the system is inconsistent, it is possible to derive acontradictionfrom the equations, that may always be rewritten as the statement0 = 1.

For example, the equations

are inconsistent. In fact, by subtracting the first equation from the second one and multiplying both sides of the result by 1/6, we get0 = 1.The graphs of these equations on thexy-plane are a pair ofparallellines.

It is possible for three linear equations to be inconsistent, even though any two of them are consistent together. For example, the equations

are inconsistent. Adding the first two equations together gives3x+ 2y= 2,which can be subtracted from the third equation to yield0 = 1.Any two of these equations have a common solution. The same phenomenon can occur for any number of equations.

In general, inconsistencies occur if the left-hand sides of the equations in a system are linearly dependent, and the constant terms do not satisfy the dependence relation. A system of equations whose left-hand sides are linearly independent is always consistent.

Putting it another way, according to theRouché–Capelli theorem,any system of equations (overdetermined or otherwise) is inconsistent if therankof theaugmented matrixis greater than the rank of thecoefficient matrix.If, on the other hand, the ranks of these two matrices are equal, the system must have at least one solution. The solution is unique if and only if the rank equals the number of variables. Otherwise the general solution haskfree parameters wherekis the difference between the number of variables and the rank; hence in such a case there is an infinitude of solutions. The rank of a system of equations (that is, the rank of the augmented matrix) can never be higher than [the number of variables] + 1, which means that a system with any number of equations can always be reduced to a system that has a number ofindependent equationsthat is at most equal to [the number of variables] + 1.

Equivalence

[edit]

Two linear systems using the same set of variables areequivalentif each of the equations in the second system can be derived algebraically from the equations in the first system, and vice versa. Two systems are equivalent if either both are inconsistent or each equation of each of them is a linear combination of the equations of the other one. It follows that two linear systems are equivalent if and only if they have the same solution set.

Solving a linear system

[edit]

There are severalalgorithmsforsolvinga system of linear equations.

Describing the solution

[edit]

When the solution set is finite, it is reduced to a single element. In this case, the unique solution is described by a sequence of equations whose left-hand sides are the names of the unknowns and right-hand sides are the corresponding values, for example.When an order on the unknowns has been fixed, for example thealphabetical orderthe solution may be described as avectorof values, likefor the previous example.

To describe a set with an infinite number of solutions, typically some of the variables are designated asfree(orindependent,or asparameters), meaning that they are allowed to take any value, while the remaining variables aredependenton the values of the free variables.

For example, consider the following system:

The solution set to this system can be described by the following equations:

Herezis the free variable, whilexandyare dependent onz.Any point in the solution set can be obtained by first choosing a value forz,and then computing the corresponding values forxandy.

Each free variable gives the solution space onedegree of freedom,the number of which is equal to thedimensionof the solution set. For example, the solution set for the above equation is a line, since a point in the solution set can be chosen by specifying the value of the parameterz.An infinite solution of higher order may describe a plane, or higher-dimensional set.

Different choices for the free variables may lead to different descriptions of the same solution set. For example, the solution to the above equations can alternatively be described as follows:

Herexis the free variable, andyandzare dependent.

Elimination of variables

[edit]

The simplest method for solving a system of linear equations is to repeatedly eliminate variables. This method can be described as follows:

  1. In the first equation, solve for one of the variables in terms of the others.
  2. Substitute this expression into the remaining equations. This yields a system of equations with one fewer equation and unknown.
  3. Repeat steps 1 and 2 until the system is reduced to a single linear equation.
  4. Solve this equation, and then back-substitute until the entire solution is found.

For example, consider the following system:

Solving the first equation forxgives,and plugging this into the second and third equation yields

Since the LHS of both of these equations equaly,equating the RHS of the equations. We now have:

Substitutingz= 2 into the second or third equation givesy= 8, and the values ofyandzinto the first equation yieldsx= −15. Therefore, the solution set is the ordered triple.

Row reduction

[edit]

Inrow reduction(also known asGaussian elimination), the linear system is represented as anaugmented matrix[8]

This matrix is then modified usingelementary row operationsuntil it reachesreduced row echelon form.There are three types of elementary row operations:[8]

Type 1:Swap the positions of two rows.
Type 2:Multiply a row by a nonzeroscalar.
Type 3:Add to one row a scalar multiple of another.

Because these operations are reversible, the augmented matrix produced always represents a linear system that is equivalent to the original.

There are several specific algorithms to row-reduce an augmented matrix, the simplest of which areGaussian eliminationandGauss–Jordan elimination.The following computation shows Gauss–Jordan elimination applied to the matrix above:

The last matrix is in reduced row echelon form, and represents the systemx= −15,y= 8,z= 2.A comparison with the example in the previous section on the algebraic elimination of variables shows that these two methods are in fact the same; the difference lies in how the computations are written down.

Cramer's rule

[edit]

Cramer's ruleis an explicit formula for the solution of a system of linear equations, with each variable given by a quotient of twodeterminants.[9]For example, the solution to the system

is given by

For each variable, the denominator is the determinant of thematrix of coefficients,while the numerator is the determinant of a matrix in which one column has been replaced by the vector of constant terms.

Though Cramer's rule is important theoretically, it has little practical value for large matrices, since the computation of large determinants is somewhat cumbersome. (Indeed, large determinants are most easily computed using row reduction.) Further, Cramer's rule has very poor numerical properties, making it unsuitable for solving even small systems reliably, unless the operations are performed in rational arithmetic with unbounded precision.[citation needed]

Matrix solution

[edit]

If the equation system is expressed in the matrix form,the entire solution set can also be expressed in matrix form. If the matrixAis square (hasmrows andn=mcolumns) and has full rank (allmrows are independent), then the system has a unique solution given by

whereis theinverseofA.More generally, regardless of whetherm=nor not and regardless of the rank ofA,all solutions (if any exist) are given using theMoore–Penrose inverseofA,denoted,as follows:

whereis a vector of free parameters that ranges over all possiblen×1 vectors. A necessary and sufficient condition for any solution(s) to exist is that the potential solution obtained usingsatisfy— that is, thatIf this condition does not hold, the equation system is inconsistent and has no solution. If the condition holds, the system is consistent and at least one solution exists. For example, in the above-mentioned case in whichAis square and of full rank,simply equalsand the general solution equation simplifies to

as previously stated, wherehas completely dropped out of the solution, leaving only a single solution. In other cases, though,remains and hence an infinitude of potential values of the free parameter vectorgive an infinitude of solutions of the equation.

Other methods

[edit]

While systems of three or four equations can be readily solved by hand (seeCracovian), computers are often used for larger systems. The standard algorithm for solving a system of linear equations is based on Gaussian elimination with some modifications. Firstly, it is essential to avoid division by small numbers, which may lead to inaccurate results. This can be done by reordering the equations if necessary, a process known aspivoting.Secondly, the algorithm does not exactly do Gaussian elimination, but it computes theLU decompositionof the matrixA.This is mostly an organizational tool, but it is much quicker if one has to solve several systems with the same matrixAbut different vectorsb.

If the matrixAhas some special structure, this can be exploited to obtain faster or more accurate algorithms. For instance, systems with asymmetricpositive definitematrix can be solved twice as fast with theCholesky decomposition.Levinson recursionis a fast method forToeplitz matrices.Special methods exist also for matrices with many zero elements (so-calledsparse matrices), which appear often in applications.

A completely different approach is often taken for very large systems, which would otherwise take too much time or memory. The idea is to start with an initial approximation to the solution (which does not have to be accurate at all), and to change this approximation in several steps to bring it closer to the true solution. Once the approximation is sufficiently accurate, this is taken to be the solution to the system. This leads to the class ofiterative methods.For some sparse matrices, the introduction of randomness improves the speed of the iterative methods.[10]One example of an iterative method is theJacobi method,where the matrixis split into its diagonal componentand its non-diagonal component.An initial guessis used at the start of the algorithm. Each subsequent guess is computed using the iterative equation:

When the difference between guessesandis sufficiently small, the algorithm is said to haveconvergedon the solution.[11]

There is also aquantum algorithm for linear systems of equations.[12]

Homogeneous systems

[edit]

A system of linear equations ishomogeneousif all of the constant terms are zero:

A homogeneous system is equivalent to a matrix equation of the form

whereAis anm×nmatrix,xis a column vector withnentries, and0is thezero vectorwithmentries.

Homogeneous solution set

[edit]

Every homogeneous system has at least one solution, known as thezero(ortrivial) solution, which is obtained by assigning the value of zero to each of the variables. If the system has anon-singular matrix(det(A) ≠ 0) then it is also the only solution. If the system has a singular matrix then there is a solution set with an infinite number of solutions. This solution set has the following additional properties:

  1. Ifuandvare twovectorsrepresenting solutions to a homogeneous system, then the vector sumu+vis also a solution to the system.
  2. Ifuis a vector representing a solution to a homogeneous system, andris anyscalar,thenruis also a solution to the system.

These are exactly the properties required for the solution set to be alinear subspaceofRn.In particular, the solution set to a homogeneous system is the same as thenull spaceof the corresponding matrixA.

Relation to nonhomogeneous systems

[edit]

There is a close relationship between the solutions to a linear system and the solutions to the corresponding homogeneous system:

Specifically, ifpis any specific solution to the linear systemAx=b,then the entire solution set can be described as

Geometrically, this says that the solution set forAx=bis atranslationof the solution set forAx=0.Specifically, theflatfor the first system can be obtained by translating thelinear subspacefor the homogeneous system by the vectorp.

This reasoning only applies if the systemAx=bhas at least one solution. This occurs if and only if the vectorblies in theimageof thelinear transformationA.

See also

[edit]

References

[edit]
  1. ^Anton (1987),p. 2;Burden & Faires (1993),p. 324;Golub & Van Loan (1996),p. 87;Harper (1976),p. 57.
  2. ^https://www.britannica.com/science/system-of-equations
  3. ^Beauregard & Fraleigh (1973),p. 65.
  4. ^Beauregard & Fraleigh (1973),pp. 65–66.
  5. ^"Systems of Linear Equations"(PDF).math.berkeley.edu.
  6. ^Cullen (1990),p. 3.
  7. ^Whitelaw (1991),p.70.
  8. ^abBeauregard & Fraleigh (1973),p. 68.
  9. ^Sterling (2009),p.235.
  10. ^Hartnett, Kevin (8 March 2021)."New Algorithm Breaks Speed Limit for Solving Linear Equations".Quanta Magazine.Retrieved9 March2021.
  11. ^"Jacobi Method".
  12. ^Harrow, Hassidim & Lloyd (2009).

Bibliography

[edit]

Further reading

[edit]
  • Axler, Sheldon Jay (1997).Linear Algebra Done Right(2nd ed.). Springer-Verlag.ISBN0-387-98259-0.
  • Lay, David C. (August 22, 2005).Linear Algebra and Its Applications(3rd ed.). Addison Wesley.ISBN978-0-321-28713-7.
  • Meyer, Carl D. (February 15, 2001).Matrix Analysis and Applied Linear Algebra.Society for Industrial and Applied Mathematics (SIAM).ISBN978-0-89871-454-8.Archived fromthe originalon March 1, 2001.
  • Poole, David (2006).Linear Algebra: A Modern Introduction(2nd ed.). Brooks/Cole.ISBN0-534-99845-3.
  • Anton, Howard (2005).Elementary Linear Algebra (Applications Version)(9th ed.). Wiley International.
  • Leon, Steven J. (2006).Linear Algebra With Applications(7th ed.). Pearson Prentice Hall.
  • Strang, Gilbert(2005).Linear Algebra and Its Applications.
  • Peng, Richard; Vempala, Santosh S. (2024). "Solving Sparse Linear Systems Faster than Matrix Multiplication".Comm. ACM.67(7): 79–86.arXiv:2007.10254.doi:10.1145/3615679.
[edit]