0% found this document useful (0 votes)
16 views

computertutorial_2

Uploaded by

sunčica
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

computertutorial_2

Uploaded by

sunčica
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Business Mathematics

Computer tutorial 2
1 Introduction

In this tutorial session, we will continue to work on two topics:


• typesetting mathematical expressions (formulas) using Microsoft Word;
• using Microsoft Excel for quantitative modelling.

The way of working is the same as last week. Please review it in case you forgot.

2 Equations in Microsoft Word – advanced features

Today, we will be addressing a number of new features. We start by adding “ornaments” to symbols.
The mostly used ornament is the apostrophe, to which mathematicians refer as a prime, as in 𝑦 ′ . This
is simply done by typing a superscript apostrophe to the symbol 𝑦.

Slightly more involved are ornaments on top of letters, as in 𝑥̅ or 𝑦̂. Here, we use the Accent option
from the equation toolbar. It contains many types: the dot (𝑥̇ ), the arrow (𝑥⃗), the bar (𝑥̅ ), the tilde (𝑥̃),
the hat (𝑥̂), etc. There is also the option to stack symbols, as in
𝑎𝑛 = ⏟𝑎 ×𝑎 × ⋯× 𝑎
𝑛 terms
Finally, it also contains the box that can contain an equation:
𝐸 = 𝑚𝑐 2
Of course you must take care whether or not to include subscripts or superscripts in such ornaments.
Compare ̅̅̅𝑎𝑛 and 𝑎̅𝑛 . Also compare ̅̅̅̅̅̅̅
𝑥 + 𝑦 and 𝑥̅ + 𝑦̅.

1 1 1
For parentheses the differences are more important. For instance, consider (2 𝑥 2 − 2) versus (2 𝑥 2 −
1
2
).
Especially when parentheses at different levels co-exist, the size can help to make the distinction.
Consider, for instance,
2
2
(𝑥 + 𝑦)
((𝑥 − 𝑦) + )
𝑥
The Bracket menu offers also other types of parenthesis (like [these] and {these}), as well as some
other symbols.

