0% found this document useful (0 votes)
12 views34 pages

Topics1 3 4topage

The document provides an overview of systems of linear equations, including definitions, examples, and methods for solving them such as Gaussian elimination and Gauss-Jordan elimination. It explains the concepts of homogeneous and inconsistent systems, as well as the conditions for consistency and the types of solutions that may exist. Additionally, it introduces matrix notation and special types of matrices relevant to linear algebra.

Uploaded by

busby032
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)
12 views34 pages

Topics1 3 4topage

The document provides an overview of systems of linear equations, including definitions, examples, and methods for solving them such as Gaussian elimination and Gauss-Jordan elimination. It explains the concepts of homogeneous and inconsistent systems, as well as the conditions for consistency and the types of solutions that may exist. Additionally, it introduces matrix notation and special types of matrices relevant to linear algebra.

Uploaded by

busby032
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/ 34

MAST10007 Linear Algebra 1.1 Systems of linear equations.

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,

where the coefficients a1 , . . . , an and the constant term b are constants.

A finite collection of linear equations in the variables x1 , x2 , . . . , xn is


called a system of linear equations or a linear system.
Semester 1, 2022
Example
Lecture Notes
x1 + 5x2 + 6x3 = 100
These notes have been made in accordance with the provisions of Part VB of the copyright act for teaching purposes of the
University. These notes are for the use of students of the University of Melbourne enrolled in MAST10007 Linear Algebra. x2 − x3 = −1
−x1 + x3 = 11
1 3

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.

Note: Usually we will look at equations with real or complex numbers


as coefficients, and our solutions will be real or complex numbers.
2 4
Example 1. Data fitting using a polynomial Example 2. (Revision)
Solve the following linear system.
Find the coefficients c, α, β, γ such that the cubic polynomial
y = c + αx + βx 2 + γx 3 passes through the points specified below. 2x − y = 3
x +y =0
x y
−0.1 0.90483 Solution:
0 1 Graphically
0.1 1.10517
0.2 1.2214
%!"$ !"$ !"#

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.

Definition (Reduced row-echelon form)


A matrix is in reduced row-echelon form if the following three conditions
are satisfied:
1. It is in row-echelon form.
2. Each leading entry is equal to 1 (called a leading 1).
3. In each column containing a leading 1, all other entries are zero.

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.

Note: In step 3, it is most efficient to start with the bottom leading


entry and work upwards.

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.

We say that the system is:


! inconsistent if it has no solutions.
! consistent if it has at least one solution.

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.

More precisely, in the row-echelon form of the augmented matrix, there


will be n − r columns which contain no leading entry. We can choose
the variable corresponding to such a column arbitrarily. The values for
the remaining variables are then uniquely determined.
Note: r is called the rank of the augmented matrix.
29 31

Geometrically, a consistent system in 3 variables has a common point,


line or plane of intersection for the planes determined by the system.
Example 9.
Solve the system with reduced row-echelon form:
 
1 0 0 2
 0 1 0 −4 
0 0 1 15
Solution:

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:

(AB)ij = (row i of A) · (column j of B).

45 47

Example 1. Application: Linear systems as matrix equations


2.2 Matrix operations
(a) Compute the matrix product
) *) *
Recall that we can multiply a matrix by a scalar, add matrices of the 3 1 x1
same size, and multiply matrices if the sizes are compatible. −1 4 x2

Definition (Scalar multiplication)


(b) Hence write the linear system
Let A be a matrix and c be any scalar (i.e. real or complex number).
The product cA is the matrix obtained by multiplying all entries of A by 3x1 + x2 = 7
c. It is called a scalar multiple of A: −x1 + 4x2 = 2
(cA)ij = c(Aij ) in matrix form Ax = b where x and b are column vectors.

Definition (Addition of matrices)


Let A and B be m × n matrices. The sum A + B is an m × n matrix
obtained by adding corresponding entries of A and B.
Note: Every system of linear equations can be written as a matrix
(A + B)ij = Aij + Bij
equation Ax = b, where [A | b] is the augmented matrix of the system
and x is a column vector.
46 48
Example 2. Multiplying a matrix by a vector – column point of view Application of matrix powers

  Example 3. Graphs and adjacency matrices


) * x ) *
7 3 1  y  = 7x + 3y + 1z A graph is a set of points called vertices together with a set of lines or
0 8 1 0x + 8y + 1z curves called edges which connect certain vertices.
z
) * ) * ) *
7 3 1
= x +y +z
0 8 1

