Docsity

Matrix Algebra Calculation, Study notes of Applied Mathematics

Toggle sidebar
bg1
ECO2025-N • APPLIED MATHS & STATISTICS
Lecture 6: Matrix Algebra • Study Notes
Applied Mathematics and Statistics for Economists
Matrix Algebra
ECO2025-N Applied Maths & Statistics
Lecture 5 | Dr Shibly Shahrier | Teesside University
This lecture introduces matrix algebra as a compact way of representing and solving systems of simultaneous linear
equations. It covers matrix notation and types, basic matrix operations, determinants and matrix inversion, Cramer's
rule, and an application to a reduced-form macroeconomic model.
Key point: Matrices make larger systems of linear equations easier to organise and solve. The lecture focuses on
two solution methods: matrix inversion and Cramer's rule.
1. Introduction to matrix algebra
• When a problem contains three or more simultaneous equations, solving them
using methods designed for two equations can become cumbersome and prone to
errors.
• Matrix algebra provides a compact notation for writing a large set of linear
equations.
• It helps establish whether a solution exists and provides systematic methods for
finding the solution.
• The two methods developed in this lecture are matrix inversion and Cramer's rule.
• A limitation emphasised in the lecture is that matrix algebra, as used here, handles
linear equations only.
Key point: Matrix algebra is especially useful when many unknowns and equations
must be handled together.
2. Definition and notation
2.1 What is a matrix?
• A matrix is an arrangement of numbers or symbols into rows and columns.
• The individual numbers or symbols inside a matrix are called elements.
• A square matrix has the same number of rows and columns.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Matrix Algebra Calculation and more Study notes Applied Mathematics in PDF only on Docsity!

Applied Mathematics and Statistics for Economists

Matrix Algebra

ECO2025-N Applied Maths & Statistics Lecture 5 | Dr Shibly Shahrier | Teesside University This lecture introduces matrix algebra as a compact way of representing and solving systems of simultaneous linear equations. It covers matrix notation and types, basic matrix operations, determinants and matrix inversion, Cramer's rule, and an application to a reduced-form macroeconomic model. Key point: Matrices make larger systems of linear equations easier to organise and solve. The lecture focuses on two solution methods: matrix inversion and Cramer's rule.

1. Introduction to matrix algebra

  • When a problem contains three or more simultaneous equations, solving them using methods designed for two equations can become cumbersome and prone to errors.
  • Matrix algebra provides a compact notation for writing a large set of linear equations.
  • It helps establish whether a solution exists and provides systematic methods for finding the solution.
  • The two methods developed in this lecture are matrix inversion and Cramer's rule.
  • A limitation emphasised in the lecture is that matrix algebra, as used here, handles linear equations only. Key point: Matrix algebra is especially useful when many unknowns and equations must be handled together.

2. Definition and notation

2.1 What is a matrix?

  • A matrix is an arrangement of numbers or symbols into rows and columns.
  • The individual numbers or symbols inside a matrix are called elements.
  • A square matrix has the same number of rows and columns.
  • The order (or dimension) of a matrix is written as rows × columns. A matrix of order m × n has m rows and n columns. Meaning: m = number of rows; n = number of columns. For example, a 3 × 2 matrix has 3 rows and 2 columns. Example of a 3 × 2 matrix: A = [ 1 6 ] [ −4 9 ] [ 11 17 ] Example of a 3 × 3 square matrix: B = [ 1 6 23 ] [ −4 9 22 ] [ 11 17 −5 ]

2.2 Identifying individual elements

  • Elements are identified by a letter and two subscripts, for example a₁₂.
  • The first subscript identifies the row.
  • The second subscript identifies the column.
  • Therefore, a₁₂ is the element in row 1, column 2. aᵢⱼ = element in row i and column j Meaning: i identifies the row; j identifies the column.
  • A matrix is uniquely defined by the values and positions of all its elements. If even one element differs, the matrices are not equal.

2.3 Special matrices

  • Null (zero) matrix: a matrix in which every element is zero. O = [ 0 0 0 ] [ 0 0 0 ]
  • Identity (unit) matrix, I: a square matrix with 1s on the leading diagonal and 0s everywhere else. I = [ 1 0 0 ] [ 0 1 0 ] [ 0 0 1 ]

[ a₂₁−b₂₁ a₂₂−b₂₂ ]

  • If the matrices have different dimensions, addition or subtraction is not defined. Key point: Check the dimensions before adding or subtracting: they must match exactly.

3.3 Rule 3 — Multiplication of two matrices

  • Matrix multiplication combines rows of the first matrix with columns of the second matrix.
  • Each element in the product is found by multiplying corresponding entries in a row and a column, then adding those products.
  • For a 2 × 2 product, the general result is: AB = [ a₁₁b₁₁+a₁₂b₂₁ a₁₁b₁₂+a₁₂b₂₂ ] [ a₂₁b₁₁+a₂₂b₂₁ a₂₁b₁₂+a₂₂b₂₂ ]

