You are on page 1of 23

Linear Algebra

EB/BE 104
By
Dr. Shaimaa Y. Abdelkader
Lecture 5
System of linear equations
Gaussian elimination method
Definition “Rank of a matrix”:

Rank of a matrix 𝐴𝐴 is the number of the non-zero rows in its row echelon form matrix and it is
denoted by 𝑟𝑟(𝐴𝐴)
Example 1: Find the rank of the following matrix
1 2 3
𝐵𝐵 = 4 −3 0
6 1 6

3
Example 2: Find the rank of the following matrix

1 −1 3
𝐴𝐴 =
2 1 3
Solution:

1 −1 3 −2𝑅𝑅1 +𝑅𝑅2 1 −1 3
𝐴𝐴 =
2 1 3 � 0 3 −3
Therefore 𝑟𝑟 𝐴𝐴 = 2

4
Definition “Rank of a matrix”:

Rank of a matrix 𝐴𝐴 is the number of the non-zero rows in its row echelon form matrix and it is
denoted by 𝑟𝑟(𝐴𝐴)
Example 1: Find the rank of the following matrix
1 2 3
𝐵𝐵 = 4 −3 0
6 1 6

5
Example 2: Find the rank of the following matrix

1 −1 3
𝐴𝐴 =
2 1 3
Solution:

1 −1 3 −2𝑅𝑅1 +𝑅𝑅2 1 −1 3
𝐴𝐴 =
2 1 3 � 0 3 −3
Therefore 𝑟𝑟 𝐴𝐴 = 2

6
Example: Find rank of the following matrices
1 3 1 −2 −3 1 2 3
1 4 3 −1 −4 , 2 4 6
2 3 −4 −9 −8 4 8 12

Solution : Home work


Linear equations:

Linear equation in two variables 𝑥𝑥 , 𝑦𝑦 is:

𝑎𝑎1 𝑥𝑥 + 𝑎𝑎2 𝑦𝑦 = 𝑏𝑏,

Example:

1. 3𝑥𝑥 + 2𝑦𝑦 = 7 linear equation

2. 𝑥𝑥𝑥𝑥 + 𝑧𝑧 = 2 non-linear equation

3. 𝑒𝑒 𝑥𝑥 + 2𝑦𝑦 = 4 non-linear equation

4. 3𝑥𝑥 + sin 𝑦𝑦 = 𝑒𝑒 2 non-linear equation


System of linear equations:

𝑎𝑎11 𝑥𝑥1 + 𝑎𝑎12 𝑥𝑥2 + ⋯ + 𝑎𝑎1𝑛𝑛 𝑥𝑥𝑛𝑛 = 𝑏𝑏1


𝑎𝑎21 𝑥𝑥1 + 𝑎𝑎22 𝑥𝑥2 + ⋯ + 𝑎𝑎2𝑛𝑛 𝑥𝑥𝑛𝑛 = 𝑏𝑏2
� 𝟏𝟏

𝑎𝑎𝑚𝑚𝑚 𝑥𝑥1 + 𝑎𝑎𝑚𝑚𝑚 𝑥𝑥2 + ⋯ + 𝑎𝑎𝑚𝑚𝑚𝑚 𝑥𝑥𝑛𝑛 = 𝑏𝑏𝑚𝑚

• The number of unknowns: 𝑛𝑛

• The number of equations: 𝑚𝑚

• The numbers 𝑏𝑏1 , 𝑏𝑏2 , … , 𝑏𝑏𝑚𝑚 are called the constant of the system.

• 𝑥𝑥1 , 𝑥𝑥2 … , 𝑥𝑥𝑛𝑛 are the unknowns

• 𝑎𝑎11 , 𝑎𝑎12 , … 𝑎𝑎𝑚𝑚𝑚𝑚 are the coefficients of the system.


Now, we can write the above system as:
𝑨𝑨𝑨𝑨 = 𝒃𝒃
Where

𝑎𝑎11 𝑎𝑎12 𝑎𝑎13 ⋯ 𝑎𝑎1𝑛𝑛


𝐴𝐴 = 𝑎𝑎21 𝑎𝑎22 𝑎𝑎23 … 𝑎𝑎2𝑛𝑛 Coefficient matrix
⋮ ⋮ ⋮
𝑎𝑎𝑚𝑚𝑚 𝑎𝑎𝑚𝑚𝑚 𝑎𝑎𝑚𝑚𝑚 ⋯
𝑎𝑎𝑚𝑚𝑚𝑚