This is a linear combination of the columns of the original 2 × 3 matrix.


Note:
In general, for a matrix with columns a1 , a2 , . . . , an :
 
  x1
 x2 
 a1 a2 . . . an    ..  = x1 a1 + x2 a2 + . . . + xn an
 Every graph has a corresponding adjacency matrix that specifies which
 .  vertices Vi are connected. If the graph has n vertices then the
xn adjacency matrix is n × n and the (i , j) entry Aij is equal to the number
of edges from Vi to Vj .
49 51

Properties of matrix multiplication


Whenever the matrix products and sums are defined: Determine the adjacency matrix for the above graph.
1. A(B + C ) = AB + AC (left distributivity)
Solution:
2. (A + B)C = AC + BC (right distributivity)
3. A(BC ) = (AB)C (associativity)
4. A(αB) = α(AB)
5. AIn = Im A = A (where A has size m × n)
6. A0 = 0 and 0 A = 0
where α is a scalar and 0 denotes the zero matrix of appropriate size.

Definition (Matrix powers)


If A is a square matrix and n " 1 is an integer we define

An = AA · · · A

as the product of n copies of A.


50 52
Example 4. Walks in a graph Definition (Transpose of a matrix)
A walk in a graph is a sequence of edges linking one vertex to another. Let A be an m × n matrix. The transpose of A, denoted by AT , is the
The length of a walk is equal to the number of edges it traverses. n × m matrix whose entries are given by interchanging the rows and
columns of A:
Theorem (AT )ij = Aji
If A is an n × n adjacency matrix of a graph and Akij represents the (i , j)
entry of Ak , then Akij is equal to the number of walks of length k from Example 5.
Vi to Vj for each k " 1. ) *
1 2 3
In particular, the entry Aij of A gives the number of walks of length 1 Let A = . Find AT .
4 5 6
from Vi to Vj .
Solution:
Problem:
Determine the number of walks of length 3 between V1 and V4 for the
graph in example 1.

53 55

Properties of the transpose


Solution:
Let α be a scalar. The following properties hold whenever the matrix
To find walks of length 3, we compute A3 .
products and sums exist:
/ 0T
1. AT
 
2 6 3 3 5 =A
 6 6 6 7 7  2. (A + B)T = AT + B T
A3 = 
 
 3 6 2 5 3 3. (αA)T = αAT


 3 7 5 4 7 
4. (AB)T = B T AT
5 7 3 7 4
Proof: Property 4.
(1) Check that (AB)T and B T AT are the same size.

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

2.3 Matrix inverses Theorem (Inverse of a 2 × 2 matrix)


) *
a b
Definition (Matrix inverse) Let A= . Then
c d
An n × n matrix A is called invertible if there exists a matrix B such that 1. A is invertible ⇐⇒ ad − bc %= 0.
) *
1 d −b
AB = BA = In . 2. If ad − bc %= 0, then A−1 = .
ad − bc −c a
The matrix B is called the inverse of A and is denoted by A−1 . If A is Note: ad − bc is called the determinant of A, written det(A).
not invertible, we say that A is singular.
Example 6.
We can prove from the definition that: )
2 −1
*
! (If it exists) A−1 has the same size as A. Find the inverse of A = .
1 1
! (If it exists) A−1 is unique.
Solution:
! If A is invertible, then A−1 is invertible and (A−1 )−1 = A.
! In−1 = In
! 0 is singular.
! A matrix that has a row or column consisting entirely of zeros is
singular.
58 60
Finding the inverse of a square matrix via Gauss-Jordan elimination
Calculating the inverse of a matrix
Algorithm: input: n × n matrix A
output: A−1 or “A is not invertible”.
1. Construct the augmented matrix [A | In ].

2. Apply row operations to [A | In ] to get the block corresponding to


A into reduced row-echelon form. This gives

[A | In ] ∼ [R | B]

where R is in reduced row-echelon form.

3. If R = In , then A is invertible and A−1 = B.


% In , then A is singular , i.e. A−1 does not exist.
If R =

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

gives the encrypted message to be sent:


Example 9.
31, 80, 54, 37, 83, 67, 29, 69, 50 Find the elementary matrices obtained by applying the following row
operations on I3 .
Step 2: Decrypting the message
(a) R2 ↔ R3 (b) R1 → 2R1
The person receiving the encrypted message can decrypt it by
premultiplying the received message by A−1 (c) R3 → R3 + 3R1
  
