0% found this document useful (0 votes)
13 views11 pages

WS 3 Solution

The document provides solutions to various systems of equations using methods such as Cramer's rule, matrix inverse, and Gauss-Jordan elimination. Each problem is detailed with step-by-step calculations leading to the final solutions for the variables involved. The document includes multiple problems, showcasing different techniques for solving linear equations in a structured format.

Uploaded by

hana yahia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views11 pages

WS 3 Solution

The document provides solutions to various systems of equations using methods such as Cramer's rule, matrix inverse, and Gauss-Jordan elimination. Each problem is detailed with step-by-step calculations leading to the final solutions for the variables involved. The document includes multiple problems, showcasing different techniques for solving linear equations in a structured format.

Uploaded by

hana yahia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Department of Mathematics

Dr. Hossam M. Hassan

Mathematics II
for Business informatics Students (BSIN 104)
WorkSheet No. (3) – Solution
Problem 1:

Use Cramer’s rule to solve the following systems:


5𝑥 + 2𝑦 − 𝑧 = −7
2𝑥 − 3𝑦 = −4
(i) (ii) 𝑥 − 2𝑦 + 2𝑧 = 0
12𝑥 + 7𝑦 = 1
3𝑦 + 𝑧 = 17
Solution:

2 −3
(i) det(𝐴) = | | = 50
12 7
−4 −3
det(𝐴1 ) = | | = −25
1 7

2 −4
det(𝐴2 ) = | | = 50
12 1

det(𝐴1 ) −25 −1 det(𝐴2 ) 50


∴𝑥= = = and 𝑦= = =1
det(𝐴) 50 2 det(𝐴) 50

5 2 −1
(ii) det(𝐴) = |1 −2 2 | Using the elements of the first row
0 3 1
−2 2 1 2 1 −2
= 5| | − 2| | + (−1) | | = −45
3 1 0 1 0 3

−7 2 −1
det(𝐴1 ) = | 0 −2 2 | Using the elements of the second row
17 3 1

−7 −1 −7 2
= −2 | | − 2| | = 90
17 1 17 3
Page 1 of 11
5 −7 −1
det(𝐴2 ) = |1 0 2| Using the elements of the second row
0 17 1

−7 −1 5 −7
= −| | + 0 − 2| | = −180
17 1 0 17

5 2 −7
det(𝐴3 ) = |1 −2 0| Using the elements of the third row
0 3 17

5 −7 5 2
= −3 | | + 17 | | = −225
1 0 1 −2

det(𝐴1 ) 90 det(𝐴2 ) −180 det(𝐴3 ) −225


∴𝑥= = = −2 , 𝑦= = =4 and 𝑧= = =5
det(𝐴) −45 det(𝐴) −45 det(𝐴) −45

Problem 2:
Solve the following two systems using matrix inverse:
𝑥 + 2𝑦 + 3𝑧 = 2 4𝑥 − 3𝑦 + 𝑧 = 1
(i) 𝑥 + 𝑦 + 2𝑧 = 1 (ii) 𝑥−𝑦+𝑧 =1
2𝑦 + 𝑧 = 3 −2𝑥 + 2𝑦 − 𝑧 = 1
Solution:
1 2 3 𝑥 2
(i) System has the matrix form [1 1 2] [𝑦] = [1]
0 2 1 𝑧 3

𝑥 1 2 3 −1 2 −3 4 1 2 1
∴ [𝑦] = [1 1 2] [1] = [−1 1 1 ] [ 1] = [ 2 ]
𝑧 0 2 1 3 2 −2 −1 3 −1

4 −3 1 𝑥 1
(ii) System has the matrix form [ 1 −1 1 ] [𝑦] = [1]
−2 2 −1 𝑧 1

𝑥 4 −3 1 −1 1 1 1 2 1 4
∴ [𝑦] = [ 1 −1 1 ] [1] = [1 2 3] [1] = [6]
𝑧 −2 2 −1 1 0 2 1 1 3

Page 2 of 11
Problem 3:
1 1 2 −6 7 −2
If 𝐴𝐵 = 𝐵𝐴 = 𝑰 where 𝐴 = [1 2 2] and 𝐵 = [−1 1 0 ], then complete the following:
0 4 1 4 −4 1

(i) 𝐵−1 = ⋯ ⋯ ⋯ ⋯

