Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
System of linear equations
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Several equations of degree 1 to be solved simultaneously}} {{Use American English|date=February 2025}} {{Use mdy dates|date=February 2025}} {{More footnotes|date=October 2015}} [[File:Secretsharing 3-point.svg|thumb|A linear system in three variables determines a collection of [[plane (mathematics)|planes]]. The intersection point is the solution.]] In [[mathematics]], a '''system of linear equations''' (or '''linear system''') is a collection of two or more [[linear equation]]s involving the same [[variable (math)|variable]]s.{{sfnmp |1a1= Anton |1y=1987 |1p=2 |2a1=Burden |2a2=Faires |2y=1993 |2p=324 |3a1=Golub |3a2=Van Loan |3y=1996 |3p=87 |4a1=Harper |4y=1976 |4p=57 }}<ref>{{cite encyclopedia |url=https://www.britannica.com/science/system-of-equations |title=System of Equations |encyclopedia=Britannica |access-date=August 26, 2024 }}</ref> For example, : <math>\begin{cases} 3x+2y-z=1\\ 2x-2y+4z=-2\\ -x+\frac{1}{2}y-z=0 \end{cases}</math> is a system of three equations in the three variables {{math|''x'', ''y'', ''z''}}. A ''[[Solution (mathematics)|solution]]'' to 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 the [[Tuple|ordered triple]] <math>(x,y,z)=(1,-2,-2),</math> since it makes all three equations valid. Linear systems are a fundamental part of [[linear algebra]], a subject used in most modern mathematics. Computational [[algorithm]]s for finding the solutions are an important part of [[numerical linear algebra]], and play a prominent role in [[engineering]], [[physics]], [[chemistry]], [[computer science]], and [[economics]]. A [[Nonlinear system|system of non-linear equations]] can often be [[Approximation|approximated]] by a linear system (see [[linearization]]), a helpful technique when making a [[mathematical model]] or [[computer simulation]] of a relatively [[complex system]]. Very often, and in this article, the [[coefficient]]s and solutions of the equations are constrained to be [[Real number|real]] or [[complex number]]s, but the theory and algorithms apply to coefficients and solutions in any [[field (mathematics)|field]]. For other [[algebraic structure]]s, other theories have been developed. For coefficients and solutions in an [[integral domain]], such as the [[Ring (mathematics)|ring]] of [[integer]]s, see [[Linear equation over a ring]]. For coefficients and solutions that are polynomials, see [[Gröbner basis]]. For finding the "best" integer solutions among many, see [[Integer linear programming]]. For an example of a more exotic structure to which linear algebra can be applied, see [[Tropical geometry]]. ==Elementary examples== ===Trivial example=== The system of one equation in one unknown : <math>2x = 4</math> has the solution : <math>x = 2.</math> However, most interesting linear systems have at least two equations. ===Simple nontrivial example=== The simplest kind of nontrivial linear system involves two equations and two variables: : <math>\begin{alignat}{5} 2x &&\; + \;&& 3y &&\; = \;&& 6 & \\ 4x &&\; + \;&& 9y &&\; = \;&& 15&. \end{alignat}</math> One method for solving such a system is as follows. First, solve the top equation for <math>x</math> in terms of <math>y</math>: : <math>x = 3 - \frac{3}{2}y.</math> Now [[substitution (algebra)|substitute]] this expression for ''x'' into the bottom equation: : <math>4\left( 3 - \frac{3}{2}y \right) + 9y = 15.</math> This results in a single equation involving only the variable <math>y</math>. Solving gives <math>y = 1</math>, and substituting this back into the equation for <math>x</math> yields <math>x = \frac{3}{2}</math>. This method generalizes to systems with additional variables (see "elimination of variables" below, or the article on [[elementary algebra]].) ==General form== A general system of ''m'' linear equations with ''n'' [[Variable (mathematics)|unknowns]] and [[coefficient]]s can be written as :<math>\begin{cases} a_{11} x_1 + a_{12} x_2 +\dots + a_{1n} x_n = b_1 \\ a_{21} x_1 + a_{22} x_2 + \dots + a_{2n} x_n = b_2 \\ \vdots\\ a_{m1} x_1 + a_{m2} x_2 + \dots + a_{mn} x_n = b_m, \end{cases}</math> where <math>x_1, x_2,\dots,x_n</math> are the unknowns, <math>a_{11},a_{12},\dots,a_{mn}</math> are the coefficients of the system, and <math>b_1,b_2,\dots,b_m</math> are the constant terms.{{sfnp|Beauregard|Fraleigh|1973|p=65}} Often the coefficients and unknowns are [[Real number|real]] or [[complex number]]s, but [[integer]]s and [[rational number]]s are also seen, as are polynomials and elements of an abstract [[algebraic structure]]. ===Vector equation=== One extremely helpful view is that each unknown is a weight for a [[column vector]] in a [[linear combination]]. :<math> x_1\begin{bmatrix}a_{11}\\a_{21}\\ \vdots \\a_{m1}\end{bmatrix} + x_2\begin{bmatrix}a_{12}\\a_{22}\\ \vdots \\a_{m2}\end{bmatrix} + \dots + x_n\begin{bmatrix}a_{1n}\\a_{2n}\\ \vdots \\a_{mn}\end{bmatrix} = \begin{bmatrix}b_1\\b_2\\ \vdots \\b_m\end{bmatrix} </math> This allows all the language and theory of ''[[vector space]]s'' (or more generally, ''[[Module (mathematics)|modules]]'') to be brought to bear. For example, the collection of all possible linear combinations of the vectors on the [[Sides of an equation|left-hand side]] (LHS) is called their ''[[Span (linear algebra)|span]]'', 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 a ''[[basis (linear algebra)|basis]]'' of [[linearly independent]] vectors that do guarantee exactly one expression; and the number of vectors in that basis (its ''[[dimension (linear algebra)|dimension]]'') cannot be larger than ''m'' or ''n'', but it can be smaller. This is important because if we have ''m'' independent vectors a solution is guaranteed regardless of the right-hand side (RHS), and otherwise not guaranteed. ===Matrix equation=== The vector equation is equivalent to a [[matrix (mathematics)|matrix]] equation of the form <math display="block"> A\mathbf{x} = \mathbf{b} </math> where ''A'' is an ''m''×''n'' matrix, '''x''' is a [[column vector]] with ''n'' entries, and '''b''' is a column vector with ''m'' entries.{{sfnp|Beauregard| Fraleigh|1973|pp=65–66}} <math display="block"> A= \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix},\quad \mathbf{x}= \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix},\quad \mathbf{b}= \begin{bmatrix} b_1 \\ b_2 \\ \vdots \\ b_m \end{bmatrix}. </math> The number of vectors in a basis for the span is now expressed as the ''[[rank (linear algebra)|rank]]'' of the matrix. ==Solution set== [[File:Intersecting Lines.svg|thumb|The solution set for the equations {{nowrap|''x'' − ''y'' {{=}} −1}} and {{nowrap|3''x'' + ''y'' {{=}} 9}} is the single point (2, 3).]] A ''[[Solution (mathematics)|solution]]'' of a linear system is an assignment of values to the variables <math>x_1, x_2,\dots,x_n</math> such that each of the equations is satisfied. The [[Set (mathematics)|set]] of all possible solutions is called the ''[[solution set]]''.<ref>{{Cite web |title=Systems of Linear Equations |url=https://math.berkeley.edu/~arash/54/notes/01_01.pdf |website=math.berkeley.edu |access-date=February 3, 2025 }}</ref> A linear system may behave in any one of three possible ways: # The system has ''infinitely many solutions''. # The system has a ''unique solution''. # The system has ''no solution''. ===Geometric interpretation=== For a system involving two variables (''x'' and ''y''), each linear equation determines a [[line (mathematics)|line]] on the ''xy''-[[Cartesian coordinate system|plane]]. Because a solution to a linear system must satisfy all of the equations, the solution set is the [[intersection (set theory)|intersection]] of these lines, and is hence either a line, a single point, or the [[empty set]]. For three variables, each linear equation determines a [[plane (mathematics)|plane]] in [[three-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.{{sfnp|Cullen|1990|p=3}} For ''n'' variables, each linear equation determines a [[hyperplane]] in [[n-dimensional space|''n''-dimensional space]]. The solution set is the intersection of these hyperplanes, and is a [[flat (geometry)|flat]], which may have any dimension lower than ''n''. ===General behavior=== [[File:Intersecting Planes 2.svg|thumb|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 an [[underdetermined 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 an [[overdetermined system]]. In the first case, the [[dimension]] of the solution set is, in general, equal to {{nowrap|''n'' − ''m''}}, where ''n'' is the number of variables and ''m'' is the number of equations. The following pictures illustrate this trichotomy in the case of two variables: :{| class="wikitable" |- | width="150" align="center" | [[File:One Line.svg|120px]] | width="150" align="center" | [[File:Two Lines.svg|120px]] | width="150" align="center" | [[File:Three Lines.svg|120px]] |- | align="center" | One equation | align="center" | Two equations | align="center" | 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 are ''[[linear independence|linearly dependent]]'', or if it is ''[[#Consistency|inconsistent]]'' and has no more equations than unknowns. ==Properties== ===Independence=== The equations of a linear system are '''independent''' if 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 as [[linear independence]]. [[File:Three Intersecting Lines.svg|thumb|The equations {{nowrap|''x'' − 2''y'' {{=}} −1}}, {{nowrap|3''x'' + 5''y'' {{=}} 8}}, and {{nowrap|4''x'' + 3''y'' {{=}} 7}} are linearly dependent.]] For example, the equations : <math>3x+2y=6\;\;\;\;\text{and}\;\;\;\;6x+4y=12</math> 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 : <math>\begin{alignat}{5} x &&\; - \;&& 2y &&\; = \;&& -1 & \\ 3x &&\; + \;&& 5y &&\; = \;&& 8 & \\ 4x &&\; + \;&& 3y &&\; = \;&& 7 & \end{alignat}</math> 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=== {{See also|Consistent and inconsistent equations}} [[File:Parallel Lines.svg|thumb|The equations {{nowrap|3''x'' + 2''y'' {{=}} 6}} and {{nowrap|3''x'' + 2''y'' {{=}} 12}} are inconsistent.]] A linear system is '''inconsistent''' if it has no solution, and otherwise, it is said to be '''consistent'''.{{sfnp|Whitelaw|1991|p=[https://books.google.com/books?id=6M_kDzA7-qIC&pg=PA70 70]}} When the system is inconsistent, it is possible to derive a [[contradiction]] from the equations, that may always be rewritten as the statement {{nowrap|0 {{=}} 1}}. For example, the equations : <math>3x+2y=6\;\;\;\;\text{and}\;\;\;\;3x+2y=12</math> are inconsistent. In fact, by subtracting the first equation from the second one and multiplying both sides of the result by 1/6, we get {{nowrap|0 {{=}} 1}}. The graphs of these equations on the ''xy''-plane are a pair of [[parallel (geometry)|parallel]] lines. It is possible for three linear equations to be inconsistent, even though any two of them are consistent together. For example, the equations : <math>\begin{alignat}{7} x &&\; + \;&& y &&\; = \;&& 1 & \\ 2x &&\; + \;&& y &&\; = \;&& 1 & \\ 3x &&\; + \;&& 2y &&\; = \;&& 3 & \end{alignat}</math> are inconsistent. Adding the first two equations together gives {{nowrap|3''x'' + 2''y'' {{=}} 2}}, which can be subtracted from the third equation to yield {{nowrap|0 {{=}} 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 the [[Rouché–Capelli theorem]], any system of equations (overdetermined or otherwise) is inconsistent if the [[rank (linear algebra)|rank]] of the [[augmented matrix]] is greater than the rank of the [[coefficient 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 has ''k'' free parameters where ''k'' is 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 of [[independent equation]]s that is at most equal to [the number of variables] + 1. ===Equivalence=== Two linear systems using the same set of variables are '''equivalent''' if 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== There are several [[algorithm]]s for [[equation solving|solving]] a system of linear equations. ===Describing the solution=== 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 <math>(x=3, \;y=-2,\; z=6)</math>. When an order on the unknowns has been fixed, for example the [[alphabetical order]] the solution may be described as a [[vector space|vector]] of values, like <math>(3, \,-2,\, 6)</math> for the previous example. To describe a set with an infinite number of solutions, typically some of the variables are designated as '''free''' (or '''independent''', or as '''parameters'''), meaning that they are allowed to take any value, while the remaining variables are '''dependent''' on the values of the free variables. For example, consider the following system: :<math>\begin{alignat}{7} x &&\; + \;&& 3y &&\; - \;&& 2z &&\; = \;&& 5 & \\ 3x &&\; + \;&& 5y &&\; + \;&& 6z &&\; = \;&& 7 & \end{alignat}</math> The solution set to this system can be described by the following equations: :<math>x=-7z-1\;\;\;\;\text{and}\;\;\;\;y=3z+2\text{.}</math> Here ''z'' is the free variable, while ''x'' and ''y'' are dependent on ''z''. Any point in the solution set can be obtained by first choosing a value for ''z'', and then computing the corresponding values for ''x'' and ''y''. Each free variable gives the solution space one [[degree of freedom]], the number of which is equal to the [[dimension]] of 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 parameter ''z''. 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: :<math>y=-\frac{3}{7}x + \frac{11}{7}\;\;\;\;\text{and}\;\;\;\;z=-\frac{1}{7}x-\frac{1}{7}\text{.}</math> Here ''x'' is the free variable, and ''y'' and ''z'' are dependent. ===Elimination of variables=== The simplest method for solving a system of linear equations is to repeatedly eliminate variables. This method can be described as follows: # In the first equation, solve for one of the variables in terms of the others. # Substitute this expression into the remaining equations. This yields a system of equations with one fewer equation and unknown. # Repeat steps 1 and 2 until the system is reduced to a single linear equation. # Solve this equation, and then back-substitute until the entire solution is found. For example, consider the following system: : <math>\begin{cases} x+3y-2z=5\\ 3x+5y+6z=7\\ 2x+4y+3z=8 \end{cases}</math> Solving the first equation for ''x'' gives <math>x=5+2z-3y</math>, and plugging this into the second and third equation yields : <math>\begin{cases} y=3z+2\\ y=\tfrac{7}{2}z+1 \end{cases}</math> Since the LHS of both of these equations equal ''y'', equating the RHS of the equations. We now have: : <math>\begin{align} 3z+2=\tfrac{7}{2}z+1\\ \Rightarrow z=2 \end{align}</math> Substituting ''z'' = 2 into the second or third equation gives ''y'' = 8, and the values of ''y'' and ''z'' into the first equation yields ''x'' = −15. Therefore, the solution set is the ordered triple <math>(x,y,z)=(-15,8,2) </math>. ===Row reduction=== {{Main|Gaussian elimination}} In '''row reduction''' (also known as '''Gaussian elimination'''), the linear system is represented as an [[augmented matrix]]{{sfnp|Beauregard|Fraleigh|1973|p=68}} :<math>\left[\begin{array}{rrr|r} 1 & 3 & -2 & 5 \\ 3 & 5 & 6 & 7 \\ 2 & 4 & 3 & 8 \end{array}\right]\text{.} </math> This matrix is then modified using [[elementary row operations]] until it reaches [[reduced row echelon form]]. There are three types of elementary row operations:{{sfnp|Beauregard|Fraleigh|1973|p=68}} :'''Type 1''': Swap the positions of two rows. :'''Type 2''': Multiply a row by a nonzero [[scalar (mathematics)|scalar]]. :'''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 are [[Gaussian elimination]] and [[Gauss–Jordan elimination]]. The following computation shows Gauss–Jordan elimination applied to the matrix above: :<math>\begin{align}\left[\begin{array}{rrr|r} 1 & 3 & -2 & 5 \\ 3 & 5 & 6 & 7 \\ 2 & 4 & 3 & 8 \end{array}\right]&\sim \left[\begin{array}{rrr|r} 1 & 3 & -2 & 5 \\ 0 & -4 & 12 & -8 \\ 2 & 4 & 3 & 8 \end{array}\right]\sim \left[\begin{array}{rrr|r} 1 & 3 & -2 & 5 \\ 0 & -4 & 12 & -8 \\ 0 & -2 & 7 & -2 \end{array}\right]\sim \left[\begin{array}{rrr|r} 1 & 3 & -2 & 5 \\ 0 & 1 & -3 & 2 \\ 0 & -2 & 7 & -2 \end{array}\right] \\ &\sim \left[\begin{array}{rrr|r} 1 & 3 & -2 & 5 \\ 0 & 1 & -3 & 2 \\ 0 & 0 & 1 & 2 \end{array}\right]\sim \left[\begin{array}{rrr|r} 1 & 3 & -2 & 5 \\ 0 & 1 & 0 & 8 \\ 0 & 0 & 1 & 2 \end{array}\right]\sim \left[\begin{array}{rrr|r} 1 & 3 & 0 & 9 \\ 0 & 1 & 0 & 8 \\ 0 & 0 & 1 & 2 \end{array}\right]\sim \left[\begin{array}{rrr|r} 1 & 0 & 0 & -15 \\ 0 & 1 & 0 & 8 \\ 0 & 0 & 1 & 2 \end{array}\right].\end{align}</math> The last matrix is in reduced row echelon form, and represents the system {{nowrap|''x'' {{=}} −15}}, {{nowrap|''y'' {{=}} 8}}, {{nowrap|''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=== {{Main|Cramer's rule}} '''Cramer's rule''' is an explicit formula for the solution of a system of linear equations, with each variable given by a quotient of two [[determinant]]s.{{sfnp|Sterling|2009|p=[https://books.google.com/books?id=PsNJ1alC-bsC&pg=PA235 235]}} For example, the solution to the system :<math>\begin{alignat}{7} x &\; + &\; 3y &\; - &\; 2z &\; = &\; 5 \\ 3x &\; + &\; 5y &\; + &\; 6z &\; = &\; 7 \\ 2x &\; + &\; 4y &\; + &\; 3z &\; = &\; 8 \end{alignat}</math> is given by :<math> x=\frac {\, \begin{vmatrix}5&3&-2\\7&5&6\\8&4&3\end{vmatrix} \,} {\, \begin{vmatrix}1&3&-2\\3&5&6\\2&4&3\end{vmatrix} \,} ,\;\;\;\; y=\frac {\, \begin{vmatrix}1&5&-2\\3&7&6\\2&8&3\end{vmatrix} \,} {\, \begin{vmatrix}1&3&-2\\3&5&6\\2&4&3\end{vmatrix} \,} ,\;\;\;\; z=\frac {\, \begin{vmatrix}1&3&5\\3&5&7\\2&4&8\end{vmatrix} \,} {\, \begin{vmatrix}1&3&-2\\3&5&6\\2&4&3\end{vmatrix} \,}. </math> For each variable, the denominator is the determinant of the [[matrix 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|date=March 2017}} ===Matrix solution=== If the equation system is expressed in the matrix form <math>A\mathbf{x}=\mathbf{b}</math>, the entire solution set can also be expressed in matrix form. If the matrix ''A'' is square (has ''m'' rows and ''n''=''m'' columns) and has full rank (all ''m'' rows are independent), then the system has a unique solution given by : <math>\mathbf{x}=A^{-1}\mathbf{b}</math> where <math>A^{-1}</math> is the [[matrix inverse|inverse]] of ''A''. More generally, regardless of whether ''m''=''n'' or not and regardless of the rank of ''A'', all solutions (if any exist) are given using the [[Moore–Penrose inverse]] of ''A'', denoted <math>A^+</math>, as follows: : <math>\mathbf{x}=A^+ \mathbf{b} + \left(I - A^+ A\right)\mathbf{w}</math> where <math>\mathbf{w}</math> is a vector of free parameters that ranges over all possible ''n''×1 vectors. A necessary and sufficient condition for any solution(s) to exist is that the potential solution obtained using <math>\mathbf{w}=\mathbf{0}</math> satisfy <math>A\mathbf{x}=\mathbf{b}</math> — that is, that <math>AA^+ \mathbf{b}=\mathbf{b}.</math> If 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 which ''A'' is square and of full rank, <math>A^+</math> simply equals <math>A^{-1}</math> and the general solution equation simplifies to : <math>\mathbf{x}=A^{-1}\mathbf{b} + \left(I - A^{-1}A\right)\mathbf{w} = A^{-1}\mathbf{b} + \left(I-I\right)\mathbf{w} = A^{-1}\mathbf{b}</math> as previously stated, where <math>\mathbf{w}</math> has completely dropped out of the solution, leaving only a single solution. In other cases, though, <math>\mathbf{w}</math> remains and hence an infinitude of potential values of the free parameter vector <math>\mathbf{w}</math> give an infinitude of solutions of the equation. ===Other methods=== {{Further|Numerical solution of linear systems}} While systems of three or four equations can be readily solved by hand (see [[Cracovian]]), 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 as [[Pivot element|''pivoting'']]. Secondly, the algorithm does not exactly do Gaussian elimination, but it computes the [[LU decomposition]] of the matrix ''A''. This is mostly an organizational tool, but it is much quicker if one has to solve several systems with the same matrix ''A'' but different vectors '''b'''. If the matrix ''A'' has some special structure, this can be exploited to obtain faster or more accurate algorithms. For instance, systems with a [[symmetric matrix|symmetric]] [[positive-definite matrix|positive definite]] matrix can be solved twice as fast with the [[Cholesky decomposition]]. [[Levinson recursion]] is a fast method for [[Toeplitz matrix|Toeplitz matrices]]. Special methods exist also for matrices with many zero elements (so-called [[sparse matrix|sparse 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 of [[iterative method]]s. For some sparse matrices, the introduction of randomness improves the speed of the iterative methods.<ref>{{cite news |last1=Hartnett |first1=Kevin |title=New Algorithm Breaks Speed Limit for Solving Linear Equations |url=https://www.quantamagazine.org/new-algorithm-breaks-speed-limit-for-solving-linear-equations-20210308/ |access-date=March 9, 2021 |work=[[Quanta Magazine]] |date=March 8, 2021}}</ref> One example of an iterative method is the [[Jacobi method]], where the matrix <math>A</math> is split into its diagonal component <math>D</math> and its non-diagonal component <math>L+U</math>. An initial guess <math>{\bold x}^{(0)}</math> is used at the start of the algorithm. Each subsequent guess is computed using the iterative equation: : <math>{\bold x}^{(k+1)} = D^{-1}({\bold b} - (L+U){\bold x}^{(k)})</math> When the difference between guesses <math>{\bold x}^{(k)}</math> and <math>{\bold x}^{(k+1)}</math> is sufficiently small, the algorithm is said to have ''converged'' on the solution.<ref>{{cite web |url=https://mathworld.wolfram.com/JacobiMethod.html |title=Jacobi Method }}</ref> There is also a [[quantum algorithm for linear systems of equations]].{{sfnp|Harrow|Hassidim|Lloyd|2009}} ==Homogeneous systems== {{See also|Homogeneous differential equation}} A system of linear equations is '''homogeneous''' if all of the constant terms are zero: : <math>\begin{alignat}{7} a_{11} x_1 &&\; + \;&& a_{12} x_2 &&\; + \cdots + \;&& a_{1n} x_n &&\; = \;&&& 0 \\ a_{21} x_1 &&\; + \;&& a_{22} x_2 &&\; + \cdots + \;&& a_{2n} x_n &&\; = \;&&& 0 \\ && && && && && \vdots\;\ &&& \\ a_{m1} x_1 &&\; + \;&& a_{m2} x_2 &&\; + \cdots + \;&& a_{mn} x_n &&\; = \;&&& 0. \\ \end{alignat}</math> A homogeneous system is equivalent to a matrix equation of the form : <math>A\mathbf{x}=\mathbf{0}</math> where ''A'' is an {{nowrap|''m'' × ''n''}} matrix, '''x''' is a column vector with ''n'' entries, and '''0''' is the [[zero vector]] with ''m'' entries. ===Homogeneous solution set=== Every homogeneous system has at least one solution, known as the ''zero'' (or ''trivial'') solution, which is obtained by assigning the value of zero to each of the variables. If the system has a [[non-singular matrix]] ({{math|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: # If '''u''' and '''v''' are two [[vector (mathematics)|vectors]] representing solutions to a homogeneous system, then the vector sum {{nowrap|'''u''' + '''v'''}} is also a solution to the system. # If '''u''' is a vector representing a solution to a homogeneous system, and ''r'' is any [[scalar (mathematics)|scalar]], then ''r'''''u''' is also a solution to the system. These are exactly the properties required for the solution set to be a [[linear subspace]] of '''R'''<sup>''n''</sup>. In particular, the solution set to a homogeneous system is the same as the [[Kernel (matrix)|null space]] of the corresponding matrix ''A''. ===Relation to nonhomogeneous systems=== There is a close relationship between the solutions to a linear system and the solutions to the corresponding homogeneous system: : <math>A\mathbf{x}=\mathbf{b}\qquad \text{and}\qquad A\mathbf{x}=\mathbf{0}.</math> Specifically, if '''p''' is any specific solution to the linear system {{nowrap|1=''A'''''x''' = '''b'''}}, then the entire solution set can be described as : <math>\left\{ \mathbf{p}+\mathbf{v} : \mathbf{v}\text{ is any solution to }A\mathbf{x}=\mathbf{0} \right\}.</math> Geometrically, this says that the solution set for {{nowrap|1=''A'''''x''' = '''b'''}} is a [[translation (geometry)|translation]] of the solution set for {{nowrap|1=''A'''''x''' = '''0'''}}. Specifically, the [[flat (geometry)|flat]] for the first system can be obtained by translating the [[Euclidean subspace|linear subspace]] for the homogeneous system by the vector '''p'''. This reasoning only applies if the system {{nowrap|1=''A'''''x''' = '''b'''}} has at least one solution. This occurs if and only if the vector '''b''' lies in the [[image (mathematics)|image]] of the [[linear transformation]] ''A''. ==See also== * [[Arrangement of hyperplanes]] * {{Annotated link|Iterative refinement}} * {{Annotated link|Coates graph}} * {{Annotated link|LAPACK}} * {{Annotated link|Linear equation over a ring}} * {{Annotated link|Linear least squares (mathematics)|Linear least squares}} * {{Annotated link|Matrix decomposition}} * {{Annotated link|Matrix splitting}} * {{Annotated link|NAG Numerical Library}} * {{Annotated link|Rybicki Press algorithm}} * {{Annotated link|Simultaneous equations}} == References == {{Reflist}} ==Bibliography== * {{citation | last1 = Anton | first1 = Howard | year = 1987 | isbn = 0-471-84819-0 | title = Elementary Linear Algebra | edition = 5th | publisher = [[John Wiley & Sons|Wiley]] | location = New York }} * {{citation | last1 = Beauregard | first1 = Raymond A. | last2 = Fraleigh | first2 = John B. | title = A First Course In Linear Algebra: with Optional Introduction to Groups, Rings, and Fields | location = Boston | publisher = [[Houghton Mifflin Company]] | year = 1973 | isbn = 0-395-14017-X | url-access = registration | url = https://archive.org/details/firstcourseinlin0000beau }} * {{citation | last1 = Burden | first1 = Richard L. | last2 = Faires | first2 = J. Douglas | year = 1993 | isbn = 0-534-93219-3 | title = Numerical Analysis | edition = 5th | publisher = [[Prindle, Weber and Schmidt]] | location = Boston | url-access = registration | url = https://archive.org/details/numericalanalysi00burd }} * {{citation | last = Cullen | first = Charles G. | isbn = 978-0-486-66328-9 | title = Matrices and Linear Transformations | location = MA | publisher = Dover | year = 1990 }} * {{citation | last1 = Golub | first1 = Gene H. | last2 = Van Loan | first2 = Charles F. | year = 1996 | isbn = 0-8018-5414-8 | title = Matrix Computations | edition = 3rd | publisher = [[Johns Hopkins University Press]] | location = Baltimore }} * {{citation | last = Harper | first = Charlie | year = 1976 | isbn = 0-13-487538-9 | title = Introduction to Mathematical Physics | publisher = [[Prentice-Hall]] | location = New Jersey }} * {{citation | last1 = Harrow | first1 = Aram W. | last2 = Hassidim | first2 = Avinatan | last3 = Lloyd | first3 = Seth | year = 2009 | title = Quantum Algorithm for Linear Systems of Equations | journal = Physical Review Letters | volume = 103 | issue = 15 | page = 150502 | doi = 10.1103/PhysRevLett.103.150502 | pmid = 19905613 | arxiv = 0811.3171 | bibcode = 2009PhRvL.103o0502H | s2cid = 5187993 }} * {{citation | last = Sterling | first = Mary J. | year = 2009 | title = Linear Algebra for Dummies | publisher = Wiley | location = Indianapolis, Indiana | isbn = 978-0-470-43090-3 }} * {{citation | last = Whitelaw | first = T. A. | year = 1991 | title = Introduction to Linear Algebra | edition = 2nd | publisher = CRC Press | isbn = 0-7514-0159-5 }} ==Further reading== * {{cite book | last = Axler | first = Sheldon Jay |date= 1997 | title = Linear Algebra Done Right | publisher = Springer-Verlag | edition = 2nd | isbn = 0-387-98259-0 }} * {{cite book | last = Lay | first = David C. | date = August 22, 2005 | title = Linear Algebra and Its Applications | publisher = Addison Wesley | edition = 3rd | isbn = 978-0-321-28713-7 }} * {{cite book |last = Meyer |first = Carl D. |date = February 15, 2001 |title = Matrix Analysis and Applied Linear Algebra |publisher = Society for Industrial and Applied Mathematics (SIAM) |isbn = 978-0-89871-454-8 |url = http://www.matrixanalysis.com/DownloadChapters.html |archive-url = https://web.archive.org/web/20010301161440/http://matrixanalysis.com/DownloadChapters.html |archive-date = March 1, 2001 }} * {{cite book | last = Poole | first = David |date= 2006 | title = Linear Algebra: A Modern Introduction | publisher = Brooks/Cole | edition = 2nd | isbn = 0-534-99845-3 }} * {{cite book | last = Anton | first = Howard |date= 2005 | title = Elementary Linear Algebra (Applications Version) | publisher = Wiley International | edition = 9th }} * {{cite book | last = Leon | first = Steven J. |date= 2006 | title = Linear Algebra With Applications | publisher = Pearson Prentice Hall | edition = 7th }} * {{cite book |last=Strang |first=Gilbert |author-link=Gilbert Strang |date=2005 |title=Linear Algebra and Its Applications }} * {{cite journal |first1=Richard |last1=Peng |first2=Santosh S. |last2=Vempala |title=Solving Sparse Linear Systems Faster than Matrix Multiplication |journal=Comm. ACM |volume=67 |issue=7 |pages=79–86 |date=2024 |doi=10.1145/3615679 |arxiv=2007.10254 }} ==External links== * {{Commons category-inline}} {{linear algebra}} {{authority control}} [[Category:Equations]] [[Category:Linear algebra]] [[Category:Numerical linear algebra]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Annotated link
(
edit
)
Template:Authority control
(
edit
)
Template:Citation
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite encyclopedia
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite news
(
edit
)
Template:Cite web
(
edit
)
Template:Commons category-inline
(
edit
)
Template:Further
(
edit
)
Template:Linear algebra
(
edit
)
Template:Main
(
edit
)
Template:Math
(
edit
)
Template:More footnotes
(
edit
)
Template:Navbox
(
edit
)
Template:Nowrap
(
edit
)
Template:Reflist
(
edit
)
Template:See also
(
edit
)
Template:Sfnmp
(
edit
)
Template:Sfnp
(
edit
)
Template:Short description
(
edit
)
Template:Use American English
(
edit
)
Template:Use mdy dates
(
edit
)