CHAPTER 9 - MATRIX ALGEBRA
1. Using Excel for matrix multiplication
Question 1: Given the two matrices:
0.8 0.3 0.1
8 43
𝐴=[ ] 𝑎𝑛𝑑 𝐵 [0.5 0.2 0.4]
4 56
0.3 0.2 0.1
Find the product matrix A*B using Excel spreadsheet.
Question 2: For each of the pairs of matrices A and B below use an Excel spreadsheet to
find the product matrix A*B
2 10 2
4 1
3
a. 𝐴 = [ ] 𝑎𝑛𝑑 𝐵 = [ 5 5 8]
9 8
2
1.5 0 1
7 10 3 11 2.5 1 4
b. 𝐴 = [9 5 2] 𝑎𝑛𝑑 𝐵 = [ 5 5 8 0]
4 0 5 3 0 1 4
45 34 4 8
2 5 3 4 32 65
6 7 22 10
9 5 0 0 9 2 ]
c. 𝐴 = 70 3 90 5 𝑎𝑛𝑑 𝐵 = [
8 46 1 7 85 31
2 2 0 23
[−6 5 4 0 20 24 3 8
3 9]
Question 3: The demand for good G depends on a vector of four explanatory variables x.
There is a linear relationship, including a constant term, between these explanatory
variables and g (g is the amount of good G demanded). g= β*x, where β is the vector of
coefficients
𝛽 = ⌈𝛽0 𝛽1 𝛽2 𝛽3 𝛽4 ⌉ = ⌈36 −0.4 0.02 1.2 0.3⌉
Calculate the demand for good G when the vector of values of the explanatory variables
is
1
14
𝑥= 8 where the element x1 refers to the constant
82.5
[ 3.2 ]
Page 1
2. Using Excel to evaluate determinants
It is very straightforward to use the Excel function MDETERM to evaluate
determinants. Just type in the matrix that you want the determinant for and then, in
the cell where you want the value of the determinant to appear, enter
= MDETERM (cell range for matrix)
Question 1: Manually calculate the values of the determinants of following matrics and
then check your answers using Excel
2 6 2 3 8 6 2 1 1 5 2 1 0
3 8 7 −4 6 1 0 −4 3
10 5 7 25
𝐴=[ ] B= [ ] C= 0 4 7 2 1
0 2 1 5 0 −2 1 5
9 2 3 2 2
4 −3 4 9 4 3 3 2 [0 4 8 0 6]
3. Using Excel for matrix inversion
To invert a matrix using the Excel MINVERSE formula:
• Enter the matrix that you wish to invert.
• Highlight cells where inverted matrix will go (same dimension as original
matrix).
=MINVERSE (cell range of matrix to be inverted)
instead of entering actual cell references for the matrix to be inverted,
Hold down the Ctrl and Shift keys together and press ENTER. The programme
will put curved brackets { } round the formula automatically and the inverted
matrix should be calculated in the cells that you have chosen.
Question 1: Use Excel to derive the matrix inverse A-1 for
25 15
1. 𝐴 = [ ]
10 8
5 0 2
2. 𝐵 = [3 4 5]
2 1 1
4 6 2 3
10 5 7 20
3. 𝐶 = [ ]
0 2 1 5
4 −3 4 12
Page 2
4. Using Excel to solve simultaneous equations
Question 1: Solve for the unknown variable x1, x2, x3, x4, x5 and x6 given that:
Question 2: Use the matrix inverse method to find the unknowns x and y when
4𝑥 + 6𝑦 = 68
5𝑥 + 20𝑦 = 185
Question 3: Use matrix algebra to solve for x1, x2 and x3 given that
3𝑥1 + 4𝑥2 + 3𝑥3 = 60
4𝑥1 + 10𝑥2 + 2𝑥3 = 104
4𝑥1 + 2𝑥2 + 4𝑥3 = 60
Question 4: Assume that the quantity demanded of oil(Q) depends on its own
price(P), income (M), the price of the substitute fuel gas (G), the price of the
complement good cars (C), population (N) and average temperature (T ) according
to the demand function
where β1, β2, β3, β4, β5 and β6 are parameters
i denotes the observation number for Q and the explanatory variables (P, M,
G, C, N and T). Six observations of Q when P, M, G, C, N and T take on different
values are:
Observation P M G C N T Q
number
1 15 80 12.5 5 4,000 18 6.98
2 20 95 14 8 4,100 17.4 6.919
3 28 108 11 6 4,150 19.2 4.522
4 35 112 16.2 7.5 4,230 18.3 4.659
5 36 110 16 8 4,215 18.9 4.082
6 30 103 14.5 5.8 4,220 19.2 4.981
Find the values of parameters β1, β2, β3, β4, β5 and β6
Page 3