Systems of linear equations

Prerequisites

Cartesian Coordinates Show

Gradient of a straight line Show

Equation of a straight line Show

Linear Equations Show

Systems of linear equations

Introduction

  • A system of linear equations is of the form: a system of linear equations
  • Each row is an individual equation.
  • Variables x1 to xn are shared amongst the equations.
  • The size of this system is denoted m x n.

Example

  • Two cars are in a race
  • The first car is slow:
    • It can travel at 10 meters per second
    • But it has a 1 minute head start
  • The second car is fast:
    • It can travel at 25 meters per second
    • But it has no head start
  • The cars are not accelerating
    • Their distance as an equation of time forms a straight line
    • and is therefore a linear equation
  • We can represent them as a system of linear equations: race cars as a system of linear equations
    • t is time in seconds
    • d is the distance travelled
  • By solving these equations we can find the point where the fast car overtakes the slow one
  • The cars meet when the distance each has travelled is equal solved for t The cars meet after 40 seconds
  • We can solve for d by putting 40 into one of the original equations: solved for d The cars meet at 1000 meters
  • Finally, we can re-arrange these equations to make them look more like the generic one found in the introduction: re-arranged version of our system of equations

Code (Python)

import numpy as np

A = np.array([[1, -10], [1, -25]])
B = np.array([600, 0])
solution = np.linalg.solve(A, B)

print(solution) # prints [1000, 40]

Dependent vs Independent equations

  • Equations are independent when each of them gives us new information about a system.
  • For example: a system of two dependent equations is dependent because one is simply a multiple of another, and tells us nothing new.

Consistent vs Inconsistent systems

  • A solution for a linear equation is a set of values which make the equation true.
    • For example: x - 2y = 0
    • One solution would be: x = 2, y = 1
    • But it can also be solved with: x = 6, y = 3
  • Similarly, a solution for a system of linear equations is a set of values which make all the equations true:
    • For example: a system with multiple solutions
    • One solution is: x = 1, y = 1, z = 2
    • However, any set of values of the form: x = 1, y = a, z = 2a is also a solution.
  • Some systems will only have a single solution.
    • Such as the one in the example.
  • Some systems will not have any solutions:
    • For example: a system with no solution
    • There are no values we can give for x and y that makes all 3 equations true.
  • The set of all solutions for a system of equations is called the solution set.
  • If the set is empty, then the system is inconsistent.
  • If the set has at least one solution, then the system is consistent.