𝑥 + 𝑦 + 2𝑧 = 1 𝑥 …
(ii) Solution of the system 𝑥 + 2𝑦 + 2𝑧 = 2 is [ 𝑦 ] = [ … ].
𝑧 …
4𝑦 + 𝑧 = 3
Solution:

(i) 𝐵−1 = 𝐴
1 1 2 𝑥 1
(ii) System has the matrix form 𝑦
[ 1 2 2] [ ] = [ 2]
0 4 1 𝑧 3

𝑥 1 1 2 −1 1 −6 7 −2 1 2
∴ [𝑦] = [1 2 2] [2] = [−1 1 0 ] [ 2] = [ 1 ]
𝑧 0 4 1 3 4 −4 1 3 −1

Problem 4:

Solve the next systems using Gauss-Jordan elimination method:

𝑥+𝑦+𝑧 =5 𝑥 + 2𝑦 − 3𝑧 = 2 𝑦 + 4𝑧 = 2
(i) 2𝑥 + 3𝑦 + 5𝑧 = 8 (ii) 6𝑥 + 3𝑦 − 9𝑧 = 6 (iii) 2𝑥 − 2𝑦 + 6𝑧 = 3
4𝑥 + 5𝑧 = 2 7𝑥 + 14𝑦 − 21𝑧 = 13 4𝑥 − 5𝑦 + 8𝑧 = 4

𝑥+𝑦+𝑧 =3
𝑥+𝑦+𝑧 =0 𝑥+𝑦+ 𝑧 =0
𝑥 + 2𝑦 + 𝑧 = 4
(iv) 𝑥 + 2𝑦 + 𝑧 = 0 (v) 𝑥 + 2𝑦 + 𝑧 = 0 (vi)
𝑥 + 𝑦 + 2𝑧 = 4
𝑥 + 𝑦 + 2𝑧 = 0 2𝑥 + 3𝑦 + 2𝑧 = 0
3𝑥 + 4𝑦 + 3𝑧 = 10

𝑥 − 2𝑦 − 𝑧 + 𝑤 = 3
(vii)
4𝑥 + 10𝑦 + 5 𝑧 + 4𝑤 = 2

Page 3 of 11
Solution:

(i) The augmented matrix of the system is as the following:

1 1 1 5
(2 3 5|8)
4 0 5 2

We will perform row operations until we obtain a matrix in reduced row echelon form.

1 1 1 5 −2𝑅 1 +𝑅2
−4𝑅1 +𝑅3
1 1 1 5 −𝑅2 +𝑅1
4𝑅2 +𝑅3
1 0 −2 7
(2 3 5|8) → ( 0 1 3 | −2 ) → (0 1 3 | −2 )
4 0 5 2 0 −4 1 −18 0 0 13 −26

1 2𝑅3 +𝑅1
𝑅 1 0 −2 7 1 0 0 3
13 3 −3𝑅3 +𝑅2
→ (0 1 3 | −2 ) → (0 1 0| 4 )
0 0 1 −2 0 0 1 −2

The unique solution of the system as follows:

𝑥=3 , 𝑦=4 and 𝑧 = −2

(ii) The augmented matrix of the system is as the following:

1 2 −3 2
(6 3 −9 | 6 )
7 14 −21 13

We will perform row operations until we obtain a matrix in reduced row echelon form.

−6𝑅1 +𝑅2
1 2 −3 2 −7𝑅1 +𝑅3
1 2 −3 2
(6 3 −9 | 6 ) → ( 0 −9 9 | −6 )
7 14 −21 13 0 0 0 −1

The last row of the last matrix produces a false equation where 0 = −1, then the system
has no solution.

Page 4 of 11
(iii) The augmented matrix of the system is as the following:

0 1 4 2
( 2 −2 6|3)
4 −5 8 4

We will perform row operations until we obtain a matrix in reduced row echelon form.

0 1 4 2 𝑅1⟷𝑅2 2 −2 6 3 1 𝑅1 1 −1 3 1.5
2
( 2 −2 6 | 3 ) → (0 1 4|2) → (0 1 4| 2 )
4 −5 8 4 4 −5 8 4 4 −5 8 4

−4𝑅1 +𝑅3 1 −1 3 1.5 𝑅𝑅2+𝑅 1 1 0 7 3.5


2 +𝑅3
→ (0 1 4 | 2 ) → ( 0 1 4| 2 )
0 −1 −4 −2 0 0 0 0

The output of the system is the following two equations:

