1 System of Linear Equations

Go to the MLX, M, PDF, or HTML version of this file. Go back to fan’s MEconTools Package, Matlab Code Examples Repository (bookdown site), or Math for Econ with Matlab Repository (bookdown site).

See also: System of Linear Equations

See also: Solving for Two Equations and Two Unknowns

See also: System of Linear Equations, Row Echelon Form

1.1 Linear Equation

If we have an equation: \(a\cdot x_1 +b\cdot x_2 +c\cdot x_3 =o\), we can write this in matrix form:

  • \(\displaystyle \left\lbrack \begin{array}{ccc} a & b & c \end{array}\right\rbrack \cdot \left\lbrack \begin{array}{c} x_1 \\ x_2 \\ x_3 \end{array}\right\rbrack =\left\lbrack \begin{array}{cc} a\cdot x_1 +b\cdot x_2 +c\cdot x_3 \end{array}\right\rbrack =\left\lbrack \begin{array}{c} o \end{array}\right\rbrack\)

This is a linear equation, where we have a sequence of variables multiplied by coefficients, more generally, this is a linear equation with \(n\) unknown variables, and \(n+1\) known coefficients, note the \(a\) at the beginning:

  • \(\displaystyle a+\beta_1 \cdot x_1 +\beta_2 \cdot x_2 +...+\beta_{_{n-1} } \cdot x_{n-1} +\beta_n \cdot x_n =0\)

In 2 dimension (with two unknowns), this is a line; in 3 dimension, this is a surface.

1.2 System of Linear Equations

We have a system of linear equations, 3 equations and 3 unknowns:

  • \(\displaystyle \left\lbrack \begin{array}{ccc} a & b & c\\ d & e & f\\ g & h & i \end{array}\right\rbrack \cdot \left\lbrack \begin{array}{c} x_1 \\ x_2 \\ x_3 \end{array}\right\rbrack =\left\lbrack \begin{array}{cc} a\cdot x_1 +b\cdot x_2 +c\cdot x_3 \\ d\cdot x_1 +e\cdot x_2 +f\cdot x_3 \\ g\cdot x_1 +h\cdot x_2 +i\cdot x_3 \end{array}\right\rbrack =\left\lbrack \begin{array}{c} o\\ p\\ q \end{array}\right\rbrack\)

We can define these:

  • \(\displaystyle W=\left\lbrack \begin{array}{ccc} a & b & c\\ d & e & f\\ g & h & i \end{array}\right\rbrack\)

  • \(\displaystyle X=\left\lbrack \begin{array}{c} x_1 \\ x_2 \\ x_3 \end{array}\right\rbrack\)

  • \(\displaystyle v=\left\lbrack \begin{array}{c} o\\ p\\ q \end{array}\right\rbrack\)

1.3 Augmented Form

We can write \(W\) and \(v\) together like this, this is the augmented matrix of the system of linear equations:

  • Augmented Matrix:\(\left\lbrack \begin{array}{cccc} a & b & c & |o\\ d & e & f & |p\\ g & h & i & |q \end{array}\right\rbrack\)