Abdulrahim Ahmadov
Abdulrahim Ahmadov

Software Engineer

Exploring Systems of Linear Equations: General Solution, Pivot, and Free Variables

Solving systems of linear equations is a fundamental skill in mathematics. In this blog post, we explore the process of solving these systems using matrix operations, Gaussian elimination, and identifying free variables.

Introduction

Understanding and solving systems of linear equations is a fundamental skill in mathematics, particularly in linear algebra. In this blog post, we will delve into the process of solving these systems using matrix operations, Gaussian elimination, and identifying free variables. We’ll illustrate these concepts through an example.

Problem Statement

We begin with a system of linear equations:

\begin{aligned} -2x_1 + 4x_2 - 2x_3 - x_4 + 4x_5 &= -3 \\ 4x_1 - 8x_2 + 3x_3 - 3x_4 + x_5 &= 2 \\ x_1 - 2x_2 + x_3 - x_4 + x_5 &= 0 \\ x_1 - 2x_2 - 3x_4 + 4x_5 &= a \end{aligned}

Transforming the System

To solve the system, we apply row operations to transform it into row-echelon form, making it easier to identify relationships between the variables:

\begin{aligned} x_1 - 2x_2 + x_3 - x_4 + x_5 &= 0 \\ x_3 - x_4 + 3x_5 &= -2 \\ x_4 - 2x_5 &= 1 \\ 0 &= a + 1 \end{aligned}

Solving the System

Parameter Constraint

The last equation tells us:

0 = a + 1

Thus, (a = -1) for the system to be consistent.

Back Substitution

Starting from the bottom and working upwards:

  1. From x_4 - 2x_5 = 1:
    Let x_5 = 0, then x_4 = 1.

  2. Substituting x_4 = 1 and x_5 = 0 into x_3 - x_4 + 3x_5 = -2:
    x_3 = -1.

  3. Substituting x_3 = -1, x_4 = 1, and x_5 = 0 into x_1 - 2x_2 + x_3 - x_4 + x_5 = 0:
    x_1 = 2 + 2x_2 + 2x_5.

Particular Solution

By setting x_2 = 0 and x_5 = 0, the particular solution becomes:

\begin{pmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \\ x_5 \end{pmatrix} = \begin{pmatrix} 2 \\ 0 \\ -1 \\ 1 \\ 0 \end{pmatrix}

Contribution from Free Variables

The general solution includes contributions from free variables (x_2) and (x_5).

Contribution from (x_2):

\mathbf{x}_{x_2} = x_2 \begin{pmatrix} 2 \\ 1 \\ 0 \\ 0 \\ 0 \end{pmatrix}

Contribution from (x_5):

\mathbf{x}_{x_5} = x_5 \begin{pmatrix} 2 \\ 0 \\ -1 \\ 2 \\ 1 \end{pmatrix}

General Solution

Combining the particular solution with contributions from the free variables, the general solution is:

\mathbf{x} = \begin{pmatrix} 2 \\ 0 \\ -1 \\ 1 \\ 0 \end{pmatrix} + x_2 \begin{pmatrix} 2 \\ 1 \\ 0 \\ 0 \\ 0 \end{pmatrix} + x_5 \begin{pmatrix} 2 \\ 0 \\ -1 \\ 2 \\ 1 \end{pmatrix}

Conclusion

Solving systems of linear equations is a powerful tool in mathematics. By understanding matrix operations and identifying free variables, we can unlock multiple solutions and gain deeper insights into various problems. Whether dealing with theoretical mathematics or practical applications, mastering these techniques is invaluable.


Reference: “Mathematics for Machine Learning” by Marc Peter Deisenroth, A Aldo Faisal, and Cheng Soon Ong.

Comments