𝑥 + 7𝑧 = 3.5
𝑦 + 4𝑧 = 2

Since the number of equations is 2 and the number of variables is 3, then we have 1 free variable
(The variable which is not a pivot, i.e. 𝑧).
Let 𝑧 = 𝑡
∴ 𝑥 = 3.5 − 7𝑡 and 𝑦 = 2 − 4𝑡

Then the solution vector can be written as the following:

𝑥 3.5 − 7𝑡 3.5 −7
[ 𝑦 ] = [ 2 − 4𝑡 ] = [ 2 ] + 𝑡 [ −4 ]
𝑧 𝑡 0 1

This linear system of equations has an infinite number of solutions. Since, by using different values
of 𝑡 ∈ ℝ, we can reach different solutions.

Page 5 of 11
1 1 1 0 −𝑅 1 +𝑅2
−𝑅1 +𝑅3
1 1 1 0 −𝑅2+𝑅1 1 0 1 0
(iv) (1 2 1| 0) → ( 0 1 0| 0) → ( 0 1 0| 0)
1 1 2 0 0 0 1 0 0 0 1 0

−𝑅3 +𝑅1 1 0 0 0
→ ( 0 1 0| 0)
0 0 1 0

The unique solution of the system as follows:

𝑥=𝑦=𝑧=0 (Trivial solution)

−𝑅1 +𝑅2
1 1 1 0 −2𝑅 1 1 1 0 −𝑅 2 +𝑅1 1 0 1 0
1 +𝑅3 −𝑅2 +𝑅3
(v) (1 2 1| 0) → ( 0 1 0| 0) → ( 0 1 0| 0)
2 3 2 0 0 1 0 0 0 0 0 0

The output of the system is the following two equations:

𝑥+𝑧 =0
𝑦=0

which means there is one free variable. If we let 𝑧 = 𝑡, then 𝑥 = −𝑡.

𝑥 −𝑡 −1
𝑦
∴ [ ] = [ 0 ] = 𝑡[ 0 ] (Nontrivial solution)
𝑧 𝑡 1

−𝑅1 +𝑅2
1 1 1 3 −𝑅1 +𝑅3 1 1 1 3 −𝑅2+𝑅1 1 0 1 2
1 2 1 4 −3𝑅1 +𝑅4 0 1 0 1 −𝑅2+𝑅4 0 1 0 1
(vi) ( | ) → ( | ) → ( | )
1 1 2 4 0 0 1 1 0 0 1 1
3 4 3 10 0 1 0 1 0 0 0 0

1 0 0 1
−𝑅3 +𝑅1 0 1 0 1
→ ( | )
0 0 1 1
0 0 0 0
We get the unique solution:
𝑥=𝑦=𝑧=1

Page 6 of 11
1 −2 −1 1 3 −4𝑅1+𝑅2 1 −2 −1 1 3
(viii) ( | ) → ( | )
4 10 5 4 3 0 18 9 0 −9

1
𝑅 2𝑅2 +𝑅1
18 3 1 −2 −1 1 3 1 0 0 1 2
→ ( | )→ ( | )
0 1 0.5 0 −0.5 0 1 0.5 0 −0.5

The output of the system is the following two equations:


𝑥+𝑤 =2
𝑦 + 0.5𝑧 = −0.5

which means there are two free variables. If we let 𝑧 = 𝑡 and 𝑤 = 𝑠, then:

𝑥 2−𝑠 2 0 −1
𝑦 −0.5 − 0.5𝑡 −0.5 −0.5 0
[ ]=[ ]=[ ]+𝑡[ ]+𝑠[ ]
𝑧 𝑡 0 1 0
𝑤 𝑠 0 0 1

Problem 5:

1. Find the inverse of 𝐴 (using Gauss-Jordan elimination method)

1 1 2
𝐴 =[1 2 3]
0 2 1
2. Hence, solve the following two systems

𝑥 + 2𝑦 + 3𝑧 = 2 4𝑥 − 3𝑦 + 𝑧 = 1
(i) 𝑥 + 𝑦 + 2𝑧 = 1 (ii) 𝑥−𝑦+𝑧 =1
2𝑦 + 𝑧 = 3 −2𝑥 + 2𝑦 − 𝑧 = 1

Solution:

1 1 2 1 0 0 −𝑅1+𝑅2 1 1 2 1 0 0
1. ( 1 2 3| 0 1 0) → (0 1 1 | −1 1 0)
0 2 1 0 0 1 0 2 1 0 0 1