𝑥𝑥1 𝑏𝑏1
𝑥𝑥2 𝑏𝑏2
𝑋𝑋 = ⋮ vector of unknowns 𝑏𝑏 = vector of constants

𝑥𝑥𝑛𝑛 𝑏𝑏𝑛𝑛

• If 𝑏𝑏 = 0, the system (1) is called homogenous otherwise is nonhomogeneous.


Example:
3𝑥𝑥1 + 2𝑥𝑥2 = 3
−𝑥𝑥1 + 𝑥𝑥2 = 4
5𝑥𝑥1 + 𝑥𝑥2 = 0
This system can be written as:

3 2 𝑥𝑥1 3
−1 1 𝑥𝑥2 = 4 non-homogenous system
5 1 0
Augmented Matrix: the matrix

𝑎𝑎11 𝑎𝑎12 𝑎𝑎13 ⋯ 𝑎𝑎1𝑛𝑛 𝑏𝑏1


Ab = 𝑎𝑎21 𝑎𝑎22 𝑎𝑎23 … 𝑎𝑎2𝑛𝑛 𝑏𝑏2
⋮ ⋮ ⋮ ⋮
𝑎𝑎𝑚𝑚𝑚 𝑎𝑎𝑚𝑚𝑚 𝑎𝑎𝑚𝑚𝑚 ⋯
𝑎𝑎 𝑚𝑚𝑚𝑚 𝑏𝑏
𝑛𝑛

Is called the augmented matrix for the system (1).


Example:
3𝑥𝑥1 + 2𝑥𝑥2 = 3
−𝑥𝑥1 + 𝑥𝑥2 = 4
5𝑥𝑥1 + 𝑥𝑥2 = 0
The augmented matrix is

3 23
A b = −1 14
5 10
Consider the system of two linear equation in two variable
𝑎𝑎11 𝑥𝑥1 + 𝑎𝑎12 𝑥𝑥2 = 𝑏𝑏1
𝑎𝑎21 𝑥𝑥1 + 𝑎𝑎22 𝑥𝑥2 = 𝑏𝑏2

b. The system has


infinitely many
solutions and it is c. The system has no
said to be consistent solution and it is said to
a. The system has a be inconsistent
unique solution and it
is said to be consistent.
Gaussian elimination method for solving the linear system (1) (non-homengeous system) :

The steps of this method:

1. Transform the augmented matrix 𝐴𝐴 𝑏𝑏 into its row echelon form using elementary row
operations.

2. Determine 𝑟𝑟 𝐴𝐴 𝑏𝑏 and 𝑟𝑟(𝐴𝐴), there are two cases

• If 𝑟𝑟 𝐴𝐴 𝑏𝑏 ≠ 𝑟𝑟(𝐴𝐴), the system is inconsistent (has no solution)

• If 𝑟𝑟 𝐴𝐴 𝑏𝑏 = 𝑟𝑟 𝐴𝐴 = 𝑟𝑟, the system is consistent (has solution)

If 𝑟𝑟 = 𝑛𝑛 (no. of unknowns) If 𝑟𝑟 < 𝑛𝑛


Then the system has a unique solution Then the system has infinitely many solutions

3. Using back substitution to obtain the unknowns


Gaussian elimination method for solving the linear system (1):

𝑨𝑨𝑨𝑨 = 𝒃𝒃, 𝒃𝒃 ≠ 𝟎𝟎

the system is consistent (has The system is inconsistent


solution) (has no solution)
𝑟𝑟 𝐴𝐴 𝑏𝑏 = 𝑟𝑟 𝐴𝐴 = 𝑟𝑟 𝑟𝑟 𝐴𝐴 𝑏𝑏 ≠ 𝑟𝑟(𝐴𝐴)

If 𝑟𝑟 < 𝑛𝑛
If 𝑟𝑟 = 𝑛𝑛 (no. of unknowns)
Then the system has infinitely many
Then the system has a unique
solutions
solution
(𝑛𝑛 − 𝑟𝑟 arbitrary parameters in solution)
15
Example: By using Gaussian elimination method, solve the following system, if possible

