Chapter 2
Matrices and Linear Algebra
2.1 Basics
Definition 2.1.1. A matrix is an m × n array of scalars from a given field
F . The individual values in the matrix are called entries.
Examples.
2 1 3 1 2
A= B=
−1 2 4 3 4
The size of the array is–written as m × n, where
m×n
number of rows number of columns
Notation
a11 a12 . . . a1n
a21 a22 . . . a2n ←− rows
A=
an1 an2 . . . amn
columns
A := uppercase denotes a matrix
a := lower case denotes an entry of a matrix a ∈ F.
Special matrices
33
,34 CHAPTER 2. MATRICES AND LINEAR ALGEBRA
(1) If m = n, the matrix is called square. In this case we have
(1a) A matrix A is said to be diagonal if
aij = 0 i = j.
(1b) A diagonal matrix A may be denoted by diag(d1 , d2 , . . . , dn )
where
aii = di aij = 0 j = i.
The diagonal matrix diag(1, 1, . . . , 1) is called the identity matrix
and is usually denoted by
1 0 ... 0
0 1
In = . ..
.. .
0 1
or simply I, when n is assumed to be known. 0 = diag(0, . . . , 0)
is called the zero matrix.
(1c) A square matrix L is said to be lower triangular if
ij =0 i < j.
(1d) A square matrix U is said to be upper triangular if
uij = 0 i > j.
(1e) A square matrix A is called symmetric if
aij = aji .
(1f) A square matrix A is called Hermitian if
aij = āji (z̄ := complex conjugate of z).
(1g) Eij has a 1 in the (i, j) position and zeros in all other positions.
(2) A rectangular matrix A is called nonnegative if
aij ≥ 0 all i, j.
It is called positive if
aij > 0 all i, j.
Each of these matrices has some special properties, which we will study
during this course.
,2.1. BASICS 35
Definition 2.1.2. The set of all m × n matrices is denoted by Mm,n (F ),
where F is the underlying field (usually R or C). In the case where m = n
we write Mn (F ) to denote the matrices of size n × n.
Theorem 2.1.1. Mm,n is a vector space with basis given by Eij , 1 ≤ i ≤
m, 1 ≤ j ≤ n.
Equality, Addition, Multiplication
Definition 2.1.3. Two matrices A and B are equal if and only if they have
the same size and
aij = bij all i, j.
Definition 2.1.4. If A is any matrix and α ∈ F then the scalar multipli-
cation B = αA is defined by
bij = αaij all i, j.
Definition 2.1.5. If A and B are matrices of the same size then the sum
A and B is defined by C = A + B, where
cij = aij + bij all i, j
We can also compute the difference D = A − B by summing A and (−1)B
D = A − B = A + (−1)B.
matrix subtraction.
Matrix addition “inherits” many properties from the field F .
Theorem 2.1.2. If A, B, C ∈ Mm,n (F ) and α, β ∈ F , then
(1) A + B = B + A commutivity
(2) A + (B + C) = (A + B) + C associativity
(3) α(A + B) = αA + αB distributivity of a scalar
(4) If B = 0 (a matrix of all zeros) then
A+B =A+0=A
(4) (α + β)A = αA + βA
, 36 CHAPTER 2. MATRICES AND LINEAR ALGEBRA
(5) α(βA) = αβA
(6) 0A = 0
(7) α 0 = 0.
Definition 2.1.6. If x and y ∈ Rn ,
x = (x1 . . . xn )
y = (y1 . . . yn ).
Then the scalar or dot product of x and y is given by
n
x, y = xi yi .
i=1
Remark 2.1.1. (i) Alternate notation for the scalar product: x, y = x · y.
(ii) The dot product is defined only for vectors of the same length.
Example 2.1.1. Let x = (1, 0, 3, −1) and y = (0, 2, −1, 2) then x, y =
1(0) + 0(2) + 3(−1) − 1(2) = −5.
Definition 2.1.7. If A is m × n and B is n × p. Let ri (A) denote the vector
with entries given by the ith row of A, and let cj (B) denote the vector with
entries given by the j th row of B. The product C = AB is the m × p matrix
defined by
cij = ri (A), cj (B)
where ri (A) is the vector in Rn consisting of the ith row of A and similarly
cj (B) is the vector formed from the j th column of B. Other notation for
C = AB
n
cij = aik bkj 1 ≤ i ≤ m
k=1
1 ≤ j ≤ p.
Example 2.1.2. Let
2 1
1 0 1
A= and B = 3 0 .
3 2 1
−1 1
Then
1 2
AB = .
11 4
Matrices and Linear Algebra
2.1 Basics
Definition 2.1.1. A matrix is an m × n array of scalars from a given field
F . The individual values in the matrix are called entries.
Examples.
2 1 3 1 2
A= B=
−1 2 4 3 4
The size of the array is–written as m × n, where
m×n
number of rows number of columns
Notation
a11 a12 . . . a1n
a21 a22 . . . a2n ←− rows
A=
an1 an2 . . . amn
columns
A := uppercase denotes a matrix
a := lower case denotes an entry of a matrix a ∈ F.
Special matrices
33
,34 CHAPTER 2. MATRICES AND LINEAR ALGEBRA
(1) If m = n, the matrix is called square. In this case we have
(1a) A matrix A is said to be diagonal if
aij = 0 i = j.
(1b) A diagonal matrix A may be denoted by diag(d1 , d2 , . . . , dn )
where
aii = di aij = 0 j = i.
The diagonal matrix diag(1, 1, . . . , 1) is called the identity matrix
and is usually denoted by
1 0 ... 0
0 1
In = . ..
.. .
0 1
or simply I, when n is assumed to be known. 0 = diag(0, . . . , 0)
is called the zero matrix.
(1c) A square matrix L is said to be lower triangular if
ij =0 i < j.
(1d) A square matrix U is said to be upper triangular if
uij = 0 i > j.
(1e) A square matrix A is called symmetric if
aij = aji .
(1f) A square matrix A is called Hermitian if
aij = āji (z̄ := complex conjugate of z).
(1g) Eij has a 1 in the (i, j) position and zeros in all other positions.
(2) A rectangular matrix A is called nonnegative if
aij ≥ 0 all i, j.
It is called positive if
aij > 0 all i, j.
Each of these matrices has some special properties, which we will study
during this course.
,2.1. BASICS 35
Definition 2.1.2. The set of all m × n matrices is denoted by Mm,n (F ),
where F is the underlying field (usually R or C). In the case where m = n
we write Mn (F ) to denote the matrices of size n × n.
Theorem 2.1.1. Mm,n is a vector space with basis given by Eij , 1 ≤ i ≤
m, 1 ≤ j ≤ n.
Equality, Addition, Multiplication
Definition 2.1.3. Two matrices A and B are equal if and only if they have
the same size and
aij = bij all i, j.
Definition 2.1.4. If A is any matrix and α ∈ F then the scalar multipli-
cation B = αA is defined by
bij = αaij all i, j.
Definition 2.1.5. If A and B are matrices of the same size then the sum
A and B is defined by C = A + B, where
cij = aij + bij all i, j
We can also compute the difference D = A − B by summing A and (−1)B
D = A − B = A + (−1)B.
matrix subtraction.
Matrix addition “inherits” many properties from the field F .
Theorem 2.1.2. If A, B, C ∈ Mm,n (F ) and α, β ∈ F , then
(1) A + B = B + A commutivity
(2) A + (B + C) = (A + B) + C associativity
(3) α(A + B) = αA + αB distributivity of a scalar
(4) If B = 0 (a matrix of all zeros) then
A+B =A+0=A
(4) (α + β)A = αA + βA
, 36 CHAPTER 2. MATRICES AND LINEAR ALGEBRA
(5) α(βA) = αβA
(6) 0A = 0
(7) α 0 = 0.
Definition 2.1.6. If x and y ∈ Rn ,
x = (x1 . . . xn )
y = (y1 . . . yn ).
Then the scalar or dot product of x and y is given by
n
x, y = xi yi .
i=1
Remark 2.1.1. (i) Alternate notation for the scalar product: x, y = x · y.
(ii) The dot product is defined only for vectors of the same length.
Example 2.1.1. Let x = (1, 0, 3, −1) and y = (0, 2, −1, 2) then x, y =
1(0) + 0(2) + 3(−1) − 1(2) = −5.
Definition 2.1.7. If A is m × n and B is n × p. Let ri (A) denote the vector
with entries given by the ith row of A, and let cj (B) denote the vector with
entries given by the j th row of B. The product C = AB is the m × p matrix
defined by
cij = ri (A), cj (B)
where ri (A) is the vector in Rn consisting of the ith row of A and similarly
cj (B) is the vector formed from the j th column of B. Other notation for
C = AB
n
cij = aik bkj 1 ≤ i ≤ m
k=1
1 ≤ j ≤ p.
Example 2.1.2. Let
2 1
1 0 1
A= and B = 3 0 .
3 2 1
−1 1
Then
1 2
AB = .
11 4