Lesson 1: Matrix Addition, Scalar Multiplication, Matrix Multiplication
Estimated time: 35-45 minutes
Learning Objectives
By the end of this lesson, you will be able to:
- Describe the size (dimensions) of a matrix and identify individual entries
- Add and subtract matrices of the same size
- Multiply a matrix by a scalar
- Multiply two matrices using the row-column rule
- Determine when matrix multiplication is defined
Matrix Notation and Size
Matrix: A rectangular array of numbers arranged in rows and columns. An m x n matrix has m rows and n columns. The entry in row i, column j is denoted a_{ij}.
Example: Matrix Dimensions
[ 4 5 6 ]
A is a 2 x 3 matrix (2 rows, 3 columns). Entry a_{12} = 2 (row 1, column 2). Entry a_{21} = 4 (row 2, column 1).
Matrix Addition
Matrix Addition: Two matrices A and B can be added only if they have the same dimensions. The sum A + B is computed entry by entry: (A + B)_{ij} = a_{ij} + b_{ij}.
Worked Example
[ 3 4 ] [ 0 2 ] [ 3+0 4+2 ] [ 3 6 ]
Scalar Multiplication
Scalar Multiplication: To multiply a matrix by a scalar c, multiply every entry by c: (cA)_{ij} = c * a_{ij}.
Worked Example
[ 4 0 ] [ 12 0 ]
Matrix Multiplication
Matrix multiplication is the most important (and most involved) operation. It is NOT computed entry by entry.
Matrix Multiplication: If A is m x n and B is n x p, then the product AB is an m x p matrix. The entry (AB)_{ij} is computed by taking the dot product of row i of A with column j of B.
Size requirement: The number of columns of A must equal the number of rows of B.
Size Check for AB
(m x n) times (n x p) = (m x p). The inner dimensions must match.
Worked Example: 2x2 Times 2x2
[ 3 4 ] [ 7 8 ]
AB:
Entry (1,1): row 1 of A dot column 1 of B = 1(5) + 2(7) = 5 + 14 = 19
Entry (1,2): row 1 of A dot column 2 of B = 1(6) + 2(8) = 6 + 16 = 22
Entry (2,1): row 2 of A dot column 1 of B = 3(5) + 4(7) = 15 + 28 = 43
Entry (2,2): row 2 of A dot column 2 of B = 3(6) + 4(8) = 18 + 32 = 50
[ 43 50 ]
Worked Example: 2x3 Times 3x1
[ 2 1 -1 ] [ 1 ] [ 2(3)+1(1)+(-1)(4) ] [ 3 ]
[ 4 ]
A is 2x3, B is 3x1. Inner dimensions match (3=3). Result is 2x1.
Worked Example: Multiplication Not Defined
If A is 2x3 and B is 2x3, can we compute AB?
No! A has 3 columns but B has 2 rows. The inner dimensions (3 and 2) do not match, so AB is not defined.
The Identity Matrix
Identity Matrix I_n: The n x n matrix with 1s on the main diagonal and 0s everywhere else. For any m x n matrix A: I_m A = A and A I_n = A.
Example
[ 0 1 0 ]
[ 0 0 1 ]
The identity matrix is the matrix equivalent of the number 1: multiplying by it changes nothing.
Check Your Understanding
1. If A is 3x4 and B is 4x2, what is the size of AB? Can you compute BA?
2. Compute: 2 * [ 3 -1 ; 0 4 ] + [ 1 2 ; -3 1 ]
3. Compute the product: [ 1 0 ; 0 -1 ] * [ 3 ; 5 ]
4. Is matrix multiplication commutative? That is, does AB = BA in general?
Key Takeaways
- Matrix addition requires same dimensions and is done entry by entry
- Scalar multiplication multiplies every entry by the scalar
- Matrix multiplication uses the row-column dot product rule
- AB is defined only when A's columns = B's rows; result size is (A's rows) x (B's columns)
- Matrix multiplication is NOT commutative: AB does not generally equal BA
- The identity matrix I acts like the number 1 for multiplication
Next Lesson
Lesson 2 covers the properties of matrix arithmetic and the transpose operation.
Start Lesson 2