ECO3193 Chapter 4B
ECO3193 Chapter 4B
ECO3193 Chapter 4B
Contents
Vectors
Matrices
Matrix Operations
Important Matrices
Solution of Linear Algebraic Equations
Vectors
Vectors are an efficient notational method for representing lists of numbers. A typical
vector might represent the high temperature every day for a week. Such a vector would
have seven elements and could be written as a row vector (a single row),
Note, that I will use bold letters when referring to the entire vector (or matrix). In both
cases above, the HighTemp vector has seven elements, representing Sunday through
Saturday. To access the individual elements in the array we use an index. For example,
the temperature Sunday would be accessed as HighTemp(1), and is equal to 25.
Likewise HighTemp(4)=38 is Wednesday's high temperature.
Matrices
A matrix (singular of matrices) is for our purposes a series of numbers listed in two
dimensions. As an example, consider high temperatures collected over a 28 day period
(4 weeks). We could write the matrix as a single list 28 elements long, or as a collection
of numbers (a matrix) that has 4 rows and 7 columns.
https://lpsa.swarthmore.edu/BackGround/RevMat/MatrixReview.html 1/7
10/15/22, 11:58 AM Review of Arrays, Vectors and Matrices
Now we need two indices to represent the numbers, one for the row, and one for the
column. For example the high temperature during the 2nd week, on the 3rd day of that
week, is HighTemp(2,3) and is equal to 45. Note that the index for the row comes first.
The symbol aij represents the number in the ith row and the jth column. Note that a
vector is the special case of a matrix, where there is only one row or column - In this
case, the second subscript is dropped.
Matrix operations
For the ensuing discussion assume we have three matrices
Equality
Two matrices are equal if they are the same size, and corresponding elements are
equal. For example, A=B, but A≠C.
Addition
Two matrices can be added if they are the same size. Their sum is given by a third
matrix whose elements are the sum of the corresponding elements being added.of the
two arrays. In other words, if D=A+C then dij=aij+cij.
Transpose of a matrix
We could also write the matrix with rows and columns interchanged. This is referred to
as taking the "transpose" of the matrix. We'll denote the transpose with a single quote, '.
In other words, if D=A', then dij=aji.
https://lpsa.swarthmore.edu/BackGround/RevMat/MatrixReview.html 2/7
10/15/22, 11:58 AM Review of Arrays, Vectors and Matrices
A matrix need not be square in order to take its transpose. The transpose of a column
vector is a row vector, and vice versa.
Multiplication by a scalar
A matrix can be multiplied by a scalar (a scalar is a single number) by multiplying each
element of the array by that number. For example if D=2·A, then dij=2·aij.
obtained by multiplying the row vector represented by the ith row of A by the column
vector represented by the jth column of C. For arrays A and C with n columns and rows,
respectively, we get:
Expressed another way in words. if D=A.C, then the element in D located at row i and
column j is given by the sum of the product of the elements in row i of A and the
elements in column j of C.
, then
Determinant of a matrix
The determinant of a square matrix A is a scalar defined by
https://lpsa.swarthmore.edu/BackGround/RevMat/MatrixReview.html 3/7
10/15/22, 11:58 AM Review of Arrays, Vectors and Matrices
where Mik is the minor of aik. Mik is the determinant of the matrix that remains of A after
the ith row and jth column are deleted. In general it can be computationally very difficult
to calculate determinants. If the matrix has more than 3 rows and columns, you should
use a computer or calculator to help you. For 2×2 or 3×3 matrices there is are shortcuts
(that don't work for larger matrices).
This is simply the product of the terms identified by the blue arrow (down and to the right)
minus the product of the red arrow (up and to the right).
A similar rule applies to the 3×3 matrix (but not larger matrices). The only
complication is that the arrows wrap around the matrix from the right side to the left.
Important Matrices
Identitity Matrix
The identity matrix is a square matrix that has ones along the main diagonal and zeros
elsewhere. The 2×2 identity matrix is shown below.
Inverse Matrix
If the matrix A has an inverse G, we write G=A-1, and G·A=A·G=I. Note that some
matrices don't have inverses.
https://lpsa.swarthmore.edu/BackGround/RevMat/MatrixReview.html 4/7
10/15/22, 11:58 AM Review of Arrays, Vectors and Matrices
where
and Cik is the cofactor of aij. In general the inverse of a matrix is computationally very
difficult to calculate. If the matrix is greater than 2×2, use a calculator or a software
package such as MatLab. For a 2×2 matrix the inverse may be written as:
https://lpsa.swarthmore.edu/BackGround/RevMat/MatrixReview.html 5/7
10/15/22, 11:58 AM Review of Arrays, Vectors and Matrices
In these equations, aij and bi are constants, and the unknowns are xi. We can rewrite the
equations as:
where
We can find all the unknowns in the vector x by doing a few simple matrix
manipulations. If we premultiply both sides of the matrix equation by the inverse of the A
matrix we get:
Clearly,
Note: we didn't calculate A-1 directly, but don't need to if we use a calculator or computer.
https://lpsa.swarthmore.edu/BackGround/RevMat/MatrixReview.html 6/7
10/15/22, 11:58 AM Review of Arrays, Vectors and Matrices
>> x=inv(A)*b
x =
-1
1
2
The eigenvalues are the diagonal of the "d" matrix; λ1=-1, λ2=-2. The
eigenvectors are the columns of the "v" matrix. Note that MatLab chose different
values for v1,1, etc..., but that the ratio of v1,1 to v1,2 and the ratio of v2,1 to v2,2 are
the same as our solution. (MatLab chooses the values such that the sum of the
squares of the elements of the eigenvector equals unity).
References
© Copyright 2005 to 2022 Erik Cheever This page may be freely used for educational purposes, but
the url must be referenced.
Comments? Questions? Suggestions? Corrections?
Erik Cheever Department of Engineering Swarthmore College
https://lpsa.swarthmore.edu/BackGround/RevMat/MatrixReview.html 7/7