𝑥𝑥1 − 𝑥𝑥2 + 2𝑥𝑥3 = 4


𝑥𝑥1 + 𝑥𝑥3 = 6
� ∗
2𝑥𝑥1 − 3𝑥𝑥2 + 5𝑥𝑥3 = 4
3𝑥𝑥1 + 2𝑥𝑥2 − 𝑥𝑥3 = 1
Solution: The System (∗) is non-homogenous, and the augmented matrix for this system is given by

1 −1 2 4 −𝑅𝑅1 + 𝑅𝑅2 1 −1 2 4
1 0 1 6 � 0 1 −1 2
Ab = −2𝑅𝑅1 + 𝑅𝑅3
2 −3 5 4 0 −1 1 −4
3 2 −1 1 −3𝑅𝑅1 + 𝑅𝑅4 0 5 −7 −11

1 −1 2 4 1 −1 2 4
𝑅𝑅2 + 𝑅𝑅3 0 1 −1 2 𝑅𝑅3 ⇋ 𝑅𝑅4 0 1 −1 2
� 0 0 0 −2 � 0 0 −2 −21
−5𝑅𝑅2 + 𝑅𝑅4
0 0 −2 −21 0 0 0 −2

1 1 −1 2 4
𝑅𝑅 0 1 −1 2
−2 3 21
� 0 0 1
1 2
𝑅𝑅
−2 4 0 0 0 1
Since 𝑟𝑟 𝐴𝐴 𝑏𝑏 = 4 & 𝑟𝑟(𝐴𝐴) = 3, then the system is inconsistent.
Example:
2𝑥𝑥1 + 3𝑥𝑥3 = 3
4𝑥𝑥1 − 3𝑥𝑥2 + 7𝑥𝑥3 = 5
8𝑥𝑥1 − 9𝑥𝑥2 + 15𝑥𝑥3 = 10
Solution: The augmented matrix of the given system is

2 0 3 3 −2𝑅𝑅 + 𝑅𝑅 2 0 3 3
1 2
A b = 4 −3 7 5 � 0 −3 1 −1
8 −9 15 10 −4𝑅𝑅1 + 𝑅𝑅3 0 −9 3 −2

1 3 3
2 0 3 3 𝑅𝑅 1 0
2 1 2 2
−3𝑅𝑅2 + 𝑅𝑅3 0 −3 1 −1 1 1
� � 0 1 −3
0 0 0 1 1 3
− 𝑅𝑅2 0 0 0 1
3

Since 𝑟𝑟 𝐴𝐴 𝑏𝑏 = 3 & 𝑟𝑟(𝐴𝐴) = 2, then the system is inconsistent


Example :
2𝑥𝑥1 + 𝑥𝑥2 + 𝑥𝑥3 = 1
6𝑥𝑥1 + 2𝑥𝑥2 + 𝑥𝑥3 = −1
−2𝑥𝑥1 + 2𝑥𝑥2 + 𝑥𝑥3 = 7
Solution: The augmented matrix of the given system

2 1 1 1 −3𝑅𝑅1 + 𝑅𝑅2 2 1 1 1
A b = 6 2 1 −1 � 0 −1 −2 −4
−2 2 1 7 𝑅𝑅1 + 𝑅𝑅3 0 3 2 8

1� 𝑅𝑅 1 1 1
2 1 1 1 2 1 1
3𝑅𝑅2 + 𝑅𝑅3 � 2 2 2
0 −1 −2 −4 −𝑅𝑅2 0 1 2 4
� 0 0 −4 −4
−1� 𝑅𝑅 0 0 1 1
4 3,
Since 𝑟𝑟 𝐴𝐴 𝑏𝑏 = 𝑟𝑟 𝐴𝐴 = 3 = 𝑛𝑛(𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑜𝑜𝑜𝑜 𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢), then the system is consistent and has a unique solution given by
3rd row in matrix gives: 𝑥𝑥3 = 1
2nd row in matrix gives: "𝑥𝑥2 + 2𝑥𝑥3 = 4 𝑥𝑥2 + 2 = 4 𝑥𝑥2 = 2
1 1 1 1 1
1st row in matrix gives: 𝑥𝑥1 + 𝑥𝑥2 + 𝑥𝑥3 = 𝑥𝑥1 = − 1 − = −1
2 2 2 2 2
Leading variable and Free variable:
Leading variable: In row-echelon form, the first non-zero entry in each row “leading entry” is 1, and its column corresponds to a
leading variable.
Free variable: all non-leading variable
(Note: Essentially, a column that doesn’t correspond to leading variable, must correspond to a free variable)

