What is a System of Linear Equations - Linear Algebra

What is a System of Linear Equations – Linear Algebra

I know that you’re probably interested in machine learning, but did you know that linear algebra is a must to understand many algorithms? To deeply understand and tune them you need to be familiar with what’s under the hood.

In this series of articles on Linear Algebra, I will go through the main concepts so that you understand the fundamentals. To understand these articles you need to be familiar with algebra.

What is a Linear Equation?

A linear equation is simply an equation of the following form:

3x_{1}+5x_{2}+...+2x_{n}=b          [1]

I chose the coefficients randomly, so they could have been any real or complex numbers.

The following equation is not linear because of the square root:

3x_{1}+5x_{2}=2 \sqrt x_{3}          [2]

One of the simplest linear equation that you may recall from high school is:

mx+b=y          [3]

A linear equation in this context is similar, but can take more than 2 xs.

A System of Linear Equations

Now imagine two linear equations using the same variables. For example:

3x_{1}+5x_{2}=4          [4]

x_{1}-2x_{2}=2          [5]

What is a System of Linear Equations – Linear Algebra - A system of linear equations

Here x1 was treated as the independent variable, and x2 as the dependent variable. Here’s the Python code to create this chart:

Multiple linear equations who share the same variables is called a System of linear equations.

When having multiple linear equations it’s possible to find some values of xs that make all the equations true. For example, in the example above a solution is [ 0.90909091, 1.27272727]:

In this case there is a unique solution, but a System of linear equations can also have no solution, or an infinity of solutions. The set of all solutions is called the Solution Set.

Formally, we call a system with no solution incompatible, and a system with at least one solution compatible.

Matrix Notation

Writing equations like [4] and [5] becomes quickly tedious for bigger systems of linear equations, and so using the matrix notation is beneficial. We can resume the system in [4] and [5] like this:

\begin{bmatrix}3 & 5 & 4\\1 & -2 & 2\end{bmatrix}          [6]

Columns 1 and 2 are the coefficients on the left side of the equations [4] and [5], and the last column is the coefficients of the right side.

We can also look at the size of a matrix, which in this case is a 2 by 3 matrix. The first number is always the number of rows, and the second one is the number of columns.


Here’s what you should remember:

  • Multiple linear equations sharing the same variables are called a System of linear equations.
  • A system of linear equations can have no solution, one solution, of an infinity of solutions.
  • The matrix notation is beneficial for larger system of linear equations and also to perform calculations that we will see in future articles.

If you like that article and want more content like this please share it 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.