Conformability: when can matrices be multiplied?

  • A × B is possible only when the number of columns in A equals the number of rows in B.
  • The lecture describes this by comparing the number of elements in a row of A with the number of elements in a column of B. (m × n) × (n × p) = (m × p) Meaning: The two inner dimensions, n and n, must match. The resulting matrix has the two outer dimensions, m × p.
  • If the inner dimensions do not match, the matrices are non-conformable and the product does not exist.

Order matters

  • Pre-multiplication and post-multiplication refer to the order in which matrices are written.
  • AB means A is multiplied by B; BA means B is multiplied by A.
  • In general, AB ≠ BA. Matrix multiplication is not commutative. Key point: Always check conformability and preserve the order of multiplication. AB and BA are generally different.

3.4 Rule 4 — Vector multiplication

  • A special case occurs when a 1 × n row vector is multiplied by an n × 1 column vector.
  • The result is a scalar (a single number). a = [ a₁₁ a₁₂ a₁₃ ] b = [ b₁₁ ] [ b₂₁ ] [ b₃₁ ] ab = a₁₁b₁₁ + a₁₂b₂₁ + a₁₃b₃₁
  • If the column vector is instead multiplied by the row vector, the result is a matrix. ba = [ b₁₁a₁₁ b₁₁a₁₂ b₁₁a₁₃ ] [ b₂₁a₁₁ b₂₁a₁₂ b₂₁a₁₃ ] [ b₃₁a₁₁ b₃₁a₁₂ b₃₁a₁₃ ]
  • Therefore, ab ≠ ba: the first product is a scalar, while the second is a square matrix. Key point: Row vector × column vector gives a scalar; column vector × row vector gives a matrix.

3.5 Rule 5 — Scalar multiplication

  • A scalar is an ordinary number used to multiply a matrix.
  • Multiply every element in the matrix by the scalar k. kA = k[ a₁₁ a₁₂ ] = [ ka₁₁ ka₁₂ ] [ a₂₁ a₂₂ ] [ ka₂₁ ka₂₂ ]
  • For example, if k = 2, every element of A is doubled. Key point: Scalar multiplication changes every element by the same multiplier.

4. Using matrix inversion to solve simultaneous equations

4.1 Writing simultaneous equations in matrix form

The lecture uses the following three simultaneous linear equations: 4x + y − 5z = 8 −2x + 3y + z = 12 3x − y + 4z = 5

5.2 Determinant of a 2 × 2 matrix

A = [ a b ] [ c d ] |A| = ad − bc Meaning: Multiply the leading diagonal (a × d), then subtract the product of the other diagonal (b × c). Worked example from the lecture: A = [ 3 4 ] [ 2 −5 ] |A| = 3(−5) − 4(2) = −15 − 8 = − A second example illustrates a singular matrix: B = [ 3 2 ] [ 6 4 ] |B| = 3(4) − 2(6) = 12 − 12 = 0

  • A singular matrix has determinant zero. In the lecture's example, the second row is a multiple of the first row. Key point: For a 2 × 2 matrix, remember ad − bc. A zero determinant means the matrix is singular and has no inverse.

5.3 Determinant of a 3 × 3 matrix

  • For a 3 × 3 matrix, the lecture expands the determinant along the first row.
  • For each element in the first row, delete its row and column to create a 2 × 2 sub- matrix. The determinant of that sub-matrix is called a minor. |A| = a₁₁|M₁₁| − a₁₂|M₁₂| + a₁₃|M₁₃|
  • M₁₁ is found by deleting row 1 and column 1.
  • M₁₂ is found by deleting row 1 and column 2.
  • M₁₃ is found by deleting row 1 and column 3. |M₁₁| = a₂₂a₃₃ − a₂₃a₃₂ |M₁₂| = a₂₁a₃₃ − a₂₃a₃₁ |M₁₃| = a₂₁a₃₂ − a₂₂a₃₁

Minors and cofactors

  • A minor is the determinant of the smaller matrix left after deleting the relevant row and column.
  • A cofactor is a minor with its appropriate positive or negative sign.
  • The signs follow an alternating checkerboard pattern: [ + − + ] [ − + − ] [ + − + ]
  • The lecture states the sign rule as positive when the row and column subscripts add to an even number, and negative when they add to an odd number. Key point: Do not confuse a minor with a cofactor: a cofactor includes the sign.

6. Finding the inverse of a 3 × 3 matrix