Example:

1 2 4 −1 𝑥𝑥1 : 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣


0 1 2 2 �𝑥𝑥2 : 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣
0 0 0 0 𝑥𝑥3 : 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣

1 6 0 3 0 0 𝑥𝑥 , 𝑥𝑥 𝑥𝑥 : 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣
0 0 1 −8 0 5 � 1 3 5
𝑥𝑥2 , 𝑥𝑥4 : 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣
0 0 0 0 1 7
Example :

𝑥𝑥2 − 𝑥𝑥3 = 0
𝑥𝑥1 − 3𝑥𝑥3 = −1
−𝑥𝑥1 + 3𝑥𝑥2 = 1
Solution:

0 1 −1 0 1 0 −3 −1
Ab = 1 𝑅𝑅1 ⇌ 𝑅𝑅2
0 −3 −1 0 1 −1 0

−1 3 0 1 −1 3 0 1
1 0 −3 −1 1 0 −3 −1
𝑅𝑅1 + 𝑅𝑅3 0 1 −1 0 −3𝑅𝑅2 + 𝑅𝑅3 0 1 −1 0
� 0 3 −3 0 � 0 0 0 0

Now, 𝑟𝑟 𝐴𝐴 𝑏𝑏 = 𝑟𝑟 𝐴𝐴 = 2 < 3(𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑜𝑜𝑜𝑜 𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢), so the system is consistent and has infinitely many solutions.
Let 𝑥𝑥3 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 = 𝑡𝑡
2nd row in matrix gives: 𝑥𝑥2 − 𝑥𝑥3 = 0 𝑥𝑥2 = 𝑡𝑡
1st row in matrix gives: 𝑥𝑥1 − 3𝑥𝑥3 = −1 𝑥𝑥1 = −1 + 3𝑡𝑡
The set of solution is given by: {𝑥𝑥1 = −1 + 3𝑡𝑡 , 𝑥𝑥2 = 𝑡𝑡 , 𝑥𝑥3 = 𝑡𝑡}
If we pick 𝑡𝑡 = 0, we get one solution {𝑥𝑥1 = −1 , 𝑥𝑥2 = 0 , 𝑥𝑥3 = 0}
Example :

𝑥𝑥1 + 𝑥𝑥2 − 5𝑥𝑥3 = 3


𝑥𝑥1 − 2 𝑥𝑥3 = 1
2𝑥𝑥1 − 𝑥𝑥2 − 𝑥𝑥3 = 0

Solution:

1 1 −5 3 −𝑅𝑅1 + 𝑅𝑅2 1 1 −5 3 1 1 −5 3
Ab = 1 0 −2 1 0 −1 3 −2 −3𝑅𝑅2 + 𝑅𝑅3 0 −1 3 −2
� �
2 −1 −1 0 −2𝑅𝑅1 + 𝑅𝑅3 0 −3 9 −6 0 0 0 0

Now, 𝑟𝑟 𝐴𝐴 𝑏𝑏 = 𝑟𝑟 𝐴𝐴 = 2 < 3(number of unkowns), so the system is consistent and has infinitely many solutions solution.

Let 𝑥𝑥3 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 = 𝑡𝑡


• 2nd row in matrix gives: 𝑥𝑥2 − 3𝑥𝑥3 = 2 𝑥𝑥2 = 2 + 3𝑡𝑡
• 1st row in matrix gives: 𝑥𝑥1 + 𝑥𝑥2 − 5𝑥𝑥3 = 3 𝑥𝑥1 = 1 + 2𝑡𝑡
The set of solution is given by: {𝑥𝑥1 = 1 + 2𝑡𝑡 , 𝑥𝑥2 = 2 + 3𝑡𝑡 , 𝑥𝑥3 = 𝑡𝑡}
If we pick 𝑡𝑡 = 0, we get one solution {𝑥𝑥1 = 1 , 𝑥𝑥2 = 2 , 𝑥𝑥3 = 0}
Example: Discuss the consistency of the following system for all values of 𝜆𝜆
𝑥𝑥 + 2𝑦𝑦 + 𝑧𝑧 = 3
𝑥𝑥 + 𝑦𝑦 + 𝑧𝑧 = 𝜆𝜆
3𝑥𝑥 + 𝑦𝑦 + 3𝑧𝑧 = 𝜆𝜆2
And find the solution whenever possible.
Solution:

