Business Mathematics
Computer tutorial 3
1 Introduction
In this tutorial session, we will mainly continue to work on using Microsoft Excel for quantitative
modelling. The part with Microsoft’s equation editor is over, we hope you enjoyed it and learned a lot.
As a final exercise, here are some formulas to practice your skills. Notice that the second digital exam
usually includes typesetting formulas. It is important to keep practicing once you’ve mastered this skill.
Exercise 1.
𝑑𝑓(𝑥) 𝑓(𝑥 + Δ𝑥) − 𝑓(𝑥)
≡ lim
𝑑𝑥 Δ𝑥→0 Δ𝑥
Exercise 2.
𝑏
∫ 𝑓(𝑥)𝑑𝑥 = 𝐹(𝑏) − 𝐹(𝑎)
𝑎
Exercise 3.
3 6 0
( | )
4 −2 5
Exercise 4.
𝑥𝑛 ⋅ 𝑥𝑚 = ⏟
𝑥 ⋅ 𝑥⋯𝑥 ⋅ ⏟ 𝑥 ⋅ 𝑥 ⋯ 𝑥 = 𝑥 𝑛+𝑚
𝑥 ⋅ 𝑥⋯𝑥 = ⏟
𝑛 terms 𝑚 terms 𝑛+𝑚 terms
Exercise 5.
|𝐚 ⋅ 𝐛| ≤ ‖𝐚‖ ⋅ ‖𝐛‖
Exercise 6.
∀𝜉 ∈ ℝ: 𝜉 2 ≥ 0 ⇒ (𝜉 + 1)2 ≥ 0
BUSM 1 Computer tutorial 3
2 Mathematical modelling in Excel – vectors and matrices
So far, we have often used Excel for column-oriented operations, organizing our data as in a data matrix.
However, we can also use Excel for matrix-based calculations, including the multiplication,
transposition, and inversion of matrices.
1 2
Of course, we can use Excel to type a matrix. Here, we typed (3 4):
5 6
But the real action is, of course, using matrix algebra. Start easy: referring to the previous matrix as 𝐀,
can we calculate 5𝐀?
And what about 𝑐𝐀, where 𝑐 is a number in Excel, say in cell A1?
There is, however, a special way of typing a matrix equation.
Step 1: first demarcate the area where the new matrix is supposed to be placed:
BUSM 2 Computer tutorial 3
Step 2: type the formula, with the full range of cells. Here: “=5*B2:C4” or “=A1*B2:C4”:
Step 3: press [ctrl][shift][enter]:
That’s all. You will see that the correct numbers show up. The big advantage of this approach is that
the new matrix is – so to speak – protected. You cannot change the formula of an individual cell of the
new matrix.
Another big advantage is that the less straightforward matrix functions (multiplication, transposition,
inversion) have been implemented in Excel as well. We will show how to transpose a matrix. We want
1 2
to have the transpose of the matrix (3 4), which is in the range B2:C4. Of course, we could enter in
5 6
E2 “=B2”, but how to get in F2 “=B3”? There is no dollar-trick for this. There is an option to paste a
matrix transposed in the menu command Paste Special, but it will give a “hard copy”: the transposed
result will not change if you change the original matrix. The function “=TRANSPOSE(B2:C4)” will do
BUSM 3 Computer tutorial 3
the trick, provided we use the same precautions as before: copy to the full range, and use
[ctrl][shift][enter].
A final useful matrix function is the one to create the identity matrix. Recall that we have
1 0 0
𝐈3 = (0 1 0)
0 0 1
and similar expressions for other identity matrices. Typing an identity matrix of size 25 or 1000 is
however a lot of tedious work. Fortunately, the function “=MUNIT(3)” will create it with a few
keystrokes
1 2 3
Exercise 1. Type in B2:D3 the matrix 𝐀 = ( ), and make the transpose 𝐀′ in the range F2:G4.
4 5 6
Exercise 2. Use the function MMULT to multiply the original matrix and the transposed matrix (𝐀𝐀′ ).
Exercise 3. Use the function MINVERSE to find the inverse of this matrix ((𝐀𝐀′ )−1 ).
Exercise 4. Try also switching the role of the two matrices in exercise 2 and 3, so multiply F2:G4 with
B2:D3, find the transpose, and calculate its inverse ((𝐀′ 𝐀)−1 ). This should give an error message. Any
clue why?
Exercise 5. Change in the original matrix one cell value, and watch that the numbers in the other matrices
are updated.
Exercise 6. Can you also find the inverse of 𝐀𝐀′ without intermediate results, in one long formula?
1 2 3
Exercise 7. Type in B2:D4 the matrix 𝐀 = (4 5 6), and create a function such that 𝐁 = 7𝐈 − 𝐀 is
7 8 9
in F2:H4.
Answers and hints:
Exercise 7. Select F2:H4, type “=7*MUNIT(3)-B2:D4”, and press [ctrl][shift][enter].
[ctrl][shift][enter]. This should give the same answer as in Exercise 3.
Exercise 6. Select L5:M6, type “=MINVERSE(MMULT(B2:D3;TRANSPOSE(B2:D3)))” , and press
The matrix 𝐀′ 𝐀, although square, is not invertible.
[ctrl][shift][enter]. This should give a matrix of order (3 × 3) containing error messages (#NUM!). ,
27 36 45
give a matrix 𝐀′ 𝐀 = (22 29 36). Select U2:W4, type “=MINVERSE(O2:Q4)”, and press
17 22 27
Exercise 4. Select O2:Q4, type “=MMULT(F2:G4;B2:D3)”, and press [ctrl][shift][enter]. This should
−0.59 ⋯ 0.25 ⋯
( ).
1.42 … −0.59 ⋯
Exercise 3. Select L2:M3, type “=MINVERSE(I2:J3)”, and press [ctrl][shift][enter]. This should give
32 77
give ( ).
14 32
Exercise 2. Select I2:J3, type “=MMULT(B2:D3;F2:G4)”, and press [ctrl][shift][enter]. This should
Exercise 1. Select F2:G4, type “=TRANSPOSE(B2:D3)”, and press [ctrl][shift][enter].
To facilitate working with matrices, we may name the cells, also for matrices. So we can put B2:C4 in
a block and type “A” in the name box. The formula “=TRANSPOSE(B2:C4)” is not changed, but you
could have typed “=TRANSPOSE(A)”.
An important area of application of matrices is solving a system of linear equations. When, for scalars,
𝑏
we have 𝑎𝑥 = 𝑏, we may find 𝑥 by calculating 𝑎 (provided 𝑎 ≠ 0). Of course, Excel can do that easily
𝑎𝑥 + 𝑏𝑦 = 𝑐
through “=B/A”. In the case of a system of two equations, we have { , and solving it is
𝑑𝑥 + 𝑒𝑦 = 𝑓
𝑎 𝑏 𝑐
more difficult. Using matrix algebra helps a lot: by creating the matrix 𝐀 = ( ), 𝐛 = (𝑓 ), and 𝐱 =
𝑑 𝑒
BUSM 4 Computer tutorial 3
𝑥
(𝑦), we can write the system of equations as 𝐀𝐱 = 𝐛, and solve it through 𝐱 = 𝐀−1 𝐛 (provided 𝐀 is
5𝑥 − 3𝑦 = 11
invertible). Let’s do this in Excel, and try to solve { .
−3𝑥 − 2𝑦 = −18
5 −3
Step 1: Create in Excel a matrix with the coefficients ( ) and a vector with the coefficients
−3 −2
11
( ):
−18
Step 2: Assign the name “A” to B2:C3 and “b” to E2:E3.
Step 3: Create a matrix “Ainv” (here in G2:H3) by means of “=MINVERSE(A)”
Step 4: multiply “Ainv” and “b” into “x” (here J2:J3):
4
So, we have found that 𝐱 = ( ), or phrased in original variables, that 𝑥 = 4 and 𝑦 = 3.
3
2𝑥 − 𝑧 = 7
Exercise 8. Use Excel to solve the system of equations { −𝑦 + 5𝑧 = 11 .
3𝑥 − 𝑦 + 4𝑧 = 23
3𝑥 − 4𝑦 − 4 = 0
Exercise 9. Use Excel to solve the system of equations { .
−2𝑥 + 2𝑦 + 6 = 0
2𝑥 − 4𝑦 = 3
Exercise 10. Use Excel to solve the system of equations { .
−6𝑥 + 12𝑦 = −6
Answers and hints:
𝑥 and 𝑦 will reconcile the contradiction.
first one, multiplied by −3, gives −6𝑥 + 12𝑦 = −9, which contradicts −6𝑥 + 12𝑦 = −6. No value of
Exercise 10. No solution. Observe that the first equation and the second equation are incompatible. The
Exercise 9. 𝑥 = 8, 𝑦 = 5.
Exercise 8. , so 𝑥 = 5, 𝑦 = 4, 𝑧 = 3.
BUSM 5 Computer tutorial 3
3 Mathematical modelling in Excel – using the Solver
Excel has an add-in that is known as the Solver. Perhaps it must be turned on first, using the Options -
Add-Ins.
The task of the Solver is ... to solve.
Let us take an example, solve for 𝑥: ln 𝑥 + √𝑥 = 10. This is not so easy by using algebra. But the Solver
can find an approximate answer.
We start a new worksheet to prepare the problem. Type just a trial value for 𝑥 in cell A1. With a trial
value, we mean a value that does not give an error (such as 𝑥 = −1), but that is most likely not the
correct answer. Let’s take 𝑥 = 2, although we might also choose 𝑥 = 20 or 𝑥 = 200. Now, type the
formula for ln 𝑥 + √𝑥 in cell B1. This is done through “=LN(A1)+SQRT(A1)”. The value in B1 will
be evaluated, it is something like “2.107”, certainly not 10, as required. So, indeed our trial value is
wrong and should be modified.
The Solver actually will use a clever way to quickly try other trial values repeatedly, until it finds a
value of 𝑥 that will generate a value of 𝑦 that is very close to 10. This is then the approximate solution
to the problem.
Start the Solver. You can find it in the menu on the tab Data - Analysis. Click Solver, and the Solver
interface will appear. There are several fields of interest:
• “Set Objective” – here we define which cell value we want to contain a certain value (here: 𝑦,
so B1);
• “To/Value Of” – here we can type which value the cell should have (here: 10);
BUSM 6 Computer tutorial 3
• “By Changing Variable Cells” – here we define which cell value is to be modified (here: 𝑥, so
A1);
• “Make Unconstrained Variables Non-Negative” – please turn this off.
Now we click “Solve”, after 1 second or so, the Solver will give a message. In this case, it is a positive
message: the Solver managed to find a solution:
Click OK, and you will return to the worksheet:
BUSM 7 Computer tutorial 3
Notice that the value in B2 has changed to 10. This means that the Solver has changed the value of A1
in such a way that B2 yields 10. So indeed, the 𝑥-value in A1 satisfies ln 𝑥 + √𝑥 = 10. Apparently, the
solution to this equation is 39.87103. Now, you will understand why this add-in is called the Solver!
4 Mathematical modelling in Excel – multiple, no, or incorrect solutions
Consider the equation 𝑥 2 − 5𝑥 + 6 = 0. Elementary algebra tells us that we may complete the squares
and rewrite as (𝑥 − 2)(𝑥 − 3) = 0, which gives 𝑥 = 2 and 𝑥 = 3. Two solutions! What will the Solver
do?
Exercise 11. Use the Excel Solver to solve 𝑥 2 − 5𝑥 + 6 = 0. Take a start value of 𝑥 = 1.
Exercise 12. Use the Excel Solver to solve 𝑥 2 − 5𝑥 + 6 = 0. Take a start value of 𝑥 = 4.
Answers and hints:
Exercise 12. Now the solver will find 𝑥 ≈ 3.
−5.9 ⋅ 10−7 ).
Exercise 11. The solver will find 𝑥 ≈ 2; the cell with objective will show a number close to 0 (such as
Clearly, the Solver finds a solution, not all solutions. Which solution it finds depends, among others,
on with which initial trial solution you start. This is an important limitation to keep in mind.
Exercise 13. Use the Excel Solver to solve 𝑥 2 − 6 = 0.
Exercise 14. Use the Excel Solver to solve 𝑥 2 + 6 = 0.
Answers and hints:
Exercise 14. No solution found.
Exercise 13. Use various starting points. They will give 𝑥 ≈ −2.45 and 𝑥 ≈ 2.45.
The quadratic equation 𝑥 2 + 6 = 0 has no solution, as can be seen by inspecting the discriminant: −24.
The Solver informs you about this:
Finally, do the next exercise:
1
Exercise 15. Use the Excel Solver to solve 𝑥 2 = 0.
BUSM 8 Computer tutorial 3
Now, the Solver will just find a “solution”, for instance 𝑥 = 3278.8, with an associated function value
of 9.3 ⋅ 10−8. Somehow, the Solver considers the function value 9.3 ⋅ 10−8 close enough to 0, and
1
decides to stop, although the equation 2 = 0 obviously had no solution.
𝑥
5 Final remarks on the Solver
So, what is the take-home message? The Solver can, in many cases, find a quite good approximation to
the solution of an equation. However, it may give a misleading answer in some cases, especially when
there is more than one answer or when there is no answer. Use of the Solver is therefore risky and
should always be accompanied with a closer analysis. Examples of such analyses include:
• insert the solution in the equation to see if it indeed solves the equation;
• use different initial values to start with;
• once the Solver says a solution has been found, restart the Solver with the found solution as
initial value, and see if the new solution differs from the previous one;
• use algebra as a complement;
• make a graph as a complement.
Now, finalize this part with these two exercises:
Exercise 16. Use the Excel Solver to solve 3𝑥 2 = 𝑒 𝑥 . Is this a good solution? How many solutions
would you expect?
𝑒𝑥
Exercise 17. Use the Excel Solver to solve 𝑥−3 = 0. Is this a good solution? How many solutions would
you expect?
Answers and hints:
−12.8 or so. All such solutions are clearly wrong. This equation has no solution.
converge to 𝑥 = 3, others will give an error message. There are also solutions that will converge to 𝑥 ≈
that there is only one solution, around 𝑥 = 3, but it looks a bit suspicious. Some initial values will
Exercise 17. Here a quick plot of the left-hand side is . It appears
3.733, as before.
Solve again, using 𝑥 = 80, and again, and again, and, in the end, we find a satisfactory answer 𝑥 ≈
𝑥 = 100. This gives 𝑥 = 80, but observe that 3 ⋅ 802 ≠ 𝑒 3! Apparently, the solver algorithm fails.
𝑥 = 1 to 𝑥 ≈ 0.910, and the value 𝑥 = 5 to 𝑥 ≈ 3.733. Let’s be safe and try a big initial solution, say
This suggests that there are three solutions. The start value 𝑥 = 0 converges to 𝑥 ≈ −0.459, the value
Exercise 16. A quick plot of the two sides of the equation is here: .
BUSM 9 Computer tutorial 3