6.1 The meaning of an inverse

  • In ordinary algebra, a number multiplied by its reciprocal gives 1.
  • In matrix algebra, a matrix multiplied by its inverse gives the identity matrix. AA⁻¹ = A⁻¹A = I
  • The process of finding A⁻¹ is called matrix inversion.
  • If |A| = 0, the inverse does not exist.

6.2 Formula for the inverse

A⁻¹ = (1 / |A|) Cᵀ

  • First calculate all nine minors and apply the correct signs to obtain the cofactor matrix C.
  • Transpose C to obtain Cᵀ. The lecture calls this the adjoint matrix of A.
  • Calculate the determinant |A|.
  • Divide every element of Cᵀ by |A|.
  • Check the result by multiplying A by A⁻¹; the product should be I.

6.3 Worked example: inverse of the coefficient matrix

Use the coefficient matrix from the three-equation system: A = [ 4 1 −5 ]

6.4 Checking the inverse

  • The lecture checks the inverse by multiplying A by A⁻¹.
  • The product should be the identity matrix, with 1s on the leading diagonal and 0s elsewhere. AA⁻¹ = I = [ 1 0 0 ] [ 0 1 0 ] [ 0 0 1 ]
  • The lecture notes that both pre-multiplication and post-multiplication by the inverse produce the identity matrix. Key point: The identity-matrix check is a useful way to detect errors in an inverse calculation.

6.5 Solving for x, y and z using the inverse

  • Recall that the system is Ax = b, so the solution is x = A⁻¹b. x = (1/98) [ 13 1 16 ] [ 8 ] [ 11 31 6 ] [ 12 ] [ −7 7 14 ] [ 5 ] Multiply each row of A⁻¹ by the column vector b: x = (13×8 + 1×12 + 16×5) / 98 = (104 + 12 + 80) / 98 = 196/98 = 2 y = (11×8 + 31×12 + 6×5) / 98 = (88 + 372 + 30) / 98 = 490/98 = 5 z = (−7×8 + 7×12 + 14×5) / 98 = (−56 + 84 + 70) / 98 = 98/98 = 1 Solution: x = 2, y = 5, z = 1 Check in the original equations:
  • 4(2) + 5 − 5(1) = 8.
  • −2(2) + 3(5) + 1 = 12.
  • 3(2) − 5 + 4(1) = 5. Key point: The solution satisfies all three original equations.

7. Cramer's rule

7.1 What is Cramer's rule?

  • Cramer's rule is another method for solving a system of simultaneous linear equations.
  • It uses determinants to calculate each unknown separately.
  • The coefficient matrix A must be square and its determinant must be non-zero. xᵢ = |Aᵢ| / |A| Meaning: |A| is the determinant of the original coefficient matrix. Aᵢ is formed by replacing column i of A with the constants vector b.

7.2 Steps for applying Cramer's rule

  1. Write the simultaneous equations in matrix form Ax = b.
  2. Calculate the determinant of the coefficient matrix, |A|.
  3. To find the first unknown, replace the first column of A with b and calculate the new determinant.
  4. Divide the new determinant by |A|.
  5. Repeat for each unknown, replacing the relevant column each time.

7.3 Worked example using the same system

The coefficient matrix and constants vector are: A = [ 4 1 −5 ] b = [ 8 ] [ −2 3 1 ] [ 12 ] [ 3 −1 4 ] [ 5 ]

  • The determinant of the original matrix is |A| = 98. Find x — replace column 1 with b: A₁ = [ 8 1 −5 ] [ 12 3 1 ] [ 5 −1 4 ] |A₁| = 196 x = |A₁| / |A| = 196 / 98 = 2 Find y — replace column 2 with b:

Y = C + I + G

C = a(Y − T) + b T = tY

  • Y = national income/output.
  • C = consumption.
  • I = investment.
  • G = government expenditure.
  • T = taxes.
  • a = marginal propensity to consume (MPC), the parameter multiplying disposable income.
  • b = autonomous consumption term.
  • t = tax rate.
  • I, G and b are treated as exogenous variables in this model; Y, C and T are the unknowns. The model links national income, consumption and taxation. Consumption depends on disposable income (Y − T) and the autonomous term b; taxes depend on income.

8.2 Rearranging the equations

Move the endogenous variables to the left and the exogenous variables to the right: Y − C = I + G −aY + C + aT = b −tY + T = 0

  • The first equation comes from rearranging Y = C + I + G.
  • The second comes from rearranging C = a(Y − T) + b.
  • The third comes from rearranging T = tY.

8.3 Writing the model in matrix form

[ 1 −1 0 ] [ Y ] [ I + G ]

[ −a 1 a ] [ C ] = [ b ] [ −t 0 1 ] [ T ] [ 0 ] Ax = b

  • A is the coefficient/parameter matrix. Its elements include the MPC parameter a and the tax rate t.
  • x is the vector of unknowns: Y, C and T.
  • b is the vector of exogenous terms: I + G, the autonomous consumption term b, and 0. Key point: This is a common structure in economic modelling: a coefficient matrix multiplies a vector of endogenous variables to equal a vector of exogenous variables.

