Linear EQ Matrix
Linear EQ Matrix
1
2 + 3y = 0, y= + 4z + 6, 1 − 22 − 33 + 4 = 7
2
An example
Using Kirchhoff’s laws, the following circuit
20 Ω 10 Ω
Q
i1 i3
80 V 10 Ω 90 V
i2
P
15 Ω
Node P: 1 − 2 + 3 = 0
Node Q: −1 + 2 − 3 = 0
Right loop: 102 + 253 = 90
Left loop: 201 + 102 = 80
To find the values of the currents 1 , 2 , and 3 , we need to solve this system.
3
Another example
Is there a parabola which passes through the three points (1, 1), (3, 2) and
(9, 10)? If so, what is its equation?
4
Goals
Terminology
The simplest equation you can solve is of the form = b. So the simplest
systems to solve are diagonal systems such as
5 = 15
2y = 4
3z = −6 ,
which has the (unique) solution (, y, z) = (3, 2, −2).
An upper-triangular system is also easy to solve. For example, consider
4 + y + 2z = 15
2y + z = 4
3z = −6 .
• The last equation gives z = −2.
• Substituting this into the second equation and solving for y gives y = 3.
• Substituting these both into the first equation and solving for gives = 4.
• So the (unique) solution is (, y, z) = (4, 3, −2).
Echelon form
Back-substitution works more generally for matrices in echelon form
• The variables that are not pivot variables are free variables
To solve a linear system one can use an algorithm called Gaussian Elimina-
tion to obtain an equivalent linear system in echelon form, which can then be
solved by back-substitution. This algorithm is based on the following:
Elementary operations
1. Multiplying an equation through by a nonzero constant.
2. Interchanging two equations.
3. Adding a multiple of one equation to another equation.
Definition: Two linear systems are equivalent if one can be obtained from
the other via a sequence of elementary operations.
Note: If two systems are equivalent, then they have the same set of solutions.
15
Augmented Matrices
2 + 3y + 4z = 19
−2 + 2y − 13z = −22
4 + 16y − 6z = 40
can be written as the augmented matrix
2 3 4 : 19
−2 2 −13 : −22
4 16 −6 : 40
Exercise 8 Augmented matrices
2 − 5y = 0 2 − y + 3z = 0
(a) (b) .
7 + 2y = 0 2y − z = 6
17
The elementary operations for the system correspond to the following elemen-
tary row operations, which can be used to obtain a (row) equivalent matrix
in echelon form:
we have
Elementary row operations
1. Multiplying a row through by a nonzero constant.
2. Interchanging two rows.
3. Adding a multiple of one row to another different row.
There are three possibilities for the number of solutions to a linear system.
These can easily be read off from the (row) echelon form of the system (or its
augmented matrix).
• If there is a row of the form 0 . . . 0 : c with c 6= 0, then there is no solution.
• Otherwise, there is at least one solution:
– If there are no free variables, then there is a unique solution.
– Otherwise there are infinitely many solutions. In this case the general
solution will be described using one free parameter for each free variable.
1 2 3 : 0
(b) 0 2 2 : 0
0 0 0 : 1
1 2 3 : 0
(c) 0 0 2 : 0
0 0 0 : 0
1 2 3 4 5 6 : 0
(d) 0 0 0 0 3 2 : −1
0 0 0 0 0 2 : 1
26
The accompanying figure shows a network of one-way streets with traffic flow-
ing in the directions indicated. The flow rates along the streets are measured
as the average number of vehicles per hour.
Set up a linear system whose solution provides the unknown flow rates and
then solve this system.
Given that flows must be non-negative (traffic cannot go against the one-way
system), what is the minimum flow rate for each of the unknowns?
400 750
300 x3 250
C A
x2 x4
400 D B 200
x1
100 300
29
30
What are matrices good for? Anything that involves linear algebra.
(b) 1 2 3 (a row vector)
1
(c) 2 (a column vector)
3
(d) [ 3] (a scalar)
32
• diagonal matrix: square, and the only non-zero entries are on the main
diagonal.
• identity matrix: diagonal matrix with all main diagonal entries 1 (denoted
or n ).
• block matrix: these are built out of smaller matrices. Many configurations
are possible, subject to consistency in number of rows and/or columns.=
33
(b) −A
(c) A + (−A)
34
2 1 1 −2 0 1 1 0 −1 0 0 0
A= , B= , C= , D=
3 0 −1 2 3 5 0 1 1 0 0 0
(d) B + D
(e) A + B
(f) B + A
35
Matrix multiplication
Multiply the following matrices. (You should first check the order of the matri-
ces.)
2 3 2
(a)
6 7 −1
2 3 1 2 3 0
(b) and
6 7 0 6 7 1
1 2
1 2 3
(c) −1 0
4 5 6
1 1
37
1 2
1 −1 1
(d) 3 4
1 0 1
5 6
1
(e) 3 1 −1 2
5
1
(f) 1 −1 2 3
5
38
3 2 2 4
(b)
−6 −4 −3 −6
39
3 2 1 0
(c)
−6 −4 0 1
3 0 7 5 −7 −28
(d) 2 4 1 −2 3 11
0 −1 1 −2 3 12
40
Here A is the coefficient matrix, x is the unknown column vector and b is the
known RHS column vector.
43
More generally, if
11 12 . . . 1j . . . 1n 1 b1
21 22 . . . 2j . . . 2n 2 b2
. . .
.. .. ..
A = j = 1
, x = and b =
b ,
2 . . . j . . . n j
... ... ...
m1 m2 . . . mj . . . mn n bm
Exercise 21
Solve this equation by multiplying both sides from the left by the matrix
1 −2
C = .
−1 3
46
Recall (see Exercise 18(c)) that the identity matrix is a square matrix with
1s down the main diagonal, and 0s everywhere else. Multiplying by an identity
matrix (of the appropriate size) doesn’t change a matrix.
A square matrix A is invertible if there is some (square) matrix
C such that
C A = = A C.
Comments
1
• C is called the inverse of A. We write C = A−1 . NEVER WRITE .
A
2 × 2 inverses
−1
1
b d −b
= , when d − bc 6= 0 .
c d d − bc −c
Check:
1 1
d −b b d − bc 0 1 0
A−1 A = = =
d − bc −c c d d − bc 0 d − bc 0 1
(and similarly, AA−1 = 2 ).
(Optional exercise: Show that if d − bc = 0 then A has no inverse.)
50
The following gives an algorithm to compute inverses (if they exist); it can be
programmed to handle large matrices.
Justification: If
C = [ c1 |c2 | . . . |cj | . . . |cn ]
is the inverse of A then we need to solve the matrix equation AC = for C where
= [ e1 |e2 | . . . |ej | . . . |en ] .
Here ej is the j-th column of the n × n identity matrix n . It is the column vector
with a 1 in the j-th position and zeros elesewhere.
This can be done a column at a time, n times, by solving the system:
Acj = ej for cj , that is, by row reducing [ A | ej ] to [ | cj ].
Since the coefficient matrix A is the same for each of the n systems, the algo-
rithm above carries out the elimination process on all n equations simultane-
ously.
52
Elementary matrices
Definition: An elementary matrix is a square matrix which as a pre-multiplier
performs an elementray row operation. The elementary matrix performing a
particular row operation can be found by performing the same operation on the
identity.
When is A Invertible?
Proof of Theorem 27
(c) (3)⇒(4): We prove that if (4) is false then (3) must be false. Suppose that A
is row-equivalent to a matrix B with a row of zeros. Perform row operations
to convert A into B; then perform further row operations to put B into REF.
Let this REF be C. Then C has at least one row of zeros, and A and C are
row-equivalent. Hence the systems A x = 0and C x = 0 all have the same
solutions. The latter system has at most (n − 1) pivots (since C has a row of
zeros), so there is at least one free variable. Thus there is v 6= 0 such that
C(t v) = 0 for all t ∈ R. Since x = v solves A x = 0, (3) is false.
Proof of Theorem 28
Exercise 29 Transposing
a matrix
1 2 3
(a) If A = , find AT and (AT )T .
4 5 6
60
−3 2 1 0 1 3
(b) If B = and C = , verify that (B + C)T = BT + CT .
4 3 2 −1 1 2
In general it is true that (B+ C)T = BT + CT . Is it true that (B+ C)−1 = B−1 + C−1 ?
61
−1 4
(c) If x = 2 and y = 7 , find xT , yT , xT y and yT x.
−1 10
What do you notice?
1 2
(d) If C = , find CT .
2 3
62
Exercise30 Transpose
of a product
2 1
2 4
1. If C = 6 3 and D = , verify that (CD)T = DT CT .
1 6
−2 4