−𝑅2 +𝑅1
−2𝑅2 +𝑅3
1 0 1 2 −1 0 −𝑅3 1 0 1 2 −1 0
→ (0 1 1 | −1 1 0 ) → ( 0 1 1 | −1 1 0 )
0 0 −1 2 −2 1 0 0 1 −2 2 −1

Page 7 of 11
−𝑅3 +𝑅1
−𝑅3 +𝑅2
1 0 0 4 −3 1
→ (0 1 0 | 1 −1 1)
0 0 1 −2 2 −1

4 −3 1
−1
∴ 𝐴 = [ 1 −1 1 ].
−2 2 −1
2.
𝑥 + 2𝑦 + 3𝑧 = 2 𝑥 + 𝑦 + 2𝑧 = 1
(i) The system 𝑥 + 𝑦 + 2𝑧 = 1 is the same as 𝑥 + 2𝑦 + 3𝑧 = 2 .
2𝑦 + 𝑧 = 3 2𝑦 + 𝑧 = 3

So, it has the matrix form


1 1 2 𝑥 1
[ 1 2 3 ][ 𝑦 ] = [ 2 ]
0 2 1 𝑧 3

𝑥 1 1 2 −𝟏 1 4 −3 1 1 1
∴ [𝑦]=[1 2 3] [2]=[ 1 −1 1 ] [ 2 ] = [ 2 ].
𝑧 0 2 1 3 −2 2 −1 3 −1

(ii) The second system has the matrix form


4 −3 1 𝑥 1
[ 1 −1 1 ][ 𝑦 ] = [ 1 ]
−2 2 −1 𝑧 1

𝑥 4 −3 1 −𝟏 1 1 1 2 1 4
∴ [ 𝑦 ] = [ 1 −1 1 ] [ 1 ] = [ 1 2 3 ] [ 1 ] = [ 6 ].
𝑧 −2 2 −1 1 0 2 1 1 3

Problem 6:

For the system 𝑥 + 𝑦 = 𝒌 and 𝑥 + 𝒉 𝑦 = 2. Determine the value(s) of 𝒉 and 𝒌 such that the system
has:

(i) No solution (ii) Unique solution (iii) Many solutions

Page 8 of 11
Solution:

1 1 𝑘 −𝑅1+𝑅2 1 1 𝑘
( | ) → ( | )
1 ℎ 2 0 ℎ−1 2−𝑘

(i) No solution: if ℎ − 1 = 0 and 2 − 𝑘 ≠ 0 ⇒ ℎ = 1 and 𝑘 ≠ 2.

(ii) Unique solution: if ℎ − 1 ≠ 0 ⇒ ℎ ≠ 1.

(iii) Many solutions: if ℎ − 1 = 0 and 2 − 𝑘 = 0 ⇒ ℎ = 1 and 𝑘 = 2.

Problem 7:

Complete the following table:

1 0 0 1 1 0 0 1 1 0 0 1
rref(𝐴|𝐵) 0 1 0 2 0 0 1 3 0 1 −1 2
0 0 1 3 0 0 0 2 0 0 0 0

𝑥=1 No solution 𝑥=1


Solution
𝑦=2 𝑦 =2+𝑡
𝑧=3 𝑧=𝑡

Problem 8:

Given the following matrices such that

3 −2 2 −2 2 1 𝑥1 𝑦1
𝑥2 𝑦2
1 2 2 3 2 −2 0
𝐴= 2 2 −2 2 3 , 𝐴 𝐴𝑇 = 𝑰 , 𝐵 = 0 , 𝑋 = 𝑥3 and 𝑌 = 𝑦3 .
5 𝑥4 𝑦4
2 2 −2 −3 −2 0
[ 2 −3 −2 2 −2 ] [1] [ 𝑥5 ] [ 𝑦5 ]

i. Solve the system 𝐴𝑇 𝑋 = 𝐵. ii. Solve the system 𝐴 𝑌 = 𝑶. iii. Find 𝐴−1 .

Solution:

Note that the matrix 𝐴 is an orthogonal matrix i.e. 𝐴−1 = 𝐴𝑇

