# Why do we need 2 equations to solve 2 variables, 3 equations to solve 3 variables, etc…?

The question put another way: why does solving a system of two equations with 2 variables give an exact answer?

I understand that using graphing, I will get either 2 parallel lines, which means 'no solutions' or intersecting lines, which means '1 solution'. But I'm wondering why this happens in terms of algebra, not graphing. I.E. I am asking for a proof/illustration.

• It would help to clarify that you are asking only about linear equations, if that is the case. – Jonas Meyer May 14 '13 at 16:02
• It gives an exact answer if the linear equations are 'independent' – UrošSlovenija May 14 '13 at 16:02
• First, you should convince yourself that the single equation (1 equation 1 variable) $ax + b = 0$, where $a, b, c$ are constants, has either a unique solution (if $a \neq 0$), no solution (if $a = 0$ and $b \neq 0$) or infinitely many (if $a = 0$ and $b = 0$). Now, the system $a_1 x + b_1 y = c_1, a_2 x + b_2 y = c_2$ can always be re-arranged so that one of the equations is as above (in the form $ax + b = 0$). If we can solve one of these equations, we can substitute back into the second one to again obtain the form $ax + b = 0$, same situation applies. Induct on the number of equations. – snar May 14 '13 at 16:08

Assume that we have $n$ linear equation in $n$ variables. We can write these as:

\begin{array}{ccc} a_{1,1}x_1 + \cdots + a_{1,n}x_n &=& c_1 \\ a_{2,1}x_1 + \cdots + a_{2,n}x_n &=& c_2 \\ &\vdots & \\ a_{n,1}x_1 + \cdots + a_{n,n}x_n &=& c_n \end{array}

All of these equations can be grouped together into matrix notation:

$$\left[\begin{array}{ccc} a_{1,1} & \cdots & a_{1,n} \\ \vdots & \ddots & \vdots \\ a_{n,1} & \cdots & a_{n,n}\end{array}\right]\left[\begin{array}{c}x_1 \\ \vdots \\ x_n \end{array}\right] = \left[\begin{array}{c}c_1 \\ \vdots \\ c_n \end{array}\right]$$

The $n \times n$ matrix, $A:=[a_{i,j}]$ is our object of interest. If $\det(A) \neq 0$ then $A$ is invertible, and we can multiply through on the left: $A{\bf x} = {\bf c} \iff A^{-1}A{\bf x} = A^{-1}{\bf c} \iff {\bf x} = A^{-1}{\bf c}$. If $\det(A) \neq 0$ then there is a unique solution and that is given by expanding $A^{-1}{\bf c}$.

If $\det(A) = 0$ then there are several possibilities for solutions. It all relates to the rank and the nullity of $A$. These two numbers are related by the so-called Rank-Nullity Theorem.

When $\det(A) \neq 0$, the rank of $A$ is $n$ and the nullity is $0$. That means the dimension of the set of ${\bf x}$ which go to ${\bf c}$ is zero, i.e. a point, and so there is a unique solution. If $\det(A) = 0$ then the rank may be anything from as high as $n-1$ (where the solution set will have dimension one, i.e. be a line), to as little as $0$ (where the solution set will have dimension $n$, i.e. be the whole space).

(To illustrate the last case, we could have $n$ equations in $n$ variables, and they are all $0x_1 + 0x_2 + \cdots + 0x_n = 0$. Any old ${\bf x}$ will solve this.)

A system of $n$ (for simplicity: homogenous) equations in $m$ unknowns can be viewed as a linear map from $m$-dimensional space to $n$-dimensional space, and the solutions are the preimiage of a point under this map. Now to make a statement about solvability and dimension of solution you need an important result from linear algebra:

If $f\colon V\to W$ is a linear map, then $\dim V=\dim\ker f+\dim \operatorname{im} f$.

To get there, you need of course a bit of linear algebra and the notions of kernel, image, dimension, etc.