CPA Foundation LevelQuantitative Analysis
Chapters
Chapter 1

Part A: Mathematics

Functions and matrix algebra

Last updated November 20262 sectionsabout 18 min read

Key takeaways

  • A function gives each input exactly one output: a linear function graphs as a straight line with slope m and intercept c, a quadratic as a parabola whose turning point is at x = -b / 2a.
  • The discriminant b^2 - 4ac tells how many real roots a quadratic has: two if positive, one if zero, none if negative.
  • The product AB exists only when A has as many columns as B has rows, and AB is in general not equal to BA.
  • For A = [[a, b], [c, d]], det A = ad - bc and A^-1 = (1 / det A) x [[d, -b], [-c, a]]; a zero determinant means there is no inverse.
  • Matrices solve simultaneous equations (x = A^-1 b), Markov steady states (s = s x P) and input-output problems (x = (I - A)^-1 d).

Quantitative analysis is the use of mathematics and statistics to describe business situations and to choose between courses of action. This first chapter supplies the mathematical toolkit that every later chapter draws on: functions to express how one quantity depends on another, matrices to handle many equations at once, calculus to find rates of change and optimum points, and descriptive statistics to summarise a set of data in a few numbers. None of it is abstract for its own sake; every technique is introduced with the business problem it solves.

How to work through this chapter

Each section states the idea, gives the formula in a formula block with its symbols, works a full example with the arithmetic shown, and ends with a practice question. Keep a calculator to hand and redo every computation yourself: the examiner marks method as well as answer, and the only way to make the method automatic is to have done it.

Functions

What a function is

A function is a rule that assigns to each value of one variable (the independent variable, usually x) exactly one value of another (the dependent variable, y), written y equals f of x. Cost depends on output, revenue on price and quantity, an investment's value on time and the rate of return; each is a function, and writing it down lets us compute, graph, solve and optimise. The set of allowed inputs is the domain (output cannot be negative), the set of resulting outputs the range. A function may be given as an equation, a table of values or a graph, and the three are interchangeable: the graph is the picture of every (x, y) pair the equation produces.

Types of function and their graphs

Linear function

One whose graph is a straight line: y is a constant (the slope or gradient, m) times x plus a constant (the intercept, c, the value of y when x is zero). The slope is the change in y per unit change in x, so a cost function with fixed cost 400 and variable cost 20 per unit has intercept 400 and slope 20. A linear equation in one unknown is solved by isolating the unknown; two linear equations in two unknowns (simultaneous equations) are solved by elimination or substitution, or by matrices (see Matrix algebra, below), and their solution is where the two lines cross.

Quadratic function

One containing a squared term: y equals a times x squared plus b times x plus c. Its graph is a parabola, opening upward if a is positive (a minimum at the vertex) and downward if a is negative (a maximum), symmetric about the vertical line through the vertex at x equal to minus b over 2a. The roots, where y is zero, are found by factorising or by the quadratic formula below; the expression b squared minus 4ac (the discriminant) tells how many real roots there are: two if positive, one if zero, none if negative. Total revenue under a downward-sloping demand curve is quadratic, which is why it has a maximum.

Cubic function
One whose highest power is x cubed. Its graph has an S shape with up to two turning points and one point of inflexion, and up to three real roots. Total cost curves in economics are cubic: costs rise steeply at first, flatten as efficiencies are gained, then rise steeply again as capacity is strained, which produces the U-shaped average and marginal cost curves.

Exponential function

One in which the variable is in the exponent: y equals a constant times a base raised to the power x, the base most often being e (about 2.71828), the base of natural growth. Its graph rises ever more steeply (growth) or falls ever more gently toward zero (decay). Compound interest, population, sales of a new product and depreciation by the reducing-balance method are exponential, which is why a sum at 10% doubles in about seven years rather than ten.

Logarithmic function

The inverse of the exponential: the logarithm of a number to a base is the power to which the base must be raised to give the number, so if y equals b to the power x then x equals the log of y to base b. Natural logs (ln, base e) and common logs (base 10) are the two in use. Logs turn multiplication into addition and powers into multiplication, so they solve for an unknown exponent, such as the number of years for an investment to reach a target, and they linearise growth curves for regression.

Equations and inequalities