Page 9 of 11
(i) To solve the system 𝐴𝑇 𝑋 = 𝐵, multiply both sides by 𝐴 from the left
1
0
𝐴𝐴𝑇 𝑋 = 𝐴𝐵 → 𝑰𝑋 = 𝐴𝐵 → 𝑋 = 𝐴𝐵 = 1 .
0
[0]
(ii) To solve the system 𝐴 𝑌 = 𝑶, multiply both sides by 𝐴𝑇 from the left
0
0
𝐴𝑇 𝐴 𝑌 = 𝐴𝑇 𝑶 → 𝑰𝑌 = 𝑶 → 𝑌=𝑶= 0 .
0
[0]
(iii)
3 2 2 2 2
1 −2 2 2 2 −3
𝐴−1 𝑇
=𝐴 = 2 3 −2 −2 −2 .
5
−2 2 2 −3 2
[ 2 −2 3 −2 −2 ]

Problem 9:

Find the inverse for each of the following matrices if possible (using Gauss-Jordan Elimination):

2 3 −1 1 0 1
0 −1
(i) 𝐴=[ ] (ii) 𝐵 = [ 0 0 0] (iii) 𝐶 = [ 0 4 3]
2 20
−3 −1 −2 0 0 2

1 0 0 0
1 3 5
1 1/2 0 0
(iv) 𝐷 = [100 6 2 ] (v) 𝐸 = [ ]
1 3 2 0
1 3 5
1 3 5 1

Solution:
1
𝑅1 ⟷𝑅2 𝑅
0 −1 1 0 2 20 0 1 2 1 1 10 0 0.5
(i) ( | ) → ( | ) → ( | )
2 20 0 1 0 −1 1 0 0 −1 1 0

− 𝑅2 1 10 0 0.5 −10𝑅2+𝑅1 1 0 10 0.5 10 0.5


→ ( | ) → ( | ) ∴ 𝐴−1 = [ ]
0 1 −1 0 0 1 −1 0 −1 0

Page 10 of 11
(ii) Matrix B has no inverse as it is a singular matrix. The elements in the second row are all
zeros so, the determinant is zero.

1 0 1 1 0 0 𝑅2 /4
1 0 1 1 0 0
(iii) (0 4 3| 0 1 0) ⇒ ( 0 1 3/4 | 0 1/4 0 )
0 0 2 0 0 1 0 0 2 0 0 1

−3
𝑅 + 𝑅2
4 3
𝑅3 /2
1 0 1 1 0 0 −𝑅3 + 𝑅1
1 0 0 1 0 −1/2
⇒ ( 0 1 3/4 | 0 1/4 0 ) ⇒ ( 0 1 0 | 0 1/4 −3/8 )
0 0 1 0 0 1/2 0 0 1 0 0 1/2

1 0 −1/2
−1
∴ 𝐶 = [ 0 1/4 −3/8 ]
0 0 1/2

(iv) Matrix D has no inverse as it is a singular matrix. The first and third row elements are
identical so, the determinant is zero.

− 𝑅1 + 𝑅2
1 0 0 0 1 0 0 0 −𝑅1+ 𝑅3 1 0 0 0 1 0 0 0
1 1/2 0 0 0 1 0 0 −𝑅1 + 𝑅4 0 1/2 0 0 −1 1 0 0
(v) ( | )⇒ ( | )
1 3 2 0 0 0 1 0 0 3 2 0 −1 0 1 0
1 3 5 1 0 0 0 1 0 3 5 1 −1 0 0 1
1 0 0 0 1 0 0 0 −3𝑅2+ 𝑅3 1 0 0 0 1 0 0 0
2𝑅2 0 1 0 0 −2 2 0 0 −3𝑅2 + 𝑅4 0 1 0 0 −2 2 0 0
⇒ ( | ) ⇒ ( | )
0 3 2 0 −1 0 1 0 0 0 2 0 5 −6 1 0
0 3 5 1 −1 0 0 1 0 0 5 1 5 −6 0 1

1 0 0 0 1 0 0 0
𝑅3 /2 0 1 0 0 −2 2 0 0
⇒ ( | )
0 0 1 0 5/2 −3 1/2 0
0 0 5 1 5 −6 0 1

1 0 0 0 1 0 0 0 1 0 0 0
−5𝑅3 + 𝑅4 0 1 0 0 −2 2 0 0 −2 2 0 0
⇒ ( | ∴ 𝐸 −1 =[ ]
0 0 1 0 5/2 −3 1/2 0) 5/2 −3 1/2 0
0 0 0 1 −15/2 9 −5/2 1 −15/2 9 −5/2 1

Page 11 of 11

You might also like