1 −1 1 31 37 29 Solution:
A−1 (AB) =  2 0 −1   80 83 69 
−4 1 1 54 67 50
 
5 21 10
= 8 7 8 
10 2 3
which gives the sequence of integers
5, 8, 10, 21, 7, 2, 10, 8, 3
corresponding to
SEND MONEY
66 68
Example )10. *
1 2
2.5 Linear systems revisited
Let A = . Given that
3 4
) * ) * ) * ) * A linear system in the variables x1 , . . . , xn can be written in the form
1 2 1 2 1 2 1 0
∼ ∼ ∼ Ax = b
3 4 0 −2 0 1 0 1
where A is an m × n matrix, b is an m × 1 matrix and x is the n × 1
write I2 as a product of elementary matrices and A.
matrix [x1 , . . . , xn ]T .
Solution:
Theorem
If A is an invertible n × n matrix, then every linear system of the form
Ax = b has a unique solution, given by x = A−1 b.

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.

Conversely, if Ap = b and Ax = b then h = x − p satisfies Ax = 0 since

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

Theorem The parallelograms of the row vectors of


If A is an n × n matrix, the following conditions are equivalent: ) * ) *
3 0 3 0
1. A is invertible. A= and B=
2 2 0 2
2. Ax = b has a unique solution for any b.
(2,2)
3. The rank of A is n.
(0,2)
4. The reduced row-echelon form of A is In .
(3,0) (3,0)

have the same surface area, namely 3 · 2 = 6.

81 83

2.6 Determinants Multiplying one row by a (positive) scalar


The row vectors of an n × n matrix )
3 0
*
 
a11 a12 . . . a1n 2 2
A =  ... ..  (4,4)

. 
an1 an2 . . . ann (2,2) ) *
3 0
are 4 4
(a11 , a12 , . . . , a1n ) . . . (an1 , an2 , . . . , ann ).
Goal: To define and to calculate the oriented volume of the (3,0) (3,0)
parallelepiped (higher dimensional parallelogram) defined by the row
vectors of A. Doubling one side doubles the area/volume.

Once defined, we will call this the determinant of A, denoted det(A) or


simply |A|.
82 84
Multiplying a row by −1 Defining Determinants
) *
a b
What if we multiply one row by −1? For a 2 × 2 matrix A = the determinant is given by
c d
The area stays the same, but the orientation changes.
det(A) = ad − bc.
For n × n matrices we can define and compute the determinant by
(2,2)
understanding how it changes under elementary row operations:
(2,2)
Definition (Determinant)
The determinant is a function that maps each n × n matrix A to a
(3,0) (-3,0) number, denoted det(A) or |A|, that satisfies the following conditions:
D1. Adding one row to another row does not change the determinant.
D2. Multiplying any row by a scalar α multiplies the determinant by α.
D3. Swapping two rows multiplies the determinant by −1.
D4. The determinant of the identity matrix In equals 1.

Theorem
These conditions specify the determinant uniquely.
85 87

Swapping two rows Example 15.


) * ) * Compute the determinant of
1 0 0 1
versus 
2 6 9

0 1 1 0
A= 0 3 8 
(0,1) (0,1) 0 0 −1

using row operations.


(1,0) (1,0) Solution:

counter-clockwise orienta- clockwise orientation, the


tion, the oriented surface oriented surface area equals
area equals 1 -1

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

Properties of the determinant

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)

4. det(AB) = det(A) det(B)


Calculating determinants:
5. det AT = det(A)
/ 0
For a general matrix, we use Gaussian elimination to transform the
matrix into triangular form, keeping track of what each step does to the 6. A is invertible if and only if det(A) %= 0.
determinant. Then we can read off the determinant using the theorem.
1
7. If A is invertible then det A−1 =
/ 0
This is usually the most efficient method for calculating determinants. .
det(A)
Note:
Property 5 means that we can replace rows by columns in all the
previous properties of determinants, including D1-D3.
90 92
Example 17.
Prove property 7 for the determinant, using the definition of Theorem (Cofactor expansion)
determinant and the previous properties. The determinant of an n × n matrix A can be computed by choosing
Solution: any row (or column) of A and multiplying the entries in that row (or
column) by their cofactors and then adding the resulting products.
That is, for each 1 # i # n,
n
.
det(A) = Ai 1 Ci 1 + Ai 2 Ci 2 + · · · + Ain Cin = Aik Cik
k=1

(cofactor expansion along the ith row)


