SST 301 • UNIT 4 • Statistics
Solutions of Systems of Linear Equations
Topics covered: Systems Formulation & Geometry, Computation via matlib
Syllabus Study Notes (Core Overview)
Free Overview Preview1. Concept and Use Case
A linear equation in the $n$ variables $x_1,x_2,\dots,x_n$ is an equation that can be expressed in the form
$$
a_1x_1+a_2x_2+\dots+a_nx_n=b
$$
where $a_1,a_2,\dots,a_n$ and $b$ are constants and the $a$'s are not equal to zero. A linear equation does not involve any products or roots of variables; all variables occur only to the first power and do not appear inside trigonometric, logarithmic, or exponential functions.
A finite set of linear equations is called a system of linear equations, and the variables are called unknowns. For example:
$$
5x+y=3
$$
$$
2x-y=4
$$
A general linear system of $m$ equations in the $n$ unknowns $x_1,x_2,\dots,x_n$ can be written as:
$$
a_{11}x_1+a_{12}x_2+\dots+a_{1n}x_n=b_1
$$
$$
a_{21}x_1+a_{22}x_2+\dots+a_{2n}x_n=b_2
$$
$$
a_{m1}x_1+a_{m2}x_2+\dots+a_{mn}x_n=b_m
$$
A solution of a linear system in $n$ unknowns $x_1,x_2,\dots,x_n$ is a sequence of $n$ numbers $s_1,s_2,\dots,s_n$ for which the substitution
$$
x_1=s_1,\ x_2=s_2,\ \dots,\ x_n=s_n
$$
makes each equation a true statement.
The practical use case is to determine whether such a system has a solution, and if so, to compute it. In this course the system is represented in matrix form $Ax=b$, and the solution is obtained as $x=A^{-1}b$. The R package matlib provides the computational tools: Solve() to solve, showEqn() to display the equations, plotEqn() to visualize them, and echelon() to reduce the augmented matrix to echelon form.
2. Data, Syntax, and Core Concepts
2.1 Matrix form and the inverse solution
A system is represented in matrix form as
$$
Ax=b
$$
and the solution is written as
$$
x=A^{-1}b
$$
Here $A$ is the coefficient matrix, $x$ is the column vector of unknowns, and $b$ is the column vector of constants. The matrix $A$ is constructed in R with matrix(), and $b$ is a vector of constants.
2.2 Consistency and intersection geometry
Linear systems in two unknowns arise in connection with intersections of lines. Consider the system
$$
a_1x+b_1y=c_1
$$
$$
a_2x+b_2y=c_2
$$
in which the graphs of the equations are lines in the $xy$-plane. Each solution $(x,y)$ corresponds to a point of intersection of the lines, so there are three possibilities:
- The lines may be parallel and distinct, in which case there is no intersection and consequently no solution.
- The lines may intersect at only one point, in which case the system has exactly one solution.
- The lines may coincide, in which case there are infinitely many points of intersection (the points on the common line) and consequently infinitely many solutions.
A linear system is consistent if it has at least one solution and inconsistent if it has no solutions. Thus a consistent linear system of two equations in two unknowns has either one solution or infinitely many solutions—there are no other possibilities. The same is true for a linear system of three equations in three unknowns.
2.3 Package installation and loading
The syntax to solve equations in R uses the package matlib. To install the package and load it:
install.packages("matlib")
library(matlib)
2.4 Core functions
| Function | Purpose |
|---|---|
showEqn(A, b) |
Display the system of equations |
Solve(A, b) |
Solve the system |
plotEqn(A, b) |
Plot the equations |
echelon(A, b) |
Reduce the augmented matrix to echelon form |
The echelon() function also accepts the arguments verbose=TRUE and fractions=TRUE to display the reduction steps and fractional entries.
Unlock Complete Study Notes & Exam Traps
The full guide includes formal proofs, worked exemplar calculations, high-yield exam traps, and examiner marking schemes. Continue studying this topic in Mentify Prep Studio.