Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

 Open In Colab

Solvability of Linear Systems

Some systems of equations don’t have a solution, or they do but it’s not unique.

Illustrative example: You are organizing a fundraising event and need to buy chairs and tables.

  • Chairs cost $20 each

  • Tables cost $50 each

  • You have a budget of $700

  • You need exactly 20 pieces of furniture

How many chairs and tables should you buy?

A System with One Solution

Let cc and tt be the number of chairs and tables respectively.

(1) 20c+50t=70020 c + 50 t = 700 (Budget)
(2) c+t=20 c+t = 20 (Pieces)

Solve Graphically

Since these are linear equations, we can plot them as lines on a graph.

The point where the lines intersect satisfies both equations and is therefore a solution. Since lines only cross once, it is a unique solution.

Algebraic Solution (Elimination)

We can solve this algebraically by eliminating one variable.

Multiply the second equation (2) by 20:
(3) 20c+20t=40020c+20t = 400

Subtract (3) from (1):
(20c+50t)−(20c+20t)=700−400(20c + 50t) - (20c + 20t) = 700 - 400
30t=30030t = 300
t=10t=10

Substitute t=10t=10 back into (2):
c=10c = 10

Matrix Formulation

Writing this as a matrix equation (Ax=b\mathbf{A} \mathbf{x} = \mathbf{b}):

(205011)(ct)=(70020)\begin{pmatrix} 20 & 50 \\ 1 &1 \end{pmatrix} \begin{pmatrix} c \\ t \end{pmatrix} = \begin{pmatrix} 700 \\ 20 \end{pmatrix}

Let’s find the inverse A−1\mathbf{A}^{-1} such that x=A−1b\mathbf{x} = \mathbf{A}^{-1}\mathbf{b}. For a 2x2 matrix:

(abcd)−1=1∣A∣(d−b−ca)\begin{pmatrix} a & b \\ c & d \end{pmatrix}^{-1} = \frac{1}{|\mathbf{A}|} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}

where ∣A∣=ad−bc|\mathbf{A}| = ad-bc is the determinant.

For our matrix, ∣A∣=20(1)−50(1)=−30|\mathbf{A}| = 20(1) - 50(1) = -30.

A−1=1−30(1−50−120)\mathbf{A}^{-1} = \frac{1}{-30} \begin{pmatrix} 1 & -50 \\ -1 & 20 \end{pmatrix}

Thus, x=A−1b=(1010)\mathbf{x} = \mathbf{A}^{-1} \mathbf{b} = \begin{pmatrix} 10 \\ 10 \end{pmatrix}.

A System with Infinite Solutions

Let’s tweak our problem.

  • There is a discount on tables: they now cost $20 each.

  • Your budget was cut to $400.

The problem is now:
20c+20t=40020 c + 20 t = 400
c+t=20 c+t = 20

Solve Graphically

Solving graphically, we see the lines overlap! What does this mean?

Solve by Elimination

If we multiply the second equation by 20:
20c+20t=40020c+20t = 400

Subtracting the first, we get:
0=00=0

Any combination of tables and chairs that sums to 20 is a solution. There are an infinite number of solutions.

Examine the matrix (Singular matrix)

What happens to our matrix formulation?

A=(202011)\mathbf{A} = \begin{pmatrix} 20 & 20 \\ 1 & 1 \end{pmatrix}

The determinant is ∣A∣=20(1)−20(1)=0|\mathbf{A}| = 20(1) - 20(1) = 0.

Since the formula for the inverse requires dividing by the determinant (1∣A∣\frac{1}{|\mathbf{A}|}), the inverse does not exist.

A matrix with a zero determinant is called singular.

A System with No Solutions

Let’s tweak the problem one last time.

  • Tables and chairs both cost $20.

  • The budget is raised to $500.

20c+20t=50020 c + 20 t = 500
c+t=20 c+t = 20

Solve Graphically

If we examine the solution graphically, we see the lines are parallel and never intersect! There is no combination of 20 pieces of furniture that will cost exactly $500 at $20 each.

Examine the matrix

Just like the infinite solutions case, the determinant of the coefficient matrix is still zero (∣A∣=0|\mathbf{A}| = 0). The matrix is singular, and the system cannot be solved exactly.

Putting it together

Linear equations (in 2 unknowns) are lines in 2D and the solution is the intersection of those lines. 2 lines can intersect either:

  1. In one place, which gives you a unique solution.

  2. Everywhere, which gives you infinite solutions.

  3. Nowhere, where there is no solution!

For 2 and 3, these lines are parallel (you can slide one to lie on top of the other). Such lines are called linearly dependent. Example 1 has linear independent equations which intersect in one place and can be solved.

Scenarios 1 and 2 are called a consistent linear system since an answer can be obtained. Scenario 3 is inconsistent since there is no solution.

The Matrix Interpretation

Linear systems generally can be written as:

Ax=b\mathbf{A}\mathbf{x} = \mathbf{b}

Solvability, i.e. the ability to find a unique solution, depends solely on A\mathbf{A}.

  • If ∣A∣≠0|\mathbf{A}| \neq 0, the matrix rows are linearly independent, the matrix is invertible (or non-singular), and the system has exactly one solution.

  • If ∣A∣=0|\mathbf{A}| = 0, the matrix rows are linearly dependent and the matrix is singular. The lines are parallel, which means either you have infinite solutions or none depending on b\mathbf{b}.