An equation states that two expressions are equal and is solved by doing the same thing to both sides until the unknown stands alone; an inequality states that one is greater or less than the other and is solved the same way, except that multiplying or dividing both sides by a negative number reverses the inequality sign. Inequalities describe constraints (production cannot exceed capacity; spending must not exceed the budget) and are the raw material of linear programming (see the chapter on it), where their graphs are half-planes and the solution region is where the half-planes overlap.

The quadratic formula

x = [-b + or - sqrt(b^2 - 4ac)] / (2a)

a, b, c
The coefficients of x squared, x and the constant in the equation a x^2 + b x + c = 0
b^2 - 4ac
The discriminant: two real roots if positive, one if zero, none if negative

A quadratic revenue function against a linear cost function

Total revenue of 100Q less 2Q squared is a parabola with its maximum at Q equal to 25; total cost of 400 plus 20Q is a straight line. Profit is the vertical gap between them, positive between the two break-even outputs of 5.86 and 34.14 units, and widest at Q equal to 20, where the slopes of the two curves are equal (see the chapter on calculus).

Worked computation: solving a linear, a simultaneous and a quadratic equation (not a decided case)

Linear. Mwangi's Bakery has fixed costs of KES 400 a day and a variable cost of KES 20 per loaf, and sells loaves at KES 60. Profit is zero where 60Q equals 400 plus 20Q, so 40Q equals 400 and the break-even output Q is 10 loaves. In general the linear break-even output is fixed cost divided by the contribution per unit (selling price less variable cost), here 400 / 40.

Simultaneous. Demand for a product is Q equal to 100 minus 2P and supply is Q equal to 4P minus 20. At equilibrium the two quantities are equal: 100 minus 2P equals 4P minus 20, so 6P equals 120, P equals 20 and Q equals 60. Check: 100 minus 40 equals 60, and 80 minus 20 equals 60.

Quadratic. With demand P equal to 100 minus 2Q, total revenue is 100Q minus 2Q squared and total cost is 400 plus 20Q, as in the figure. Break-even is where they are equal: 2Q squared minus 80Q plus 400 equals 0, or Q squared minus 40Q plus 200 equals 0. By the formula, Q equals [40 plus or minus sqrt(1,600 minus 800)] / 2 equals (40 plus or minus 28.28) / 2, so Q is 5.86 or 34.14 units. Between those outputs the bakery makes a profit; outside them a loss.

Exponential and logarithmic. KES 10,000 invested at 8% compound grows to 10,000 x 1.08^n after n years. To find when it doubles, solve 1.08^n equals 2 by taking logs: n equals ln 2 / ln 1.08 equals 0.6931 / 0.07696 equals 9.0 years. The rule of 72 (72 divided by the rate) gives 9 as a quick check.

Functions in business problems

Functions turn a business relationship into something that can be solved:

  • Cost, revenue and profit functions give break-even points and the output at which profit is greatest.
  • Demand and supply functions give the equilibrium price and quantity, and their slopes give elasticities.
  • Growth functions give the future value of an investment, the time to reach a target and the rate at which an asset depreciates.
  • A linear function fitted to past data gives a forecast (see the chapter on time series).
  • A system of inequalities gives the feasible plans among which linear programming chooses.

The method is always the same:

  1. Write the relationship as a function.
  2. Decide what is being asked (a value, a root, an intersection, a turning point).
  3. Apply the appropriate technique from this chapter.

Matrix algebra

What a matrix is

A matrix is a rectangular array of numbers arranged in rows and columns, written in square brackets and named by a capital letter; its order is the number of rows by the number of columns, so a matrix with two rows and three columns is of order 2 x 3, and the element in row i and column j is written a with subscript ij. Matrices store many numbers that belong together (the quantities of several products sold in several regions, the coefficients of several equations) and let the whole array be handled with one operation, which is what makes them the natural tool for simultaneous equations, transition probabilities and input-output tables.

Types and operations

Types of matrix
The types are:
  • A row matrix has one row and a column matrix one column (both are vectors).
  • A square matrix has as many rows as columns.
  • A diagonal matrix is square with zeros everywhere except the leading diagonal.
  • The identity matrix I is diagonal with ones on the diagonal, and multiplying by it leaves a matrix unchanged.
  • A zero (null) matrix has every element zero.
  • A symmetric matrix equals its own transpose.
  • A singular matrix is a square matrix whose determinant is zero and which therefore has no inverse.