and for each 1 # j # n,
n
.
det(A) = A1j C1j + A2j C2j + · · · + Anj Cnj = Akj Ckj
k=1

(cofactor expansion along the jth column).

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

using cofactor expansion.


Solution:

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

Definition (Addition and scalar multiplication of vectors in Rn ) d(u, v) = ||v − u||.


We define Rn as the set of all ordered n-tuples of real numbers and
write these as row or column vectors: v

  v−u
v1
 v2  u

v = (v1 , v2 , . . . , vn ) or v =  ..  , where vi ∈ R for i = 1, 2, . . . , n.


 
. Example 1.
vn Find the distance between the points P(1, 3, −1, 2) and Q(2, 1, −1, 3).

Let v = (v1 , v2 , . . . , vn ) ∈ Rn , u = (u1 , u2 , . . . , un ) ∈ Rn and α ∈ R. Solution:


Then addition and scalar multiplication are defined by:

v + u = (v1 , . . . , vn ) + (u1 , . . . , un ) = (v1 + u1 , . . . , vn + un )


αv = α(v1 , v2 , . . . , vn ) = (αv1 , αv2 , . . . , αvn )

Note: In handwritten work, we denote vectors using notation $v or v .


˜
101 103

In R3 , the unit vectors in the x, y , z directions are often denoted by


3.2 Dot product
i = (1, 0, 0), j = (0, 1, 0), k = (0, 0, 1)
so any vector in R3 can be written in the form Definition (Dot product)
v = (v1 , v2 , v3 ) = v1 i + v2 j + v3 k. Let u = (u1 , u2 , . . . , un ) ∈ Rn and v = (v1 , v2 , . . . , vn ) ∈ Rn .
We define the dot product (scalar product, Euclidean inner product) by
Definition (Length of a vector) n
.
The length (norm, magnitude) of a vector u = (u1 , u2 , . . . , un ) ∈ Rn is u·v = uk vk = u1 v1 + u2 v2 + · · · + un vn .
given by 4 k=1

*u* = u12 + u22 + · · · + un2 .


Note:
A vector of length 1 is called a unit vector.  
u1
 
v1
 ..   .. 
Note: If we write u and v as column matrices U =  .  and V =  . , then
We say a vector u is parallel to a vector v if u is a scalar multiple of v. un vn
Then every non-zero vector u is parallel to a unit vector û, where
u 1 u · v = UT V .
û = = u.
||u|| ||u||
102 104
Example 2.
Properties of the dot product Verify that the Cauchy-Schwarz inequality holds for the vectors
u = (0, 2, 2, −1) and v = (−1, 1, 1, −1).
Let u, v, w ∈ Rn and let α ∈ R be a scalar. Then
Solution:
1. u · v is a scalar
2. u · v = v · u
3. (u + v) · w = u · w + v · w
4. u · (v + w) = u · v + u · w
5. (αu) · v = α(u · v)
6. u · u = *u*2

105 107

Angle between two vectors Example 3. Correlation


Definition (Angle) Correlation is a measure of how closely two variables are dependent.
The angle θ between two non-zero vectors u, v ∈ Rn is determined by Suppose we want to compare how closely 7 students’ assignment marks
correlate with their exam marks.
u · v = *u**v* cos θ where 0 # θ # π.
Student Assignment Mark Exam Mark
S1 99 100
v S2 80 82.5
S3 79 79
S4 75.5 82.5
u
Note: S5 87.5 91
! In R2 , this definition corresponds to the cosine law for triangles. S6 67 67.5
S7 76 68
! In general, the Cauchy-Schwarz inequality shows that
Average 80.5 81.5
|u · v| # ||u|| ||v|| for all u, v ∈ Rn . This implies that
u·v
−1 # cos θ = "u""v" # 1 so the definition of angle makes sense. To measure the correlation we first need to adjust the scores so that
! Two vectors u, v are perpendicular or orthogonal if u · v = 0. This they have mean zero. This can be done by subtracting the average
means the angle between them is θ = π2 if u and v are non-zero. score X̄ from each students’ score X .
106 108
Example 4.
Let u = (2, −1, −2) and v = (2, 1, 3). Find vectors v1 and v2 such that
Let’s store the differences X − X̄ in a matrix:
v = v1 + v2
18.5 18.5
 

 −0.5 1 
 where v1 is parallel to u and v2 is perpendicular to u.
 −1.5 −2.5 
Solution:
 

 −5 1 


 7 9.5 

 −13.5 −14 