8.4 Determinant and inverse of the macroeconomic coefficient matrix

For the coefficient matrix: A = [ 1 −1 0 ] [ −a 1 a ] [ −t 0 1 ] The determinant is: |A| = 1 − a + at = 1 − a(1 − t)

  • The inverse exists when 1 − a(1 − t) ≠ 0.
  • The lecture finds the inverse by calculating the cofactor matrix, transposing it and dividing by the determinant. A⁻¹ = 1 / [1 − a(1 − t)] × [ 1 1 −a ] [ a(1−t) 1 −a ] [ t t 1−a ]

8.5 Solving for national income, consumption and taxes

Multiply the inverse matrix by the exogenous-variable vector: [ Y ] 1 [ 1 1 −a ] [ I + G ] [ C ] = ------------- × [ a(1−t) 1 −a ] [ b ] [ T ] 1−a(1−t) [ t t 1−a ] [ 0 ] Reading the rows of the product gives: Y = (I + G + b) / [1 − a(1 − t)] C = [a(1 − t)(I + G) + b] / [1 − a(1 − t)] T = [t(I + G + b)] / [1 − a(1 − t)]

  • The denominator 1 − a(1 − t) appears in each expression because the same coefficient matrix determines all three endogenous variables.

10. Exam approach and common pitfalls

10.1 Reliable approach

  1. Identify the dimensions of every matrix before carrying out an operation.
  2. For addition or subtraction, confirm that the matrices have exactly the same order.
  3. For multiplication, check that the number of columns in the first matrix equals the number of rows in the second.
  4. For a transpose, turn every row into the corresponding column.
  5. For a determinant, use the correct formula and keep track of all negative signs.
  6. For a 3 × 3 determinant, calculate minors carefully and apply the alternating cofactor signs.
  7. Before finding an inverse, calculate the determinant and confirm that it is not zero.
  8. When finding an inverse, calculate the cofactor matrix, transpose it, and divide by the determinant.
  9. Check an inverse by multiplying it by the original matrix and confirming that the result is the identity matrix.
  10. For matrix inversion of a system, arrange the equations as Ax = b and calculate x = A⁻¹b.
  11. For Cramer's rule, replace the correct column with b for each unknown, then divide the new determinant by |A|.
  12. For an economic model, clearly distinguish the coefficient matrix, unknown vector and exogenous-variable vector.

10.2 Common pitfalls

  • Confusing the order of a matrix: rows are written first, columns second.
  • Assuming two matrices can be added just because they contain the same number of elements; their row and column dimensions must match.
  • Multiplying matrices in the wrong order or forgetting to check conformability.
  • Assuming AB = BA. Matrix multiplication is generally not commutative.
  • Confusing a row vector multiplied by a column vector (a scalar) with a column vector multiplied by a row vector (a matrix).
  • Forgetting that only square matrices have determinants and inverses.
  • Using the wrong sign in the 2 × 2 determinant: the rule is ad − bc.
  • Forgetting the alternating signs when calculating cofactors.
  • Using A⁻¹ when |A| = 0; a singular matrix has no inverse.
  • Forgetting to transpose the cofactor matrix before dividing by the determinant.
  • In Cramer's rule, replacing the wrong column or dividing by the wrong determinant.
  • Making arithmetic or sign errors when multiplying A⁻¹ by b.

11. Final recap

  • A matrix is an arrangement of elements in rows and columns; its order is rows × columns.
  • Square matrices have equal numbers of rows and columns. Special cases include the null matrix and identity matrix.
  • Vectors are matrices with one row or one column.
  • The transpose swaps rows and columns; addition and subtraction require matching dimensions.
  • Matrix multiplication requires conformable dimensions and is generally not commutative.
  • A determinant is a scalar associated with a square matrix. For a 2 × 2 matrix, |A| = ad − bc.
  • A square matrix is invertible only when its determinant is non-zero.
  • The inverse is calculated using the transposed cofactor matrix divided by the determinant.
  • A system of linear equations can be written as Ax = b and solved using x = A⁻¹b.
  • Cramer's rule finds each unknown by replacing the corresponding column of A with b and taking a determinant ratio.
  • Matrix algebra can represent macroeconomic relationships and solve for endogenous variables such as income, consumption and taxes.

Points to check / lecture details

  • The Cramer's-rule slide contains an apparent typographical inconsistency in its final line: it states z = 2, although the determinant ratio shown for the third variable is 98/98 = 1. The matrix-inversion calculation also gives z = 1, and (x, y, z) = (2, 5, 1) satisfies all three original equations. The mathematically consistent result is therefore z = 1.