Addition and subtraction
Defined only for matrices of the same order: add or subtract corresponding elements. Multiplying a matrix by a scalar (an ordinary number) multiplies every element by it.
Multiplication
The product AB exists only when the number of columns in A equals the number of rows in B; the element in row i and column j of the product is the sum of the products of row i of A with column j of B, element by element. The product of an m x n matrix and an n x p matrix is m x p. Matrix multiplication is not commutative: AB and BA are in general different, and one may exist when the other does not.
Transposition
The transpose of A, written A with a superscript T, is obtained by writing the rows as columns, so an m x n matrix becomes n x m; the transpose of a product is the product of the transposes in reverse order.

Determinant

A single number computed from a square matrix. For a 2 x 2 matrix it is the product of the leading diagonal less the product of the other diagonal; for a 3 x 3 matrix it is found by expanding along any row: each element times the determinant of the 2 x 2 matrix left when its row and column are deleted (its minor), with alternating signs (plus, minus, plus across the first row), the signed minor being the cofactor. A zero determinant means the rows are not independent and the matrix cannot be inverted.

Inversion

The inverse of a square matrix A, written A to the power minus one, is the matrix that multiplies A to give the identity. For a 2 x 2 matrix, swap the leading-diagonal elements, change the signs of the other two, and divide by the determinant. For a 3 x 3 matrix, form the matrix of cofactors, transpose it (the adjugate or adjoint), and divide by the determinant. The inverse exists only if the determinant is not zero, and it is what solves a system of equations.

Determinant and inverse of a 2 x 2 matrix

For A = [[a, b], [c, d]]: det A = ad - bc; A^-1 = (1 / det A) x [[d, -b], [-c, a]]

a, b, c, d
The elements of A, read row by row
det A
The determinant; if it is zero the matrix is singular and has no inverse

Inverse of a 3 x 3 matrix

A^-1 = (1 / det A) x adj A, where adj A is the transpose of the matrix of cofactors and det A = a11 C11 + a12 C12 + a13 C13

Cij
The cofactor of element aij: (-1)^(i + j) times the determinant of the 2 x 2 minor left when row i and column j are deleted
adj A
The adjugate: the cofactor matrix transposed

Worked computation: the operations on small matrices (not a decided case)

Let A be [[2, 1], [3, 4]] and B be [[1, 0], [2, 5]]. A plus B is [[3, 1], [5, 9]]. 3A is [[6, 3], [9, 12]]. AB: row 1 of A with column 1 of B gives 2 x 1 + 1 x 2 = 4; row 1 with column 2 gives 2 x 0 + 1 x 5 = 5; row 2 with column 1 gives 3 x 1 + 4 x 2 = 11; row 2 with column 2 gives 0 + 20 = 20; so AB is [[4, 5], [11, 20]]. BA is [[2, 1], [19, 22]], which is different. The transpose of A is [[2, 3], [1, 4]].

Determinant and inverse of A: det A = 2 x 4 - 1 x 3 = 5, so A inverse is (1/5) x [[4, -1], [-3, 2]] = [[0.8, -0.2], [-0.6, 0.4]]. Check: A times A inverse gives [[2 x 0.8 - 0.6, -0.4 + 0.4], [2.4 - 2.4, -0.6 + 1.6]] = [[1, 0], [0, 1]].

A 3 x 3 inverse. Let M be [[1, 2, 3], [0, 1, 4], [5, 6, 0]]. Expanding along row 1: det M = 1 x (1 x 0 - 4 x 6) - 2 x (0 x 0 - 4 x 5) + 3 x (0 x 6 - 1 x 5) = -24 + 40 - 15 = 1. The cofactors are C11 = -24, C12 = 20, C13 = -5, C21 = 18, C22 = -15, C23 = 4, C31 = 5, C32 = -4, C33 = 1. Transposing gives the adjugate [[-24, 18, 5], [20, -15, -4], [-5, 4, 1]], and since the determinant is 1 that is the inverse. Check row 1 of M against the columns: 1(-24) + 2(20) + 3(-5) = 1; 1(18) + 2(-15) + 3(4) = 0; 1(5) + 2(-4) + 3(1) = 0.