−4.5 −13.5
To compare the exam and assignment scores, we compute the cosine of
the angle between the two columns x1 , x2 of this matrix:
x1 · x2 656.75
cos θ = = ≈ 0.92
*x1 **x2 * (24.92)(28.62)

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

Length of Cross Product


Geometry of the cross product
We can also interpret the cross product geometrically by
Theorem
Let u, v be vectors in R3 . Then
v 1. *u × v*2 = *u*2 *v*2 − (u · v)2 . (Lagrange’s identity)
2. The length of the cross product u × v is
u × v = *u* *v* sin(θ) n̂ u *u × v* = *u* *v* sin(θ),

where θ is the angle between u, v.


where
! 0 # θ # π is the angle between u and v For 1, just expand both sides of the equation.
! n̂ is a unit vector For 2, we use Lagrange’s identity and the definition of angle.
! n̂ is perpendicular to both u and v
! n̂ points in the direction given by the right-hand rule. The
direction of u × v is determined by curling your fingers on your
right hand following the angle from u to v and noting the direction
your thumb is pointing.
114 116
Application: Area of a parallelogram Definition (Scalar triple product)
Suppose that u, v ∈ R3 . The area of the parallelogram defined by u and Let u = (u1 , u2 , u3 ), v = (v1 , v2 , v3 ) and w = (w1 , w2 , w3 ) be vectors in
v is equal to *u × v*. R3 . The scalar triple product is the real number u · (v × w) given by
3 3
3 u1 u2 u3 3
v
height 3
u · (v × w) = 33 v1 v2 v3 33 .
3

θ
3w1 w2 w3 3
u

base length Properties of the scalar triple product


1. v · (v × w) = w · (v × w) = 0
Area of parallelogram = (base) (height) 2. u · (v × w) = v · (w × u) = w · (u × v)
= *u* *v* sin θ 3. u · (v × w) = −u · (w × v) = −v · (u × w) = −w · (v × u)
= *u × v* Note:
Property 1 says that v × w is orthogonal to both v and w.

117 119

Example 6. Application: Volume of a parallelepiped


Find the area of the triangle with vertices (2, −5, 4), (3, −4, 5) and Suppose that u, v, w ∈ R3 . Then, the parallelepiped defined by the
(3, −6, 2). vectors u, v and w has volume equal to the absolute value of the scalar
triple product of u, v and w:
Volume of parallelepiped = |u · (v × w)|

Solution: u

θ w

Volume of parallelepiped = (area of base) (height)


= *v × w* *u* | cos θ|
= |u · (v × 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:

Equating components gives parametric equations for the line:

x = x0 + ta
y = y0 + tb, t ∈R
z = z0 + tc

If a %= 0, b %= 0 and c %= 0, we can solve the parametric equations for t


and equate. This gives a Cartesian form of the line:
x − x0 y − y0 z − z0
= =
a b c
Note: These equations for a line are not unique.
121 123

3.4 Lines and planes Example 8.


Determine vector, parametric and Cartesian equations of the line
Equations of a straight line passing through the points P(−1, 2, 3) and Q(4, −2, 5).
A vector equation of a line through a point P0 in the direction of a Solution:
vector v is given by
r = r0 + tv, t ∈ R
−−→
where r0 = OP0 .

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

Every value of s and t determines a point on the plane.


In R3 , a vector perpendicular to the plane is
n=u×v
We say that n is a normal vector to the plane.
126 128
Example 10.
If P is a point with position vector r, then
Find a Cartesian equation of the plane with vector form
P lies on the plane ⇔ r − r0 is parallel to plane (x, y , z) = s(1, −1, 0) + t(2, 0, 1) + (−1, 1, 1), s, t ∈ R
⇔ r − r0 is perpendicular to n
Solution:

r - r0
n

r0
r

Hence the equation of the plane in R3 can also be written in


point-normal form:
(r − r0 ) · n = 0
129 131

Putting r = (x, y , z), r0 = (x0 , y0 , z0 ) and n = (a, b, c) in the


point-normal form, we derive the Cartesian equation of a plane:

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

where d is the constant given by

d = ax0 + by0 + cz0 .

The angle between two planes in R3 is given by the angle θ between


their normal vectors. (We usually take the acute angle, which is the
smaller of the two possible angles θ and π − θ.)

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

Intersection of a line and a plane


Example 12.
Where does the line
x −1 y −2 z −3
= =
1 2 3
intersect the plane 3x + 2y + z = 20?
Solution:

134 136

You might also like