## Systems of linear equations

Let $$\mathbb{F}$$ be a field. Let $$m$$ and $$n$$ be positive integers. For $$i=1,\ldots,m$$ and $$j=1,\ldots,n$$, let $$a_{ij}\in \mathbb{F}$$ and $$b_i\in\mathbb{F}$$.

The following defines a system of linear equations in the variables $$x_1,\ldots,x_n$$ over $$\mathbb{F}$$: $\begin{array}{rcl} \sum_{j=1}^n a_{1j} x_j & = & b_1 \\ \sum_{j=1}^n a_{2j} x_j & = & b_2 \\ & \vdots & \\ \sum_{j=1}^n a_{mj} x_j & = & b_m \\ \end{array}$

To solve the above system means to find values for $$x_1,\ldots,x_n$$ from $$\mathbb{F}$$ so that all the equations are simultaneously satisfied. (One can replace $$\mathbb{F}$$ with some other structure on which addition and multiplication are defined. But such a system is normally much more difficult to handle.)

In this course, $$\mathbb{F}$$ is usually $$\mathbb{R}$$ or $$\mathbb{C}$$. But we will work with other fields once in a while, especially in our discussion on Lights Out.

Many applications rely on being able to solve systems of linear equations very quickly. For example, weather forecasts, optimizing investment portfolios, etc.

We are interested in finding ways to solve systems of linear equations as well as identifying mathematical structures that come out of them.

### Example

The following is a system of linear equations over $$\mathbb{R}$$: \begin{eqnarray*} x_1 + 3x_2 & = & 2 \\ -x_1 + 2x_2 & = & 3 \end{eqnarray*} A solution to the system is given by $$x_1 = -1$$ and $$x_2 = 1$$. One can check that with these values for $$x_1$$ and $$x_2$$, the left-hand side of each equation is equal to the right-hand side.

## Two special cases

We look at two special cases for which finding solutions is relatively easy.

### Case 1: one variable

Consider the following system over $$\mathbb{Q}$$:

$\begin{array}{rcll} 2x & = & 8 & ~~~~~~~\text{(1)}\\ -x & = & -4 & ~~~~~~~\text{(2)}\\ 3x & = & 2 & ~~~~~~~\text{(3)}\\ \end{array}$ Is there a value in $$\mathbb{Q}$$ for $$x$$ that satisfies all the equations?

Now observe the following. Equation (1) is equivalent to $$x = 4$$ after multiplying both sides by $$1/2$$. Equation (3) is equivalent to $$x = 2/3$$ after multiplying both side by $$1/3$$. As $$x$$ cannot be equal to both $$4$$ and $$2/3$$, there is no solution.

In general, to solve a system of linear equations in one variable, we simply turn every equation into the form $$x = \beta$$ where $$\beta$$ is a constant. If every equation has the same right-hand side $$\beta$$, then $$x = \beta$$ is the unique solution to the system. Otherwise, there is no solution.

### Case 2: one equation

Consider the following system of one equation in three variables: $x_1 + 2x_2 - x_3 = 5$ We want to find all possible rational values that can be assigned to $$x_1, x_2,$$ and $$x_3$$ so that equality holds.

Rewriting the equation by adding $$-2x_2+x_3$$ to both sides gives the equivalent equation: $x_1 = 5 - 2x_2 + x_3$

Observe that no matter what rational values we assign to $$x_2$$ and $$x_3$$, we can set $$x_1$$ to the value given by $$5-2x_2+x_3$$. For example, setting $$x_2$$ to 0 and $$x_3$$ to 1 gives $$x_1 = 6$$, giving the solution $$\begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix} = \begin{bmatrix}6\\0\\1\end{bmatrix}$$ to the equation.

In fact, setting $$x_2$$ to $$s \in \mathbb{Q}$$ and $$x_3$$ to $$t \in \mathbb{Q}$$, we get $$\begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix} = \begin{bmatrix}5-2s+t\\s\\t\end{bmatrix}$$. As $$s$$ and $$t$$ range over all possible rational numbers, we obtain all possible solutions to the equation. Hence, there are infinitely many solutions.

More generally, a system of linear equations with only one equation but at least two variables having nonzero coefficients has infinitely many solutions unless the field has only finitely many elements.

## Number of solutions

Even from the special cases we have just considered, we see that a system of linear equations can have exactly one solution, no solution, or multiple solutions. We will look at the general question of determining the number of solutions a system of linear equations can have later on.

## Exercises

1. Find all solutions to the each of the following systems over $$\mathbb{Q}$$:

1. $$\begin{array}{rcl} 2x - 1 & = & 5 \\ 3x & = & 9 \\ 2-x & = & x \\ \end{array}$$

2. $$2x - 3y = 4$$

2. Is it possible for a system over $$\mathbb{R}$$ consisting of a single equation to have exactly two solutions?