Applications of matrices

Solving simultaneous equations
A system of linear equations is written as A x equals b, where A holds the coefficients, x the unknowns and b the constants; then x equals A inverse times b. This is how a computer solves the normal equations of regression and the constraints of a linear programme.
Statistical modelling
The least-squares estimates of a regression with several explanatory variables are given by a matrix formula, the inverse of X transpose X, times X transpose y, where X is the matrix of observations on the explanatory variables and y the vector of observations on the dependent variable; the multiple regression in the chapter on regression is computed this way.

Markov analysis

A process that moves between states with probabilities that depend only on the current state is a Markov chain. Its transition matrix P has a row for each current state and a column for each next state, each row summing to one; the state vector after one period is the current state vector times P, and the steady state is the vector s for which s equals s times P. Brand switching, customer retention, the ageing of receivables (current, overdue, bad) and machine breakdown are modelled this way.

Input-output analysis

In an economy or a group of divisions each sector uses the outputs of the others as inputs. The technology matrix A gives, per shilling of each sector's output, the input required from every sector; if x is the vector of total outputs and d the vector of final demand, then x equals A x plus d, so x equals (I minus A) inverse times d. Leontief's model finds the output each sector must produce to meet a given final demand, and the change in outputs when demand changes.

General applications
Recording quantities by product and region and multiplying by a price vector to get revenues by region; multiplying a bill-of-materials matrix by a production plan to get raw material requirements; and, in linear programming, holding the coefficients of a linear programme for the simplex method.

Worked computation: equations, brand switching and two sectors (not a decided case)

Equations. Solve 2x + 3y = 12 and x + 2y = 7. In matrix form A x = b with A = [[2, 3], [1, 2]] and b = [12, 7]. det A = 4 - 3 = 1, so A inverse is [[2, -3], [-1, 2]], and x = A inverse times b = [2 x 12 - 3 x 7, -12 + 2 x 7] = [3, 2]. Check: 6 + 6 = 12 and 3 + 4 = 7.

Markov. Each month 80% of Mwangi's Bakery customers stay and 20% switch to a rival, while 30% of the rival's customers switch to the bakery and 70% stay, so the transition matrix P is [[0.8, 0.2], [0.3, 0.7]]. If the market starts split 50:50, next month the bakery has 0.5 x 0.8 + 0.5 x 0.3 = 0.55 and the rival 0.45; the month after, 0.55 x 0.8 + 0.45 x 0.3 = 0.575 and 0.425. The steady state solves a = 0.8a + 0.3b with a + b = 1: 0.2a = 0.3b, so a = 0.3 / 0.5 = 0.60 and b = 0.40. Whatever the starting split, the bakery's share settles at 60%.

Input-output. Two sectors, agriculture and manufacturing, have technology matrix A = [[0.2, 0.3], [0.4, 0.1]] (each shilling of agricultural output needs 0.2 of agricultural and 0.4 of manufactured input; each shilling of manufacturing needs 0.3 and 0.1). Final demand is d = [100, 200]. I minus A is [[0.8, -0.3], [-0.4, 0.9]], with determinant 0.72 - 0.12 = 0.60, so its inverse is (1 / 0.6) x [[0.9, 0.3], [0.4, 0.8]] = [[1.5, 0.5], [0.667, 1.333]]. Total output x = [1.5 x 100 + 0.5 x 200, 0.667 x 100 + 1.333 x 200] = [250, 333.3]. Check agriculture: 0.2 x 250 + 0.3 x 333.3 + 100 = 50 + 100 + 100 = 250.

Test Your Knowledge

3 questions on this chapter
Question 1 of 3Solve 5x + 2y = 16 and 3x + 2y = 12 using the inverse of the coefficient matrix A = [[5, 2], [3, 2]].
Pick an option first
Question 2 of 3Matrix A is of order 2 x 3 and matrix B is of order 3 x 4. Which statement is correct?
Pick an option first
Question 3 of 3Each month 70% of a shop's customers stay and 30% switch to a rival, while 20% of the rival's customers switch to the shop and 80% stay. What is the shop's steady-state market share?
Pick an option first