1 2 1 3 −𝑅𝑅 + 𝑅𝑅 1 2 1 3 1 2 1 3 1 2 1 3
𝐴𝐴 𝑏𝑏 = 1 1 1 𝜆𝜆
1 2
0 −1 0 𝜆𝜆 − 3 −5𝑅𝑅2 + 𝑅𝑅3 0 −1 0 𝜆𝜆 − 3 −𝑅𝑅2 0 1 0 −𝜆𝜆 + 3

3 1 3 𝜆𝜆2 −3𝑅𝑅1 + 𝑅𝑅3 0 −5 0 𝜆𝜆2 − 9 � 0 0 0 𝜆𝜆2 − 5𝜆𝜆 + 6 � 0 0 0 (𝜆𝜆 − 3)(𝜆𝜆 − 2)

1) if 𝜆𝜆 ≠ 2 & 𝜆𝜆 ≠ 3 , then 𝑟𝑟 𝐴𝐴 𝑏𝑏 = 3≠ 𝑟𝑟 𝐴𝐴 = 2. So, the system is inconsistent.


2) if 𝜆𝜆 = 2, then 𝑟𝑟 𝐴𝐴 𝑏𝑏 = 𝑟𝑟 𝐴𝐴 = 2 < 3. So the system is consistent and has infinitely many solutions.

1 2 1 3 𝑧𝑧 = 𝑡𝑡
• 𝐴𝐴 𝑏𝑏 � 0 1 0 1 � 𝑦𝑦 = 1
0 0 0 0 𝑥𝑥 = 3 − 2 − 𝑡𝑡 = 1 − 𝑡𝑡
1) if 𝜆𝜆 = 3, then 𝑟𝑟 𝐴𝐴 𝑏𝑏 = 𝑟𝑟 𝐴𝐴 = 2 < 3.so the system is consistent and has infinitely many solutions.

1 2 1 3 𝑧𝑧 = 𝑡𝑡
• 𝐴𝐴 𝑏𝑏 � 0 1 0 0 � 𝑦𝑦 = 0
0 0 0 0 𝑥𝑥 = 3 − 𝑡𝑡
Example: For what values of α and β the following system of equation

𝑥𝑥 + 𝑦𝑦 + 𝑧𝑧 = 6
𝑥𝑥 + 2𝑦𝑦 + 3𝑧𝑧 = 10
𝑥𝑥 + 2𝑦𝑦 + α 𝑧𝑧 = 𝛽𝛽

has 1) No solution 2) unique solution 3) infinitely many solution.

Solution:

1 1 1 6 −𝑅𝑅1 + 𝑅𝑅2 1 1 1 6 1 2 1 6
𝐴𝐴 𝑏𝑏 = 1 2 3 10 0 1 2 4 −𝑅𝑅2 + 𝑅𝑅3 0 1 2 4
� �
1 2 α 𝛽𝛽 −𝑅𝑅1 + 𝑅𝑅3 0 1 α − 1 𝛽𝛽 − 6 0 0 α − 3 𝛽𝛽 − 10

1. if α = 3 & 𝛽𝛽 ≠ 10 , then 𝑟𝑟 𝐴𝐴 𝑏𝑏 = 3≠ 𝑟𝑟 𝐴𝐴 = 2. So, the system is inconsistent

2. if α ≠ 3 & 𝛽𝛽 ∈ 𝑅𝑅 , then 𝑟𝑟 𝐴𝐴 𝑏𝑏 = 𝑟𝑟 𝐴𝐴 = 3. So, the system is consistent and has a unique solution.

3. if α = 3 & 𝛽𝛽 = 10 , then 𝑟𝑟 𝐴𝐴 𝑏𝑏 = 𝑟𝑟 𝐴𝐴 = 2. So, the system is consistent and has infinitely many solutions.

You might also like