haya.Learning made clear
Unit VI · Matrix algebra
8 min readConcept sheetShort calculation; 5- or 10-mark business table problem

Matrices: addition, scalar and matrix multiplication

A matrix is a rectangular table of numbers. Add matrices of the same order; multiply A by B only when the columns of A equal the rows of B.

Orderm × n (rows × columns)
AdditionSame order; add matching entries
Product AB(m × n)(n × p) gives m × p
WarningAB ≠ BA in general

Types of matrix

TypeDescriptionExample
Row matrixOne row (1 × n)[3 1 4]
Column matrixOne column (m × 1)[2; 5]
Square matrixSame number of rows and columns[2 5; 1 3]
Zero matrix OAll entries 0[0 0; 0 0]
Identity matrix I1s on the main diagonal, 0s elsewhere; AI = IA = A[1 0; 0 1]
Transpose AᵀRows become columns[1 2; 3 4]ᵀ = [1 3; 2 4]

Rules of matrix arithmetic

Notation in these notes[a b; c d]: rows separated by semicolons
A + B, A − BOnly for the same order; add or subtract matching entries
Scalar multiple kAMultiply every entry by k
Product ABEntry (i, j) = row i of A · column j of B
When AB existsColumns of A = rows of B
Order of AB(m × n)(n × p) → m × p
Commutative?A + B = B + A, but usually AB ≠ BA

Addition, subtraction and scalar multiples

Problem

A = [2 5; 1 3] and B = [4 0; −2 6]. Find A + B, A − B and 3A.

Working
  1. A + B = [2 + 4, 5 + 0; 1 + (−2), 3 + 6] = [6 5; −1 9].
  2. A − B = [2 − 4, 5 − 0; 1 − (−2), 3 − 6] = [−2 5; 3 −3].
  3. 3A = [3 × 2, 3 × 5; 3 × 1, 3 × 3] = [6 15; 3 9].
Answer

A + B = [6 5; −1 9]; A − B = [−2 5; 3 −3]; 3A = [6 15; 3 9]

Matrix multiplication

Problem

With A = [2 5; 1 3] and B = [4 0; −2 6], find AB and BA.

Working
  1. Both are 2 × 2, so AB and BA exist and are 2 × 2.
  2. AB row 1: 2 × 4 + 5 × (−2) = −2; 2 × 0 + 5 × 6 = 30.
  3. AB row 2: 1 × 4 + 3 × (−2) = −2; 1 × 0 + 3 × 6 = 18.
  4. BA row 1: 4 × 2 + 0 × 1 = 8; 4 × 5 + 0 × 3 = 20.
  5. BA row 2: (−2) × 2 + 6 × 1 = 2; (−2) × 5 + 6 × 3 = 8.
Answer

AB = [−2 30; −2 18] but BA = [8 20; 2 8], so AB ≠ BA.

Branch revenue with a matrix product

Problem

A retailer's two Kurunegala branches sold, in one day: Branch 1: 20 packets of tea, 15 kg of sugar, 30 kg of rice; Branch 2: 25, 10 and 40. Prices are Rs. 450 a packet of tea, Rs. 280 a kg of sugar and Rs. 320 a kg of rice. Find each branch's revenue with one matrix product.

Working
  1. Quantity matrix Q (2 × 3) = [20 15 30; 25 10 40]; price matrix P (3 × 1) = [450; 280; 320].
  2. Columns of Q (3) = rows of P (3), so QP exists and is 2 × 1.
  3. Branch 1: 20 × 450 + 15 × 280 + 30 × 320 = 9,000 + 4,200 + 9,600 = 22,800.
  4. Branch 2: 25 × 450 + 10 × 280 + 40 × 320 = 11,250 + 2,800 + 12,800 = 26,850.
  5. Total = 22,800 + 26,850 = 49,650.
Answer

QP = [22,800; 26,850]: Branch 1 Rs. 22,800, Branch 2 Rs. 26,850, total Rs. 49,650.

In Sri Lankan business

A retail chain such as Cargills or Keells can store branch-by-product sales as a matrix. Multiplying the quantity matrix by a price column gives every branch's revenue in one step, which is exactly how spreadsheets do it.

Exam angle

Short answer: “When can two matrices be multiplied? State the order of the product.” When the columns of the first equal the rows of the second; (m × n)(n × p) gives m × p.

Short answer: “A = [2 5; 1 3], B = [4 0; −2 6]. Find 2A − B.” 2A = [4 10; 2 6]; 2A − B = [0 10; 4 0].

Essay: “Two branches' quantities of three goods and the goods' prices are given. Write the matrices, find the revenue of each branch by matrix multiplication and the total.” QP = [22,800; 26,850]; total Rs. 49,650.

Remember it

Row into column: for AB, run along a row of A and down a column of B, multiply in pairs and add. Check the orders first: inside numbers must match, outside numbers give the answer's order.