Professional Documents
Culture Documents
1 [20 MARKS]
Consider the system of linear equations
10y 4z + w = 1
x + 4y z + w = 2
3x + 2y + z + 2w = 5
2x 8y + 2z 2w = 4
x 6y + 3z
= 1
4 1 1 | 2 R1 R2
10 4 1 | 1
2 1 2 | 5
8 2 2 | 4
1 6 3 0 | 1
4 1 1 | 2
10 4 1 | 1
10 4 1 | 1
3R1 + R3 R3
0 0 0|
0
2R1 + R4
R1 + R5 R5
0 10 4 1 | 1
1 4 1 1 | 2
R4
1
52 10
1
10
10 4 1 | 1
0 0 0 | 0
0 10 4 1 | 1
R2/10
R2
4 1 1 | 2
1 52
1
10
1
10
0 0 0 | 0
0 0 0 | 0
00 0 0 | 0
3
5
1 52
3
5
8
5
1
10
1
10
10R2 + R3
10R2 + R4
0 0 0 | 0
0 0 0 | 0
00 0 0 | 0
R3
R4
10R2 + R5 R5
4R2 + R1
R1
(b) Use Mathematica's command RowReduce to obtain the reduced rowechelon form and hence check that your answer in (a) is correct. [See
attached Mathematica document.]
(c) Use the Gauss-Jordan elimination to solve the system.
Solution. From the reduced row-echelon form of the augmented matrix,
we have
3
8
1
1
3
2
x + z + w = and y z + w =
5
5
5
5
10
10
There are three unknowns and two equations. This means there are innitely many solutions. Thus, let w = r R and z = s R. Then, we
have the solutions
3
1
2
1
3
8
r+ s ,
r + s , s, r
(x, y, z, w) =
5
5
5
10
5
10
2 [20 MARKS]
Consider the system:
x + 2y
3z = 4
3x y +
5z = 2
4x + y + (a2 14)z = a + 2
marks
(a) Which value(s) of a will the system have: (i) No solutions? (ii) Exactly
one solution? (iii) Innitely many solutions?
Solution. By Gaussian elimination, we have:
1 2
4 1 a2 14 | a + 2
14
| 10
3R1 + R2
R2
0 7 a2 2 | a 14 4R1 + R3 R3
10
7
R2/7 R2
(1)
0 0 (a 4)(a + 4) | a 4 7R2 + R3 R3
00|
8
7
10|
10
7
001|
Thus
1
a+4
2
a+4
1
a+4
1 10
2
1
8
,
+
,
7 a+4 7
a+4 a+4
(i) There are no solutions if a = 4. (ii) There is exactly one solution if
a 6= 4. (iii) There are innitely many solutions if a = 4. This can be
deduced from matrix (1), where, if a = 4, then the last row is a row of
(x, y, z) =
zeros.
(b) For part (iii), with a value of a you found, plot the three equations in
3-dimensional space in one diagram using Plot3D command for values of
x, y [5, 5]. Your graphs should all meet along a line in 3-D space. Get
the best possible view by rotating the diagram and submit that view.
(See attached Mathematica document.)
[6 + 6 + 6 + 2 = 20]
marks
3 [40 MARKS]
For each of the systems below;
(1) Use the Gauss-Jordan Elimination to derive the inverse of the coecient
matrix.
(2) Use the Mathematica's command Inverse to check your answer in (a).
(3) Use the inverse matrix to conclude whether (a) there is exactly one solution, or (b) there are innitely many or no solutions. Give your reasons.
(i)
2b + 3c = 1
3a + 6b 3c = 2
6a + 6b + 3c = 5
[15 + 3 + 2 = 20]
Solution.
(1) Reducing the matrix
2 3 | 1 0 0
6 3 | 0 1
6 6
3 |001
0 2 |0
13
1
3
1 32 | 0
1
3
16
00 0 |1
2
3
13
marks
(2)
Since we cannot have the form [I|A1 ], the coecient matrix, A, does not have
an inverse.
(ii)
x1 + x2 + 2x3 = 8
x1 2x2 + 3x3 = 1
3x1 7x2 + 4x3 = 10
[15 + 3 + 2 = 20]
Solution.
marks
1 2 | 1 0 0
2 3 | 0 1
3 7 4 | 0 0 1
00|
1
4
9
26
10|
1
4
1
5
26
52
001|
1
4
5
26
7
52
1
52
(3)
Since we have the form [I|A1 ], the coecient matrix, A, has the inverse
1
4
9
26
1
4
1
5
26
52
1
4
5
26
7
52
1
52
4 [50 MARKS]
Consider the following system
2x1
= 4
2x1 + x2 x3
= 4
6x1 + 2x2 + x3
= 15
x4 = 1
SOLUTION
1 0 0 0 R1/2 R1
2 1 1 0
A1 =
6 2 1
0 0 0 1
E1 =
1/2 0 0 0 2 0 0 0
0 1 0 0 2 1 1 0
E1 A =
0 01
0 001
6 2 1
0 0 0 1
1 0 0
0 1 1 0 2R1 + R2 R2
A2 =
6 2 1
0 0 0 1
E2 E1 A = E2 A1 =
0 01
0 001
6 2 1
= A1
1 0 0 0
2 1 0 0
1 0 0 0
2 1 0 0
E 1 =
E2 =
0 0 1 0
0 0 1 0
0 1 0
6 2 1
0001
0 0 0 1
0 0 0 1 0 0 0
1 0 0
2 1 1 0
0001
E11 =
0 0 1
1 0 0 0
2 1 1 0
0001
2 0 0 0
0 1 0 0
1/2 0 0 0
0 1 0 0
0 0 0 1
0 0
2 1
1 1 0
0 0 0 1
0 001
= A2
A3 =
0 0
1 1 0
2 1
0 0 0 1
6R1 + R3
E3 =
R3
0 0 0
1 0 0
01
E31 =
0 001
0 0 0
1 0 0
0 1 0
0001
E3 E2 E1 A = A3
A4 =
0 0
1 1 0
0 3
0 0 0 1
2R2 + R3
E4 =
R3
0 0 0
1 0 0
2 1
E41 =
0 0 0
1 0 0
0001
0 0 01
E4 E3 E2 E1 A = A4
A5 =
0 0
1 1 0
0 1
0 0 0 1
R3/3
E5 =
R3
0 0 0
1 0 0
1
3
0001
E51 =
0 0 0
1 0 0
0 3 0
0001
E5 E4 E3 E2 E1 A = A5
A6 =
1 0 0 0
0 1 0 0
1 1 0
0 1
0 0 0 1 R3 R3
E6 =
01 0
1 0 0 0
1 0 0 0
0 1 0 0
E61 =
0 0 1 0
1 0 0 0
0 1 1 0
0 0 0 1
0 0 0 1
E6 E5 E4 E3 E2 E1 A = A6
1 0 0 0
0 1 0 0 R3 + R2 R2
A7 =
0 0 1 0
0001
1 0 0 0
0 1 1 0
E 1 =
E7 =
0 0 1 0
0 0 1 0
0001
00 0 1
E7 E6 E5 E4 E3 E2 E1 A = A7 = I
(b) Use the elementary matrices to nd A1 . Check you answer using Mathematica.
Solution.
E7 E6 E5 E4 E3 E2 E1 A = I E7 E6 E5 E4 E3 E2 E1 = A1
2 1 0
1
2
2
3
E7 E6 E5 E4 E3 E2 E1 =
0 0 0
1 1
0
3 3
23 31
0 0 1
Solution
x = A1 b =
2
3
0 0 0 4
1 1
0
4
3 3
32 13
0 0 1
1
2
15
2
1
1
U = A4 =
0 0
0 3
1 1 0
0 0 0 1
2 0 0 0
2 1 0 0
6 21
0 001
(e) Solve the system using the LU -factorization method. Check that your
answer coincides with your answer in (c).
8
2 0 0 0 y1
2 1 0 0 y2
6 21
15
0
y3
0 001
y4
or
2y1
= 4
2y1 + y2
= 4
6y1 + 2y2 + y3
= 15
y4 = 1
0 x1
1 1 0
x2
0 0
0 3
0
x3
0 0 0 1
x4
or
x1
= 2
x2 x3
= 0
3x3
= 3
x4 = 1
= 249
This is simple to solve to get (a1 , a2 ) = (17/5, 1/50). Thus, the polynomial is
1
17
t t2 , t 0
5
50
Thus, in 2020, that is, after t = 30 years, the population will be p(30) =
333 million, and in 2030, that is, after t = 40years, p(40) = 353 million.
p(t) = 249 +
(2) Use Mathematica to plot the polynomial and extend it to include the
years up to 2030.
p
400
300
200
100
0
0
10
20
30
40
Here t = 0, 10, 20, 30, 40 represent 1990, 2000, 2010, 2020 and 2030, respectively.
= 400
+x3 x4
x2 +x3
= 600
+x5 = 300
x4 +x5 = 100
1 0 0 0 | 400
0 1 1 0 | 600
1 1 0 1|
300
0 0 0 1 1 | 100
1 0 1 0 1 | 700
0 1 1 0 1 | 300
0 0 1 1 | 100
00000| 0
from which
x1 + x3 + x5 = 700
x2 + x3 + x5 = 300
x4 + x5
= 100
(a) From the last row of the matrix, which has all zero entries, we know there
are innitely many solutions. Now, let x5 = s, s R, and x3 = r, r R.
Then we have the solutions of the form
(x1 , x2 , x3 , x4 , x5 ) = (700 [r + s], 300 [r + s], r, 100 s, s)
11
[15 marks]
7 Encryption [40 MARKS]
Read Example 5 (page 88) and Example 6 (page 89). Repeat the same examples, but use a dierent 3 3 invertible matrix, A. Will you get the same
message?
12
Assignment 2 Solutions
Part I
Question 1
A = 880, 10, - 4, 1<, 81, 4, - 1, 1<, 83, 2, 1, 2<, 8- 2, - 8, 2, - 2<, 81, - 6, 3, 0<<;
Ab = 880, 10, - 4, 1, 1<, 81, 4, - 1, 1, 2<,
83, 2, 1, 2, 5<, 8- 2, - 8, 2, - 2, - 4<, 81, - 6, 3, 0, 1<<;
b = 81, 2, 5, - 4, 1<;
MatrixForm@AbD
0 10 - 4 1 1
1 4 -1 1 2
3 2 1 2 5
-2 -8 2 -2 -4
1 -6 3 0 1
MatrixForm@RowReduce@AbDD
MatrixForm@LinearSolve@A, bDD
1 0
0 1
0 0
0 0
0 0
3
5
2
-5
3
5
1
10
8
5
1
10
0
0
0
0
0
0
0
0
0
8
5
1
10
0
0
Question 2
Ab = 881, 2, - 3, 4<, 83, - 1, 5, 2<, 84, 1, a ^ 2 - 14, a + 2<<;
MatrixForm@AbD
1 2
-3
4
3 -1
5
2
4 1 - 14 + a2 2 + a
MatrixForm@RowReduce@AbDD
1 0 0
0 1 0
0 0 1
8
1
- 4+a
7
10
2
+ 4+a
7
1
4+a
ASS_02_PART_I.nb
-5
10
-10
-5
0
5
Question 3 (i)
AI = 880, - 2, 3, 1, 0, 0<, 83, 6, - 3, 0, 1, 0<, 86, 6, 3, 0, 0, 1<<;
MatrixForm@AID
MatrixForm@RowReduce@AIDD
0 -2 3 1 0 0
3 6 -3 0 1 0
6 6 3 0 0 1
1 0
0 -3
1
3
2
3
0 1 -2 0
0 0
1
3
1
-6
1
-3
Inverse::sing : Matrix 880, -2, 3<, 83, 6, -3<, 86, 6, 3<< is singular.
Question 3 (ii)
AI = 881, 1, 2, 1, 0, 0<, 8- 1, - 2, 3, 0, 1, 0<, 83, - 7, 4, 0, 0, 1<<;
MatrixForm@AID
MatrixForm@RowReduce@AIDD
1 1 2 1 0 0
-1 -2 3 0 1 0
3 -7 4 0 0 1
1 0 0
0 1 0
0 0 1
1
4
1
4
1
4
- 26
1
- 26
5
26
7
52
5
- 52
1
- 52
ASS_02_PART_I.nb
- 26
1
- 26
5
26
7
52
5
- 52
1
- 52
Question 4
A = 882, 0, 0, 0<, 8- 2, 1, - 1, 0<, 86, 2, 1, 0<, 80, 0, 0, - 1<<;
b = 84, - 4, 15, - 1<;
MatrixForm@AD
MatrixForm@bD
2
-2
6
0
0 0 0
1 -1 0
2 1 0
0 0 -1
4
-4
15
-1
0 0 0
1 -1 0
2 1 0
0 0 -1
0 0 0
1 -1 0
2 1 0
0 0 -1
1
0
0
0
0 0 0
1 -1 0
2 1 0
0 0 -1
ASS_02_PART_I.nb
0 0 0
1 -1 0
0 3 0
0 0 -1
1
0
0
0
0 0 0
1 -1 0
0 1 0
0 0 -1
1
0
0
0
0 0
1 -1
0 1
0 0
1
0
0
0
0
1
0
0
0
0
0
1
MatrixForm@Inverse@E1D.Inverse@E2D.
Inverse@E3D.Inverse@E4D.Inverse@E5D.Inverse@E6D.Inverse@E7DD
2
-2
6
0
0 0 0
1 -1 0
2 1 0
0 0 -1
MatrixForm@E7.E6.E5.E4.E3.E2.E1D
1
2
2
-3
5
-3
1
3
2
-3
1
3
1
3
0
0
0
0 -1
MatrixForm@Inverse@ADD
1
2
2
-3
5
-3
1
3
2
-3
1
3
1
3
0
0
0
0 -1
ASS_02_PART_I.nb
MatrixForm@Inverse@AD.bD
2
1
1
1
MatrixForm@LinearSolve@A, bDD
2
1
1
1
LU Factorization of A
L = Inverse@E1D.Inverse@E2D.Inverse@E3D.Inverse@E4D;
MatrixForm@LD
2
-2
6
0
0
1
2
0
0
0
1
0
0
0
0
1
MatrixForm@L.A4D
2
-2
6
0
0 0 0
1 -1 0
2 1 0
0 0 -1
MatrixForm@bD
4
-4
15
-1
ysol = LinearSolve@L, bD
82, 0, 3, - 1<
Assignment 2 Solutions
Part II
Question 5
A = 8810, 100<, 820, 400<<;
b = 832, 60<;
LinearSolve@A, bD
:
17
,5
50
>
17
p@t_D := 249 +
1
t -
t2 ;
50
p@30D
p@40D
333
353
Plot@p@tD, 8t, 0, 40<, LabelStyle Directive@LargeD,
PlotRange 880, 41<, 80, 400<<, GridLines Automatic, AxesLabel 8"t", "p"<D
p
400
300
200
100
0
0
10
20
30
40
ASS_02_PART_II.nb
Question 6
A = 881, - 1, 0, 0, 0<, 81, 0, 1, - 1, 0<, 80, 1, 1, 0, 1<, 80, 0, 0, 1, 1<<;
b = 8400, 600, 300, 100<;
Ab = 881, - 1, 0, 0, 0, 400<,
81, 0, 1, - 1, 0, 600<, 80, 1, 1, 0, 1, 300<, 80, 0, 0, 1, 1, 100<<;
MatrixForm@AD
MatrixForm@bD
MatrixForm@AbD
1 -1
1 0
0 1
0 0
0 0
1 -1
1 0
0 1
0
0
1
1
0 0
1 -1
1 0
0 1
0
0
1
1
400
600
300
100
1 -1
1 0
0 1
0 0
400
600
300
100
MatrixForm@RowReduce@AbDD
1
0
0
0
0
1
0
0
1
1
0
0
0
0
1
0
1 700
1 300
1 100
0 0
TeXForm@%D
\left(
\begin{array}{cccccc}
1 & 0 & 1 & 0 & 1 & 700 \\
0 & 1 & 1 & 0 & 1 & 300 \\
0 & 0 & 0 & 1 & 1 & 100 \\
0 & 0 & 0 & 0 & 0 & 0 \\
\end{array}
\right)
LinearSolve@A, bD
8700, 300, 0, 100, 0<