Topics1 3 4topage
Topics1 3 4topage
Row operations
Linear equations
THE UNIVERSITY OF MELBOURNE
SCHOOL OF MATHEMATICS AND STATISTICS Definition (Linear equation and linear system)
A linear equation in n variables, x1 , x2 , . . . , xn , is an equation of the form
a1 x1 + a2 x2 + · · · + an xn = b,
Topic 1: Linear equations [AR 1.1 and 1.2] Definition (Homogeneous linear system)
A system of linear equations is called homogeneous if all the constants
on the right hand side are zero.
Example
1.1. Systems of linear equations. Row operations. x1 + 5x2 + 6x3 = 0
1.2. Reduction of systems to row-echelon form. x2 − x3 = 0
−x1 + x3 = 0
1.3. Reduction of systems to reduced row-echelon form.
1.4. Consistent and inconsistent systems. Definition (Solution of a system of linear equations)
A solution to a system of linear equations in the variables x1 , . . . , xn is a
set of values of these variables which satisfy every equation in the
system.
Solution:
Substituting the points (x, y ) into the cubic polynomial gives:
Note:
! Need an accurate drawing.
! Not practical for three or more variables.
5 7
Elimination
Note:
Note:
Solving such equations by hand can be tedious, so we can use a
Elimination of variables will always give a solution, but we need to do
computer package such as MATLAB.
this systematically and not in an adhoc manner, for three or more
variables.
6 8
Row Operations
To find the solutions of a linear system, we perform row operations to
simplify the augmented matrix. An essential condition is that the row
Definition (Matrix) operations we perform do not change the set of solutions to the system.
A matrix is a rectangular array of numbers. The numbers in the array
are called the entries of the matrix. A m × n matrix has m rows and n
columns. Definition (Elementary row operations)
The elementary row operations are:
Definition (Coefficient matrix and augmented matrix)
1. Interchanging two rows.
The coefficient matrix for a linear system is the matrix formed from the
coefficients in the equations. 2. Multiplying a row by a non-zero constant.
The augmented matrix for a linear system is the matrix formed from the 3. Adding a multiple of one row to another row.
coefficients in the equations and the constant terms. These are usually
separated by a vertical line. Note:
The matrices produced after each row operation are not equal but are
equivalent, meaning that the solution set is the same for the system
represented by each augmented matrix. We use the symbol ∼ to denote
equivalence of matrices.
9 11
Example 4.
Solve the following system using elementary row operations:
Example 3.
2x − y = 3
Write down an augmented matrix for the following linear system:
x +y =0
2x − y = 3 Solution:
x +y =0
Solution:
10 12
Gaussian elimination
1.2 Reduction of systems to row-echelon form
Gaussian elimination is a systematic way to reduce a matrix to
row-echelon form using row operations.
Definition (Leading entry) Note: The row-echelon form obtained is not unique.
If a row of a matrix does not consist entirely of zeros, then first
non-zero entry in the row is called the leading entry. Gaussian elimination
1. Interchange rows, if necessary, to bring a non-zero number to the
top of the first column with a non-zero entry.
Definition (Row-echelon form)
A matrix is in row-echelon form if: 2. (Optional, but often useful.) Divide the first row by its leading
entry to create a new leading entry 1.
1. For any non-zero two rows, the leading entry of the lower row is
further to the right than the leading entry in the higher row. 3. Add suitable multiples of the top row to lower rows so that all
entries below the leading entry are zero.
2. Any rows that consist entirely of zeros are grouped together at the
bottom of the matrix. 4. Start again at Step 1 applied to the matrix without the first row.
Note: These conditions imply that in each column containing a leading To solve a linear system we read off the equations from the row-echelon
entry, all entries below the leading entry are zero. matrix and then solve the equations to find the unknowns, starting with
the last equation. This final step is called back substitution.
13 15
Example 5.
Examples Solve the following system of linear equations using Gaussian
! " elimination:
1 −2 3 4 5 row-echelon form
x − 3y + 2z = 11
1 0 0 3
0 4 1 2 row-echelon form 2x − 3y − 2z = 13
0 0 0 3 4x − 2y + 5z = 31
Solution:
0 0 0 2 4
0 0 3 1 6 Step 1. Write the system in augmented matrix form.
0 0
not row-echelon form
0 0 0
2 −3 6 −4 9
14 16
1.3 Reduction of systems to reduced row-echelon form
Step 2. Use elementary row operations to reduce the augmented matrix
to row-echelon form.
17 19
Examples
Step 3. Read off the equations from the augmented matrix and use back !
1 −2 3 −4 5
"
reduced row-echelon form
substitution to solve for the unknowns, starting with the last equation.
) *
1 2 0
reduced row-echelon form
0 0 1
1 0 0 3
0 1 1 2 is not in reduced row-echelon form
0 0 0 3
1 0 0 2 4
0 1 0 1 6
0
is not in reduced row-echelon form
0 0 0 0
0 0 1 −4 9
18 20
Gauss-Jordan elimination Step 2. Divide rows by their leading entry.
Gauss-Jordan elimination is a systematic way to reduce a matrix to
reduced row-echelon form using row operations.
Note: The reduced row-echelon form obtained is unique.
Gauss-Jordan elimination Step 3. Add multiples of the last row to the rows above to make the
1. Use Gaussian elimination to reduce matrix to row-echelon form. entries above its leading 1 equal to zero.
2. Multiply each non-zero row by an appropriate number to create a
leading 1 (type 2 row operations).
3. Use row operations (of type 3) to create zeros above the leading
entries.
21 23
Example 6.
Solve the following system of linear equations using Gauss-Jordan
elimination: Step 4. Add multiples of the penultimate (2nd last) row to the rows
above to make the entries above its leading 1 equal to zero.
x − 3y + 2z = 11
2x − 3y − 2z = 13
4x − 2y + 5z = 31
Solution:
Step 1. Use Gaussian elimination to reduce the augmented matrix to
Step 5. Read off the answers.
row-echelon form.
22 24
1.4 Consistent and inconsistent systems
Theorem
A system of linear equations has zero solutions, one solution, or
infinitely many solutions. There are no other possibilities.
Note:
Every homogeneous linear system is consistent, since it always has at
least one solution: x1 = 0, . . . , xn = 0.
25 27
Inconsistent systems
Example 7. Consider the linear systems with augmented matrices: We can determine whether a system is consistent or inconsistent by
) * ) * ) * ) * reducing its augmented matrix to row-echelon form.
1 1 2 1 1 2 1 1 2 1 1 0 2
, , ,
0 0 0 1 1 1 0 1 0 0 1 0 0 Theorem
In each case, The system is inconsistent if and only if there is at least one row in the
row-echelon matrix having all entries equal to zero except for a non-zero
(a) decide whether the system is consistent, and
final entry.
(b) if the the system is consistent, determine how many solutions there
are. Example 8.
Solution: Solve the system with row-echelon form:
1 0 1 −2
0 2 2 4
0 0 0 −3
Solution:
26 28
Geometrically, an inconsistent system in 3 variables has no common Consistent systems
point of intersection for the planes determined by the system.
Theorem
Suppose we have a consistent linear system with n variables.
! If the row-reduced augmented matrix has exactly n non-zero rows,
then the system has a unique solution.
! If the row-reduced augmented matrix has < n non-zero rows,
then the system has infinitely many solutions.
! If r is the number of non-zero rows in the row-echelon form,
then n − r parameters are needed to specify the solution set.
30 32
Example 10. Example 11. Calculating flows in networks
Solve the system with reduced row-echelon form:
At each node • we require
1 2 0 0 5 1 sum of flows in = sum of flows out.
0 0 1 0 6 2
0 0 0 1 7
Determine a, b, c and d in the following network.
3
0 0 0 0 0 0 %& '
#
Solution:
" $
)*+)*,*-.,/0123/4-/
4-!4$#.*!/!4)*$.42-
%
!
(
33 35
Solution:
34 36
37 39
Example 12.
Find the values of a, b ∈ R for which the system
x − 2y + z = 4
2x − 3y + z = 7
3x − 6y + az = b
has
(a) no solution,
(b) a unique solution,
(c) an infinite number of solutions.
Solution:
38 40
2.1 Matrix notation
Definition (Matrix)
A matrix of size m × n is a rectangular array of numbers with m rows
and n columns.
A11 A12 . . . A1n
A21 A22 . . . A2n
A = .. .. .. or A = [Aij ]
..
. . . .
Am1 Am2 . . . Amn
We denote by Aij the entry in the i -th row and j-th column of A where
i = 1, 2, . . . , m and j = 1, 2, . . . , n.
41 43
Special matrices
Topic 2: Matrices and Determinants [AR 1.3–1.7, 2.1–2.4]
! A matrix with the same number of rows as columns is called a
square matrix.
! A matrix with one row is called a row matrix or row vector.
! A matrix with one column is called a column matrix or column
2.1 Matrix notation
vector.
2.2 Matrix operations
! A square matrix with Aij = 0 for i %= j is called a diagonal matrix.
2.3 Matrix inverses +2 0 0,
2.4 Elementary matrices e.g. 0 −1 0
0 0 5
2.5 Linear systems revisited ! A square matrix with Aij = 0 for i > j is called an upper triangular
2.6 Determinants matrix.
+2 1 3,
e.g. 0 −1 4
0 0 5
! A square matrix with Aij = 0 for i < j is called a lower triangular
matrix.
+2 0 0,
e.g. 1 −1 0
5 3 5
42 44
Definition (Matrix multiplication)
Let A be an m × n matrix and B be a n × q matrix. The product AB is
a matrix of size m × q.
! A matrix with all zero entries is called a zero matrix. We denote
the zero matrix by 0 or, if size is important, we write 0m,n to The entry in position (i , j) of the matrix product is obtained by taking
denote the zero matrix of size m × n. row i of A, and column j of B, then multiplying together the entries in
order and adding.
e.g. 02,2 = [ 00 00 ], 02,3 = [ 00 00 00 ] .n
- (AB)ij = Aik Bkj
1 if i = j
! A square matrix A satisfying Aij = is called an k=1
0 if i %= j
identity matrix. We write I to denote an identity matrix or, if size Note:
is important, we write In to denote the identity matrix of size n × n. ! The product AB is only defined if the number of columns in A is
+1 0 0,
e.g. I2 = [ 10 01 ], I3 = 0 1 0 equal to the number of rows in B.
001
! We can think of matrix multiplication in terms of dot products:
45 47
An = AA · · · A
53 55
54 56
Properties of the matrix inverse
If A and B are n × n invertible matrices and α is a non-zero scalar, then
(2) Show that the corresponding entries are equal for all i and j. 1. (αA)−1 = α1 A−1
2. (AB)−1 = B −1 A−1
0n
3. (An )−1 = A−1
/
(for all integers n " 1)
1 2−1 / 0T
4. AT = A−1
Proof: Property 2.
57 59
[A | In ] ∼ [R | B]
61 63
Example 7.
1 2 1
Find the inverse of A = −1 −1 1 . Example 8. Encrypting messages
0 1 3 A common way of sending an encrypted message is to assign an integer
value to each letter of the alphabet and send the message as a string of
Solution:
integers.
Form the augmented matrix [A | I3 ] and perform row operations so that
For example the message
A is in reduced row-echelon form.
SEND MONEY
might be sent as
5, 8, 10, 21, 7, 2, 10, 8, 3
Here the S is represented by a 5, the E by an 8, and so on. Ciphers like
this are generally easy to break.
A more secure way is to use matrix multiplication and matrix inverses.
62 64
Step 1: Encrypting the message 2.4 Elementary matrices
We put the message (SEND MONEY) in a matrix by entering the
integers corresponding to each letter down the columns The effect of an elementary row operation can be achieved by
multiplication on the left by an elementary matrix.
5 21 10
B= 8 7 8 Definition (Elementary matrix)
10 2 3 An n × n matrix is an elementary matrix if it can be obtained from In by
performing a single elementary row operation.
For simplicity, choose an invertible 3 × 3 matrix whose inverse has
integer entries, e.g.
Theorem
1 2 1
A= 2 5 3 Let Ep be the elementary matrix obtained by applying a row operation p
2 3 2 to In .
The product If A is a matrix such that Ep A is defined, then Ep A is equal to the result
of performing p on A.
1 2 1 5 21 10 31 37 29
AB = 2 5 3 8 7 8 = 80 83 69 Thus, we can perform a sequence of elementary row operations using a
2 3 2 10 2 3 54 67 50 corresponding sequence of elementary matrices.
65 67
Proof:
Since A is an n × n invertible matrix, then AA−1 = A−1 A = In . So
Ax = b
⇒A−1 Ax = A−1 b
⇒In x = A−1 b
⇒x = A−1 b
69 71
Example 11.
If A ∼ In by a sequence of elementary row operations, then there is a Use a matrix inverse to solve the linear system
sequence of elementary matrices E1 , E2 , . . . , Ek such that
x + 2y + z = −4
Ek Ek−1 · · · E2 E1 A = In . −x − y + z = 11
y + 3z = 21
Each of the elementary matrices Ep (p = 1, . . . k) is invertible.
Solution:
Step 1. Write the system in the form Ax = b
Theorem
1. Let A be an n × n matrix. Then
A is invertible ⇐⇒ A ∼ In .
2. Every invertible matrix can be written as a product of elementary Step 2. Find A−1 .
matrices.
3. If A and B are n × n matrices such that AB = In , then A and B
are invertible with A−1 = B and B −1 = A.
70 72
Picture:
Step 3. y
The solution is x = A−1 b.
p
2x + 3y = 4.5
2x + 3y = 0
x
Ax = b
Ax = 0
Note: Once we know A−1 we can immediately solve the linear system
Ax = b for any possible choice of the right hand side b.
73 75
General solutions of linear systems Example 12. In Example 9 of topic 1, we found the general solution
The general solution (set of all solutions) of a linear system Ax = b is
a 9−t
related to the general solution of the homogeneous system Ax = 0. b 1 + t
x= c = 6 − t , t ∈ R.
Theorem (Superposition of solutions) d t
If Ax = b is consistent, then the general solution is obtained by taking
Determine a particular solution p and the general solution h to the
one particular solution p of Ax = b, and adding the general solution h
homogeneous system.
of Ax = 0. Thus, the general solution to Ax = b has the form
Solution:
x = p + h.
Proof:
If Ap = b and Ah = 0 then x = p + h is a solution to Ax = b since
Ax = A(p + h) = Ap + Ah = b + 0 = b.
Ah = A(x − p) = Ax − Ap = b − b = 0.
74 76
Rank and solutions of linear systems
We can rewrite the results of section 1.4 for the solutions of a linear
system in terms of rank.
Rank of a matrix
Theorem
Definition (Rank of a matrix) The linear system Ax = b, where A is an m × n matrix, has
The rank of a matrix A is the number of non-zero rows in the reduced 1. No solution if rank(A) < rank([A | b]).
row-echelon form of A.
2. A unique solution if rank(A) = rank([A | b]) and rank(A) = n.
Note:
3. Infinitely many solutions if rank(A) = rank([A | b]) and
! This is the same as the number of non-zero rows in any
rank(A) < n.
row-echelon form of A.
! If A has size m × n, then rank(A) # m and rank(A) # n.
Note: rank(A) # rank([A | b])
77 79
Example 14.
Example 13.
Find the rank of Determine the number of solutions of the system with row-echelon form:
1 −1 2 1
1 −1 2 1 1 −1 2 1
A= 0 1 1 −2
0 1 1 −2 ∼ 0 1 1 −2
1 −3 0 5
1 −3 0 5 0 0 0 0
Solution: Solution:
78 80
Adding a multiple of one row to another
81 83
Theorem
These conditions specify the determinant uniquely.
85 87
In 3 dimensions:
gives a right- gives a left-
1 0 0 1 0 0
0 handed system handed system
1 0 0 0 1
with oriented vol- with oriented vol-
0 0 1 0 1 0
ume 1 ume -1
86 88
Example 16.
Compute the determinant of
1 2 1
A = −1 1 1
0 1 3
using row operations.
Solution:
89 91
Theorem
A similar argument proves the following: Let A, B be n × n matrices and let α be a scalar. Then
1. If A has a row (or column) of zeros, then det(A) = 0.
Theorem 2. If A has a row (or column) which is a scalar multiple of another
If A is an upper triangular or lower triangular matrix, then det(A) is the row (or column) then det(A) = 0.
product of the elements on the main diagonal. 3. det(αA) = αn det(A)
93 95
Cofactor expansion
Another way to calculate determinants is to use cofactor expansion. How do you remember the sign of the cofactor?
Definition (Cofactor) The (1, 1) cofactor always has sign +. Starting from there, imagine
Let A be a square matrix. The (i , j)-cofactor of A, denoted by Cij , is walking to the square you want using either horizontal or vertical steps.
the number given by The appropriate sign will change at each step.
Cij = (−1)i +j det (A(i , j)) We can visualise this arrangement with the following matrix:
where A(i , j) is the matrix obtained from A by deleting the i th row and + − + − ...
− + − + ...
jth column.
+ − + − ...
.
Example 18.
− + − + ...
1 2 1
.. .. .. .. . .
. . . . .
If A = −1 −1 1 , calculate C23 .
0 1 3
Solution: So, for example, C13 is assigned + but C32 is assigned −.
94 96
Example 19.
Compute the determinant of
1 2 1
A = −1 1 1
0 1 3
97 99
The cofactor method is particularly useful for matrices with many zeros.
Topic 3: Euclidean Vector Spaces [AR 3.1-3.5]
Example 20. 3 3
3
3 1 −2 0 1 33
3 3 2 2 0 33
Calculate |A| = 33 using cofactors.
3 1 0 1 0 33
3 0 −4 2 4 3
Solution: 3.1 Vectors in Rn
3.2 Dot product
3.3 Cross product of vectors in R3
3.4 Lines and planes
98 100
Distance between two points
3.1 Vectors in Rn
Let u, v ∈ Rn . The distance between u and v is
v−u
v1
v2 u
105 107
A cosine value near 1 indicates that the scores are highly correlated.
109 111
Vector projection
3.3 Cross product of vectors in R3
Definition (Projection of v onto u)
Assuming u %= 0, the projection of v onto u is given by
Definition (Cross product)
u·v
proju v = u = (û · v)û Let u = (u1 , u2 , u3 ) and v = (v1 , v2 , v3 ) be two vectors in R3 . We define
*u*2
the cross product (or vector product) of u and v by
v
u × v = (u2 v3 − u3 v2 )i + (u3 v1 − u1 v3 ) j + (u1 v2 − u2 v1 )k.
v-projuv
u
It is easy to remember the cross product as a determinant expanded
along the first row:
θ projuv
3 3
3i j k 33 33 3 3 3 3 3
proju v = *v* cos θ û 3 u2 u3 33 3u1 u3 3 3u1 u2 3
u × v = 3u1 u2 u3 3 = 3
3 3 3 i−3
3 3 j+3
3 3k
= *û**v* cos θ û 3 v1 v2 v3 3 v2 v3 3 v1 v3 3 v1 v2 3
= (û · v)û
Note:
Note:
The cross product is defined only for R3 .
The difference v − proju v = 0 is orthogonal to u: u · (v − proju v) = 0.
110 112
Properties of the cross product Example 5.
3 Find a vector perpendicular to both (1, 1, 1) and (1, −1, −2).
Let u, v, w ∈ R and α ∈ R be a scalar. Then
1. v × u = −(u × v) Solution:
2. (u + v) × w = u × w + v × w
3. u × (v + w) = u × v + u × w
4. (αu) × v = u × (αv) = α(u × v)
5. u × u = 0
Example
i × j = k, j × k = i, j × k = i.
Note:
Using this and properties 1-4 we can compute any cross product.
113 115
θ
3w1 w2 w3 3
u
117 119
Solution: u
θ w
Note: This is the absolute value of the determinant of the matrix with
rows given by u, v, w.
118 120
Example 7.
−→ −→ −
→ For example, in R3 , if r = (x, y , z), r0 = (x0 , y0 , z0 ) and v = (a, b, c),
Find the volume of the parallelepiped with adjacent edges PQ, PR, PS,
the vector equation of the line is
where the points are P(2, 0, −1), Q(4, 1, 0), R(3, −1, 1) and
S(2, −2, 2). (x, y , z) = (x0 , y0 , z0 ) + t(a, b, c), t∈R
Solution:
x = x0 + ta
y = y0 + tb, t ∈R
z = z0 + tc
v
P
0
Each point on the line is given by a unique value of t.
122 124
Definition
Two lines are said to
! intersect if there is a point lying on both lines.
! be parallel if their direction vectors are parallel.
! be skew if they do not intersect and are not parallel.
The angle between two lines is given by the angle θ between their
direction vectors. (We usually take the acute angle, which is the smaller
of the two possible angles θ and π − θ.)
125 127
Equations of planes
Example 9.
Find a vector equation of the line through the point (2, 0, 1) that is The vector equation of a plane through a point P0 that contains two
parallel to the line non-parallel vectors in the directions u and v is
x −1 y +2 z −6
= = . r = r0 + su + tv, s, t ∈ R,
1 −2 2 −−→
Does the point (0, 4, −3) lie on the line? where r0 = OP0 .
Solution: su
P0
tv
r0
r
r - r0
n
r0
r
r · n = r0 · n
⇒ (x, y , z) · (a, b, c) = (x0 , y0 , z0 ) · (a, b, c)
⇒ ax + by + cz = ax0 + by0 + cz0
⇒ ax + by + cz = d
130 132
Example 11. Intersection of two planes
Find a vector equation for the plane containing the points P(1, 0, 2),
Q(1, 2, 3) and R(4, 5, 6). Example 13.
Find a vector form for the line of intersection of the two planes
Solution: x + 3y + 2z = 6 and 3x + 2y − z = 11.
Solution:
133 135
134 136