HO 2 Matrix Operations (Part 1)
HO 2 Matrix Operations (Part 1)
HO 2 Matrix Operations (Part 1)
In Sections 2.1 to 2.8, the basic operations performed on matrices are discussed.
A thorough understanding of such operations is required in grasping the lessons in
the succeeding chapters of the course. In Section 2.9, the laws of matrix algebra are
outlined. A summary of the contrasts of matrix algebra with scalar algebra follows in
Section 2.10.
Two 𝑟x𝑐 matrices A = {𝑎𝑖𝑗 } and B = {𝑏𝑖𝑗 } are equal if their corresponding
elements are equal, i.e., if 𝑎𝑖𝑗 =𝑏𝑖𝑗 for 𝑖=1,2,…,r and 𝑗=1,2,…,c. Equality of two
matrices has no meaning unless they are of the same order.
1 −2 𝑥 −2
Let A = [ ] and B = [ ], for what values of 𝑥 and 𝑦 will A = B?
3 √2 3 𝑦
If A = {𝑎𝑖𝑗 } and B = {𝑏𝑖𝑗 } are both 𝑟x𝑐 matrices, then the sum A + B is an 𝑟x𝑐
matrix E = {𝑒𝑖𝑗 } defined by 𝑒𝑖𝑗 = 𝑎𝑖𝑗 + 𝑏𝑖𝑗 , 𝑖=1,2,…r and 𝑗=1,2,…,c.
Examples:
1 5 3 −2
1. Let A = [ ] and B = [ ] then
−4 6 4 −5
4 3
E=A+B=[ ]
0 1
5 2 2 0
2. Let U = [1 0] and V = [3 −2]
4 3 6 −8
U+V=[ ]
• Two matrices can be added only if they are of the same order, i.e., they have
the same number of rows and the same number of columns. We then say
that the two matrices are conformable for addition.
• The sum of matrix Arxc and the null matrix Orxc is Arxc.
Exercises
The total cost of each product consists of the manufacturing cost and
the shipping cost.
a. Represent the data sets in matrix form.
b. Give the total manufacturing and shipping costs for each product.
𝜋 3
√𝜋 −𝑖 cos ( ) 𝑒 −3 √787
2. Find K + L if K = [ 1
2
] and L = [ 3 0 ].
log(5) 0 6.23 −2
11
If A = {𝑎𝑖𝑗 } is an 𝑟x𝑐 matrix and 𝑘 is a real number, then the scalar multiple of A
by k, denoted by 𝑘A is the 𝑟x𝑐 matrix E = {𝑒𝑖𝑗 } where 𝑒𝑖𝑗 =𝑘𝑎𝑖𝑗 , 𝑖=1,2,…,r and
j=1,2,…,c
Example:
0 −1 0 −2
Let A = [ ], then 2A = [ ]
2 3 4 6
0 −1 0 1
Example: For A = [ ], then −A = [ ]
2 3 −2 −3
If A and B are 𝑟x𝑐 matrices, then the difference between A and B, denoted by
A − B, is defined as A – B = A + (-1)B.
Examples:
1 5 3 −2
1. Let A = [ ] and B = [ ] then
−4 6 4 −5
−2 7
A-B=[ ]
−8 11
5 2 2 0
2. Let U = [1 0] and V = [3 −2]
4 3 6 −8
U-V=[ ]
Remarks:
• As with addition, only matrices that are of the same order can be subtracted
from one another. Thus, matrices that are conformable for addition are also
conformable for subtraction, and vice versa.
• The negative of a matrix Arxc, −Arxc, can be defined as the (unique) matrix
whose sum with A is the null matrix, i.e., A+(−A) = Arxc – Arxc = Orxc
Exercises
10 | S t a t 1 3 5 : M a t r i x T h e o r y f o r S t a t i s t i c s
Expenses (in $1,000,000)
Year US Canada Australia UK
1981 19 9 11 17
1982 22 10 13 24
If A = {𝑎𝑖𝑗 } is an 𝑟x𝑐 matrix and B = {𝑏𝑖𝑗 } is a 𝑐x𝑠 matrix, then the product of A
and B, AB = E = {𝑒𝑖𝑗 } is an 𝑟x𝑠 matrix defined by
𝑐
𝑖𝑡ℎ 𝑟𝑜𝑤
[→ ] [↓ 𝑗 𝑡ℎ 𝑐𝑜𝑙𝑢𝑚𝑛] = [{(𝑖, 𝑗)𝑡ℎ 𝑒𝑙𝑒𝑚𝑒𝑛𝑡}]𝑟x𝑠
𝑟x𝑐 𝑐x𝑠
Example:
1 2 1 2 −1
Let A2x2 = [ ] and B2x3 = [ ].
0 4 6 0 −2
13 2 −5
Then AB2x3 = [ ]
24 0 −8
2.4.1 Inner Product of Two Vectors
𝑥1
𝑥2
If 𝑎’ = [𝑎1 𝑎2 𝑎3 … 𝑎𝑛 ] and 𝑥 = 𝑥3 , then the inner product of 𝑎 and 𝑥,
⋮
[𝑥𝑛 ]
𝑎′ 𝑥 is a scalar where 𝑎′ 𝑥 = 𝑎1 𝑥1 + 𝑎2 𝑥2 + 𝑎3 𝑥3 … + 𝑎𝑛 𝑥𝑛 = ∑𝑛𝑖=1 𝑎𝑖 𝑥𝑖
11 | S t a t 1 3 5 : M a t r i x T h e o r y f o r S t a t i s t i c s
Examples:
3 20
1. Let 𝑎 = [2] and 𝑥 = [40]. Then 𝑎′𝑥 = 3(20) + 2(40) + 5(60) = 440.
5 60
2 0
2. Let 𝑥 = [1] and 𝑦 = [−1]. Then 𝑥’𝑦 =
3 2
4 2
Remarks:
• The inner product 𝑎′𝑥 of the vector 𝑎 and 𝑥 exists only when 𝑎 and 𝑥 have
the same order, i.e., when the number of columns in 𝑎’ is equal to the
number of rows in 𝑥.
• 𝑎’𝑥 and 𝑥’𝑎 are equal but are not equal to 𝑥𝑎’.
12 | S t a t 1 3 5 : M a t r i x T h e o r y f o r S t a t i s t i c s
2.4.3 Matrix-Vector Product
If A = {𝑎𝑖𝑗 } and x = {𝑥𝑖𝑗 } for 𝑖=1,2,…,r and 𝑗=1,2,…,c, then
Ax = {∑𝑐𝑗=1 𝑎𝑖𝑗 𝑥𝑗 } for 𝑖=1,2,…,r
Suppose the animal prices in neighboring town were $2, $2, and $8,
respectively.
1. Present the prices of the animals in the hometown and neighboring town
in matrix form. Denote it by P.
2. How much would it cost the chemistry department to purchase the
required animals in the hometown? Present the total costs simultaneously.
Remarks:
• The product AB of two matrices A and B is defined and therefore exist only
if the number of columns in A equals the number of rows in B; the matrices
are then said to be conformable for multiplication for the product AB.
13 | S t a t 1 3 5 : M a t r i x T h e o r y f o r S t a t i s t i c s
• From the definition of matrix multiplication, the product BA does not
necessarily exist, even if AB does.
• If A is of order 𝑟x𝑐:
o B must have ___ rows for AB to exist.
o B must have ___ columns for BA to exist.
o B must be of order ________ for AB and BA to both exist.
• Both AB and BA always exist and are of the same order when A and B are
square matrices and of the same order. AB and BA are not necessarily equal.
• Assuming that the matrix products under consideration exist,
o In getting the product AB, we premultiply A to B or premultiply B
by A. Equivalently, we postmultiply B to A or postmultiply A by B.
o A row vector postmultiplied by a column vector is a scalar.
o A column vector postmultiplied by a row vector is a matrix.
o A matrix postmultiplied by a column vector is a column vector.
o A row vector postmultiplied by a matrix is a row vector.
Example:
0 4 8
0 1 2 3
Let A4x3 = [1 5 9 ]. Then A’ = [
3x4 4 5 6 7 ].
2 6 10
8 9 10 11
3 7 11
Remarks:
• The rows of A’ are the same as the columns of A.
• If A is an 𝑟x𝑐 matrix, then A’ is a 𝑐x𝑟 matrix.
• If 𝑎𝑖𝑗 is the term in the 𝑖 𝑡ℎ row and the 𝑗 𝑡ℎ column of Arxc, it is also the term
in the 𝑗 𝑡ℎ row and 𝑖 𝑡ℎ column of A’cxr.
• The notation for the transpose of A is A’. For clarity, one of the equivalent
forms (Arxc)’ or (A’)cxr must be used whenever it is necessary to have a
subscript notation for the order of the transposed matrix.
14 | S t a t 1 3 5 : M a t r i x T h e o r y f o r S t a t i s t i c s
Some Properties of the Transpose of a Matrix
1. Reflexive Property: For any 𝑟x𝑐 matrix A, (A’)’ = A.
Proof:
Remarks:
• The fourth property can be extended directly to the transpose of the product
of more than 2 matrices. Thus, for a finite number of matrices,
(A1 A2 A3… Ak-1 Ak)’ = (Ak’ Ak-1’… A3’ A2’ A1’)
• The transpose of a column vector is a row vector and vice-versa.
Example:
1
If 𝑥 3x1 = [2], then 𝑥’1x3 = [1 2 3].
3
15 | S t a t 1 3 5 : M a t r i x T h e o r y f o r S t a t i s t i c s