Free preview
61 lessons
Essential Linear Algebra for ML
Free preview
Essential Linear Algebra for ML · 61 lessons
No surprise gaps
Actually remember it
Skip what you know
One subscription. All learning paths included.
Our content is best on a larger screen
Understanding and representing systems of linear equations
A system of linear equations is a set of two or more linear equations that involve the same variables. When there are two variables, each equation describes a straight line when plotted on a graph. In higher dimensions, each equation represents a flat surface (such as a plane in three variables). The variables are the unknowns we want to solve for, and a solution to the system is a set of values for the variables that make all the equations true at the same time.
For example, consider the following system with two variables, and :
Here:
Algebraic representation
We often write a system of equations by listing all the equations together, often using a curly brace to show they are part of the same system:
Visual representation
We can also represent a system of two equations in two variables by drawing both lines on the same graph. Each equation corresponds to a straight line. The point where the two lines cross (if they do) is the solution to the system, because it is the point that satisfies both equations.
For the example above, the two lines intersect at a single point. This point is the solution to the system.
Below is an interactive graph showing both equations. The blue and red lines represent the two equations. The point where they intersect, , is the solution to the system. This means that and makes both equations true.
Have a play around by modifying the lines and watch the system update.
Drag the lines and any of the four points to change the lines. Watch how the equations and solution point update automatically.
Solving by substitution
When we have a system of two linear equations with two variables, we can solve it using the substitution method. This method involves the following steps:
Solve one equation for one variable.
We start by choosing one of the equations and rearranging it so that one variable is written in terms of the other. For example, consider the system:
We can solve the first equation for :
Substitute this expression into the other equation.
Next, we substitute into the second equation wherever appears:
Solve for the remaining variable, then back-substitute.
Now we solve for :
Now substitute back into the expression for :
So the solution to the system is:
Summary of steps
Solve the system of equations:
using the substitution method.
Solution
Step 1: The first equation is already solved for :
Step 2: Substitute into the second equation by replacing with :
Step 3: Solve for :
Step 4: Substitute back into the expression for :
So the solution to the system is:
Practice questions
3 questions
Solve the following system of equations using the substitution method:
What is the value of ?
Select the correct answer:
+ 2 more questions
Solving by elimination (addition/subtraction method)
When solving a system of two linear equations with two variables, we can also use the elimination method (also called the addition or subtraction method). The idea is to add or subtract the equations so that one of the variables is eliminated, allowing us to solve for the other variable.
Suppose we have the system:
We use elimination when the coefficients of one variable are equal or opposites (possibly after multiplying one or both equations by a constant). This allows us to combine the equations so that one variable cancels out.
Steps
Note:
To add or subtract two equations, we perform the operation on both sides of the equations. For example, adding the equations means adding the left sides together and the right sides together:
Solve the system:
Solution
Since the coefficients of are already equal and the same sign, we can subtract the second equation from the first to eliminate . Note that it does not matter which equation we subtract from the other, as long as we are consistent on both sides - the solution will be the same.
Here, we chose to subtract the second equation from the first equation so that the right-hand side stays positive, but this is just a preference.
Now substitute into one of the original equations (for example, the second):
So the solution to the system is:
Practice questions
3 questions
Solve the system of equations using the elimination method:
What is the solution ?
Select the correct answer:
+ 2 more questions