The equation editor can also be used for typing vectors, matrices, and equations that include several
𝑥 if 𝑥 > 0
3 𝑎 𝑏
lines. Examples are ( ), [ ], and |𝑥| = { 0 if 𝑥 = 0. Mind that it may be needed to arrange
−4 𝑐 𝑑
−𝑥 if 𝑥 < 0
12345 12345
the contents with respect to alignment: compare ( ) and ( ). The right button of the mouse
6 6
helps you to arrange this. Finally, in some cases we need matrices with lines separating the columns
𝑎 𝑏𝑒
( | ). You may achieve this by selecting brackets with separators.
𝑐 𝑑𝑓

Long equations may span several lines. For instance, the equation 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 +
9 + 10 = 55 spans two lines. Line breaks go automatically, but you may wish to control them. In a
long derivation in display style, for instance, you may write
(𝑎 + 𝑏)2 =
(𝑎 + 𝑏)(𝑎 + 𝑏) =
𝑎(𝑎 + 𝑏) + 𝑏(𝑎 + 𝑏) =
𝑎2 + 𝑎𝑏 + 𝑏𝑎 + 𝑏 2 =
𝑎2 + 2𝑎𝑏 + 𝑏 2

BUSM 1 Computer tutorial 2


Do some experiments with writing such long formulas and how to outline them in different ways.

Now, practice typing the following formulas:


𝑑𝑦 𝑑 1 1
Exercise 1: 𝑦 ′ ≡ 𝑑𝑥 = 𝑑𝑥 (𝑥 + 𝑥) = 1 − 𝑥 2
1
Exercise 2: 𝜇̂ = 𝑥̅ = 𝑛 ∑𝑛𝑖=1 𝑥𝑖
𝑎11 𝑎12
Exercise 3: det 𝐀 = det (𝑎 𝑎22 ) = 𝑎11 𝑎22 − 𝑎21 𝑎12
21
1 undefined if 𝑥 = 0
Exercise 4: 1 = {
( )
𝑥
𝑥 otherwise

⏟ln 𝑥 ) = 𝑥⏟′ ln 𝑥 + 𝑥(ln


Exercise 5: (𝑥 ⏟ 𝑥)′ = ln 𝑥 + 1
𝑓𝑔 𝑓′ 𝑔 𝑓𝑔′

Answers and hints:


meaning.
everything. Notation in mathematics is critical, and a small mistake can give an expression a different
In all exercises, look very critically at your result, and check the typeface (normal, italic, bold) of

3 Equations in Microsoft Word – speeding up and using the keyboard

Finally, you may speed up typing equations and omit using the mouse by using programming code. For
instance, when you type “x^2” the equation may convert this automatically into 𝑥 2 . Similar for “\alpha”
1
which gives 𝛼. And “1/2” gives 2. In some cases, you first need to add a space (or = or so) before this
automatic conversion works. And you may have to turn some options (autocorrect?) on.

Which shortcuts to use? Move with the mouse over the symbol, and you’ll see it for next time:

So, to type 𝜕 you need not navigate to the appropriate menu item, but you can just type “\partial”. You
can also go to Math Autocorrect, and you’ll find the full list:

BUSM 2 Computer tutorial 2


A final note. It may be hard sometimes to place your mouse cursor at the right spot, or to use it to select
some misplace text.

An easy solution is to place it approximately at the right place, and then use the arrow keys to fine-tune
the position of the cursor inside a formula. Further, use [shift]-arrow (e.g., [shift][left]) to select a
fragment, for copying, deleting, or moving.

BUSM 3 Computer tutorial 2


4 Mathematical modelling in Excel – graphs

Today, we’ll explore how to make graphs in Excel. We restrict the discussion to graphs in a numerical
context, which includes two types of graphs:
• function graphs;
• data graphs.
Function graphs are the well-known graphs in a book on mathematics: straight lines, parabolas, the
exponential function, etc. Data graphs present the information from empirical data, for instance a
histogram of the results of an exam, or a piechart of which share of the population uses a car for
commuting and which share travels by train.

5 Mathematical modelling in Excel – data graphs

To make a data graph, we must have a worksheet filled with data. We fill a worksheet with our data:

Now click Insert - Charts - Column and two things happen: an empty graph area is added to the
worksheet, and a new toolbar (Chart Tools, containing two options: Design and Format) is added to the
menu.

We must now tell Excel which data we would like to display. Click Select Data.

BUSM 4 Computer tutorial 2


Now, there is an easy way and a difficult way. We’ll take the difficult way, because the easy way doesn’t
always work well.

Click Add in the left pane (Legend Entries (Series)).

A series is a column of a data matrix that we wish to display. Here the series is in the range from B2
until B11, so we insert that range as Series Values. We can do so by typing the range, or – and that is a
clever way – by clicking into the first cell (B2) and then using ctrl-arrow or even ctrl-shift-arrow to
move to B11, thus selecting the entire range. However you do it, the result is as follows:

Note that Excel adds “Sheet2!” in front of the range, to indicate that we take the range from that specific
worksheet. In our case its name is Sheet2, but it might also be called Sheet1, Students2018, or any other
name.

In addition, we may wish to give the series a name. Because the data represent the grades for maths, not
for stats, a natural name is “maths”. We may indeed type in that name, but we may also refer to the
content of cell B1, so that updating this content into, for instance, “mathematics” will be reflected
automatically.

Now click OK, and another OK, and you will find your first bar graph!

BUSM 5 Computer tutorial 2


Now, can we also add the grades for stats? Yes, by again clicking Select Data, and adding a second
series:

Basically, we’re done. You have a bar chart with the two sets of values. But one thing is still wrong:
the labels at the horizontal axis. Now they are “1” to “10”, but we would like to change this into “0-1”
to “9-10”. Go back to Select Data, but now click Edit in the right pane (Horizontal (Category) Axis
Labels), and add a reference to the data in column A.

Click OK, and the graph is now ready:

Exercise 1: Type in the data above, and reproduce the graph with the histograms for maths and stats.

Answers and hints:

BUSM 6 Computer tutorial 2


to recognize data input, and apparently Excel mistakes “2-3” for a date.
Format Cells in advance to column A, and use the format “Text” to these cells. By default, Excel tries
quote: ’) before the text. Thus type “'2-3” instead of “2-3”. Another option is to apply the command
to “1-feb”, “3-apr” or similar date indications. One way to prevent this is by typing an apostrophe (single
Exercise 1: In typing the grades as ranges (e.g., “1-2”, “2-3”) it is quite probable that Excel will convert

6 Mathematical modelling in Excel – fine-tuning graphs

Next you might wish to fine-tune the graph. The toolbar with Chart Tools provides many options for
doing so. Many of these options can also be accessed by right-clicking in a specific part of the graph.
Options include:
• choosing colors and/or patterns of the bars;
• changing how the axes are shown;
• setting gridlines and/or tickmarks;
• changing or moving the legend and/or title.
We will discuss one such option: changing the numbers at the vertical axis. First go to these options.
An extra menu will become visible:

In particular note the Axis Options and Text Options” as well as the four symbols below them. These
symbols code for Fill & Line, Effects, Size & Properties and Axis options. Let’s first explore this last
one. We want to have the axis not run from 0 to 50, but from 0 to 75. Use the Bounds - Maximum for
this. You may see that the minimum also changes, so fix it to 0. Try the effect of changing the “Units”
to 25. Move down to “Tickmarks”, and select the Major type Outside. Now go to Fill & Line. The Line
Color is a bit greyish, and I prefer black.

This will darken the colors of the axis and the tickmarks, but not of the numbers besides the axis. To
change that, go to Text Options, and select Text Fill & Outline, and next the Text Fill Color. Let’s also
add an axis text: “number of students”. In the Chart Tools, select Add Chart Element and choose Axis
Titles - Primary Vertical. Now a default “Axis Title” appears. You can click it and change it into
“Number of students”. Let’s also turn it 90 degrees, using Size & Properties - Text Direction. The text
is again not pure black, so let’s change that as well, using the Text Options. The bar colors are blue and

BUSM 7 Computer tutorial 2


orange, not really nice for the colorblind. Let’s change it into shadings. Select one of the blue bars,
change the Fill Color into black, and select a diagonal Pattern. Do a similar thing with the blue bars.
Finally, we want to add legend, at the top. Again, change grey into black. The overall result is as follows:

Below is an example where many such changes have been introduced. Try to reconstruct the graph
below!

Exercise 2: Try to reproduce the graph above as exactly as possible.

Answers and hints:


You should be able to discover such small issues and implement them.
• colors of almost all lines, texts and numbers.
• axis titles;
• number of vertical tickmarks;
• orientation of the horizontal numbers;
• caption on top of the figure;
• vertical scale;
• shape of the horizontal gridlines;
• patterns and colors of the bars;
Exercise 2: Look carefully, we changed many features! We changed:

Finally, when our graph is ready, we of course wish to copy it to the Word document which describes
the entire research. This is less straightforward than you might think. You can just use the copy icon or
keyboard shortcut ([ctrl]c) when you have selected the graph, switch to Word, and use the paste icon or
keyboard shortcut ([ctrl]v). It works, but this is very dangerous! Change one number in your Excel file,
and you will see that the graph in Excel will automatically update. That is a good thing. But now watch
what has happened in your Word file: the copied graph has also updated! In other words, the copy to
Word is a “soft” copy. With a soft graph, you risk that your beautifully composed graph suddenly

BUSM 8 Computer tutorial 2


disappears if you close Excel without saving (after all, you don’t need to hand in the Excel file at the
test). To prevent this, use in Word not Paste, but Paste Special.

It will bring an extra form that allows you to control the way of copying: as a hard copy (Picture or
Bitmap), or as a soft copy.

Exercise 3: Copy the graph from Excel to Word, and explore which copy types are “safe”.

Answers and hints:


graph). A Microsoft Office Graphic Object is not safe.
is also safe, and it moreover allows you to change the design after copying (double-clicking the copied
Exercise 3: Bitmap and Picture are all safe, and moreover not editable. A Microsoft Excel Chart Object

7 Mathematical modelling in Excel – more types of graphs

Besides the bar chart, Excel offers many other types of graphs. We mention those that will be part of
our course:
• line charts;
• dot charts;
• pie charts.
Notice that Excel in some cases uses different terms, and on top offers additional graph types. See our
catalogue below:

The basic principles of making such graphs are the same as those for bar charts discussed above.

BUSM 9 Computer tutorial 2


Exercise 4: Using the previous data, reproduce as precisely as possible the graph below, and copy it in
a “safe” way to a Word document. Check if it is safe by changing the source data.
maths stats

50

40
Number of students

30

20

10

0
0-1 1-2 2-3 3-4 4-5 5-6 6-7 7-8 8-9 9-10
Grade

Answers and hints:


,
and axis.
Exercise 4: Change the graph type in a line chart, and further tweak with the settings, like colour, style

8 Mathematical modelling in Excel – function graphs

Sometimes, we want to explore the shape of a mathematical function. For example, how does the graph
of 𝑓(𝑥) = √𝑒 𝑥 look like? Excel provides an excellent way to make a quick-and-dirty plot. We define a
column (e.g., A) that contains the numbers −10.0, −9.9, −9.8, etc. until 9.9 and 10.0. Next we define
another column (e.g., B) that contains the formula “=SQRT(EXP(A1))”, copied dozens of times to
below. Next, a simple scatterplot (with dots and/or lines) will show a graph:

Of course, we may further refine the graph, e.g., into

BUSM 10 Computer tutorial 2


Computer tutorial 2 11 BUSM
Exercise 5: At 𝑥 = 0, so in row 101, you will see in column B the value “#NUM!”, because the function
value is not defined for 𝑥 = 0. Excel will interpret this in the graph as 0, which is obviously wrong (left
panel). You might try adding one more column (with “=IFERROR(B1;"")”): this replaces all undefined
values with an empty slot. When you do a formula such as “AVERAGE(B:B)” in a column with an
error message, the function will fail, but a column with missing numbers will just work. However, and
this is a very grave thing in Excel, in making a plot, Excel will interpret an error (“#NUM!”) as well as
a missing value (“”) as a zero! The only (?) way to force a gap is by completely deleting the contents of
the cell (right panel).
Choose the graph type Scatter, because that is the only one that allows you to use numerical values for
both horizontal and vertical axis.
Answers and hints:
Δ𝑥 = 0.1. Take particular care about what happens in the middle of the series.
Exercise 5: Make a function plot of the function 𝑓(𝑥) = ln 𝑥 2 from 𝑥 ∈ [−10,10]; use steps of size
• by typing −10 in cell A1 and using the menu option Fill - Series:
mouse cursor on the right bottom corner of cell A2, and dragging down;
• by typing −10 in cell A1, typing −9.9 in cell A2, making a block of the two cells, placing the
• by typing −10 in cell A1, typing “=A1+0.1” in cell A2, and copying this cell down;
ways:
dull and time-consuming activity. Fortunately, there are ways to speed this up. You can do in various
This sounds great, but there is one issue: we need to type 201 numbers, from −10.0 to 10.0. That is a
9 Mathematical modelling in Excel – function graphs for functions of two variables

Functions of two variables play an important role in the course. They can be put in graphical form using
𝑧 = 𝑓(𝑥, 𝑦). The coordinates for 𝑥 and 𝑦 then define a plane, and the 𝑧-coordinate the “height”. For
example, consider the function 𝑓(𝑥, 𝑦) = 𝑒 𝑥 √𝑦, on a domain [−1,1] × [0,1]. First we make a
spreadsheet with a range of values for 𝑥 and 𝑦:

Now, we fill the blank area by the function values:

Of course, we do this by typing the formula once, and then copying. You need to work in a clever way
with the $-sign to do this. Finally, use Insert Chart - Surface. Unfortunately, Excel requires you to do
this while selecting the data. In the end, tweaking a bit with the axes, we get a nice result:

Instead of a projected 3D plot, we may also make a level curve (contour plot).

Exercise 6: Reproduce the two function plots above, representing 𝑓(𝑥, 𝑦) = 𝑒 𝑥 √𝑦.

BUSM 12 Computer tutorial 2


Answers and hints:
is clear by now.
B2:L12. We will not further discuss all features of making professional 3D-plots, but we hope the idea
Exercise 6: In cell B2, type the formula “=EXP($A2)*SQRT(B$1)”, and copy this in the entire block

10 Organizing your spreadsheet

If you make a quick-and-dirty spreadsheet, it can be dirty indeed. But there are many situations in which
you need to more carefully:
• if you need to share it with other persons;
• if you work on it for several weeks (e.g., for your bachelor thesis);
• if it becomes really complex.
In such cases, it is very important to keep to certain rules. Below, we give a few examples.

A) Indicate the meaning of the numbers. If you have a cell for 𝑥, for 𝑦, and for 𝑓(𝑥, 𝑦) = √𝑥 2 + 2𝑦,
add extra cells to indicate the meaning of the cells. For instance, don’t type

but type

B) In long rows or column with a large amount of numbers of similar type, don’t include other numbers.
For instance, if you have a list of the population of all US states, don’t add a last line “average”.

Why is this a bad idea? Well, if you need the total population for some calculation, it is very tempting
to do “=SUM(B2:B52)” or “=SUM(B:B)”. This will obviously be wrong.

C) Use several tabsheets. It can be convenient to arrange different different types of information in
different tabsheet. Sheets can be given a convenient name, for instance “prices” by right-clicking the
tab and clicking “Rename”.

BUSM 13 Computer tutorial 2


References to cells in other tabsheets are easy to make, e.g. “=prices!A1*quantities!A1” multiplies the
values in cells A1 of the tabsheets “prices” and “quantities”.

At the digital exams, we sometimes ask you to not only give the answer of a calculation, but also to
provide a screenshot of the Excel set-up. In such cases, please add a clear structure and use intermediate
𝑦√𝑒 𝑥
steps. For instance, if we ask “Type in Excel the function 𝑓(𝑥, 𝑦) = 𝑥 2 +3𝑥𝑦−𝑦2, using the input 𝑥 = 2
and 𝑦 = 5 and make a screenshot of the result”, we advise the following:

BUSM 14 Computer tutorial 2

You might also like