Professional Documents
Culture Documents
2013
fx (x0
, y0 )
b
x
y
School of Economics
The University of NSW
ii
Contents
1 Introducing QABE
1.1 Introduction . . . . . . . .
1.2 Learning in QABE . . . .
1.3 Miscellany . . . . . . . . .
1.4 Functions of One Variable
1.5 What is a Function? . . .
1.6 Functions . . . . . . . . .
1.7 Special Functions . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
1
2
4
5
6
8
10
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
15
15
15
16
17
19
20
20
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
23
23
24
25
27
28
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
31
31
31
32
36
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
39
39
40
42
44
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
iii
iv
6 Matrices II: The Inverse
6.1 Introduction . . . . . .
6.2 The Inverse . . . . . .
6.3 Determinant Excursus
6.4 The Inverse Really . .
6.5 On Linear Equations .
CONTENTS
& Determinant in
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
.
.
.
.
.
47
47
47
48
51
53
& Automatic-Matrices!
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
55
55
56
58
and
. . .
. . .
. . .
. . .
. . .
. . .
Small
. . . .
. . . .
. . . .
. . . .
. . . .
Combinations
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
action
. . . . .
. . . . .
. . . . .
. . . . .
10 Markov Chains
10.1 Introduction . . . . . . . . . . . . .
10.2 The Basics . . . . . . . . . . . . .
10.3 Transitions, Regularity and States
10.4 Markov Chains in Game Theory .
.
.
.
.
.
.
.
.
.
.
Matrices
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
61
61
62
63
65
67
68
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
69
69
69
70
73
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
77
77
77
79
84
87
87
88
88
90
97
97
97
98
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
105
105
106
107
113
115
CONTENTS
14 Differentiation: Responding to
14.1 Introduction . . . . . . . . . .
14.2 Limits . . . . . . . . . . . . .
14.3 Rates of change . . . . . . . .
14.4 Differentiation . . . . . . . .
15 Differentiation II: Tricks and
15.1 Introduction . . . . . . . . .
15.2 Implicit Differentiation . . .
15.3 Logs and Exponentials . . .
15.4 Higher Order Derivatives .
15.5 Elasticity of Demand . . . .
Change
. . . . . .
. . . . . .
. . . . . .
. . . . . .
.
.
.
.
Extensions
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
117
117
117
118
122
.
.
.
.
.
127
127
128
130
132
133
one Variable
135
. . . . . . . . . . . . . . . . . . . 135
. . . . . . . . . . . . . . . . . . . 136
. . . . . . . . . . . . . . . . . . . 141
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
143
143
144
145
148
Growth I
151
. . . . . . . . . . . . . . . . . . . . . . . . . . 151
. . . . . . . . . . . . . . . . . . . . . . . . . . 152
. . . . . . . . . . . . . . . . . . . . . . . . . . 156
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
159
159
160
162
166
.
.
.
.
167
167
168
171
173
21 Multi-variable Optimisation
177
21.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
21.2 Unconstrained optimisation . . . . . . . . . . . . . . . . . . . . . . . 177
21.3 Constrained optimisation . . . . . . . . . . . . . . . . . . . . . . . . 182
22 Applications of Constrained Optimisation
22.1 Introduction . . . . . . . . . . . . . . . . . .
22.2 Economic Applications . . . . . . . . . . . .
22.3 Interpreting Lagrange Multipliers . . . . . .
22.4 The Power of the Method: A Preview . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
187
187
188
193
195
v
CONTENTS
vi
Lecture
Introducing QABE
1.1
Introduction
1.2
Learning in QABE
An overview
Lectures
Textbooks
introducing
clarifying
Understanding
discussing
Tutorials
1.2.1
deepening
correcting
testing
Quizzes
Assignment
Tests
Final
Tuition
lectures (2hr per week) Introduce and emphasise key points from the course, see
worked examples, ask one or two questions; prepare by reading the lecture
notes, reading over reference chapters;
tutorials (1hr per week from week 1) Core place of learning, developing understanding, making mistakes, asking many questions;
pitstop (many hrs per week from week 3) Back-up for tutorials, further explanation,
further inquiry.
consultation (3hrs per week) Clarifying lecture material, discussing course-program
related issues (LIC), focussed tuition.
Computer Labs
No in-lab computing assessment;
Labs are for:
Practicing/learning Excel;
Working on your Assignments;
Completing online-quizzes
Labs are booked for use by QABE students: see the course website for details.
2
1.2.2
Materials
online Go to
http://lms-blackboard.telt.unsw.edu.au
... click on ECON1202/2291 - Quantitative Analysis for Business and Economics. Lecture notes, course-outline, past exams, contact information;
textbooks 1. (required) Haeussler, Paul & Wood, Introductory Mathematical
Analysis: for Business, Economics and the Life and Social Sciences,
Addison Welsey, 12th Edition, 2008. (HPW);
2. (strongly recommended) Knox, Zima & Brown, Mathematics of Finance,
McGraw-Hill Book Company, 2nd Edition, 1999. (KZB);
3. (other) see course outline.
More help?
pass (many hrs per week from week 3) Peer Assistance Support Scheme: Peer
assisted study groups, run by second and third year students;
education development unit (edu) (Australian School of Business) Learning and
language support; workshops etc., Room G07, Ground Floor, ASB Building,
West Lobby;
the learning centre (UNSW) Free and confidential learning support for students;
iLecture Podcasts in .mp3 or live-streaming (quick-time, windows media player).
ya =
yb
yc
yd
(x 6= 0).
3
1.3
1.3.1
Miscellany
On the lecture materials
text ref.
here!
At the end look for key words of interest that you should revise;
Note special text like,
Definition | The fundamental theorem of first-year
The amount of work w undertaken by a student is inversely related to the
difference between the total session time T and time elapsed in the session
t,
1
(1.1)
w(t)
T t
Examples appear in the notes with a box for working,
Example:
The world is experiencing exponential growth in population, but declining
economic stocks of energy, fresh water and food. Solve.
Or words of caution to make sure you dont fall into common traps,
1.3.2
1.3.3
Studying at university
Some advice
1. Attend classes the turning up philosophy to education;
2. Use a diary/palm-pilot/organiser/calendar/scraps-of-paper, write in assessments, put down reminders;
3. Make a habit of opening the textbook and reading it weekly;
4. Ask questions lots of them;
5. Introduce yourself to someone else in a tutorial or lab.
1.4
To begin with, we will go back over some fundamental concepts and terminology of
the vast world of functions. Following which, we will meet some particular kinds of
functions that will keep cropping up in this course, and most likely, in the rest of
your studies.
Note: Notation We will use a particular notational convention for functions, such in the
following example:
f (x) = x2 + 4,
It should be noted that there is nothing special about f (or x for that matter), they
are just labels. As we note below, we could just have correctly chosen to name all of
our representative functions as blah with input words, (giving say, blah(words),
which would be read, the function blah of words). However, this might get confusing,
and so we will follow the very established convention of using the function title f (x),
or perhaps y(x).
1.5
What is a Function?
Definition | Function
A function is a rule that assigns to each input number exactly one output number.
HPW 2.1
1.5.1
Some Definitions
shrimp 1
;
2
1.6. FUNCTIONS
1.5.2
1. Functions are part of a broader class called relations. Functions are the
special case they give one output value for a given input value.
f (x) = x2
3
2
1
0
-1
-2
-3
-3 -2 -1 0 1 2 3
1.5.3
f (x) =
-3 -2 -1 0 1 2 3
Example:
Find the domain of the function, y(x) =
2
.
x2 +3x4
1.6
1.6.1
HPW 2.2
Functions
Common Functions
f (x) = 2
-3 -2 -1 0 1 2 3
f (x) = x2
-3 -2 -1 0 1 2 3
p1 (x)
p2 (x)
f (x) =
x2 6
x+6
-3 -2 -1 0 1 2 3
1.6. FUNCTIONS
Definition | The Absolute Function
An absolute function is of the form:
f (x) = |g(x)|
where g(x) is some function and | | indicates positive value.
3
2
1
0
-1
-2
-3
f (x) = | x|
-3 -2 -1 0 1 2 3
1.6.2
Combining Functions
(f g)(x)
quotient
( fg )(x)
= f (x) g(x) ,
f (x)
=
for g(x) 6= 0 .
g(x)
1.6.3
f
g (x),
Composite Functions
f (x)
g(y)
z
9
HPW 2.3
g(f (x))
1.7
1.7.1
HPW 2.4
Special Functions
Inverse
g(f (x))
or in other words, if
(f g)(x) = f (g(x)) = z ,
then what we are after is the function,
(g1 f 1 )(z) = g 1 (f 1 (z)) = x .
where g1 is the inverse function of g.
10
x2 +1
5 ,
find f 1 (x).
(2)2 + 1
=1
5
(5)(1) 1 = 2
z(x) = x2 + 2 x + 4f 1 x ,
what would you understand this to mean? It is clearly a bit ambiguous, with ambiguity
due to the lack of any indication of whether f is a function (which has been written
in the equation without its input value), or if it is just another variable that is taken
reciprocally ( f1 ).
To avoid such ambiguity, good practice is always to make the inputs to functions very
clear (write them in), unless there are many inputs, in which case, make it clear
that you are just going to write the function name (for convenience, we shall write
f (a, b, c, d, e, f ) as just f ) and be sure not to confuse things in the expression.
11
1.7.2
HPW 4.1,
4.2
We will have much more to say about exponential functions in coming weeks, since
they provide an easy way to talk about various kinds of time-dependent processes.
Be sure to do a number of exercises in exponential and logarithmic functions since
it is quite likely that either you have forgotten the rules associated with them, or
are meeting them for the first time. It will be of great benefit if the rules and
manipulation of these types of functions comes quickly to hand.
Definition | Exponential
f (x) = ax
(A selection of ) Important rules:
am an = am+n
am
= amn
an
(am )n = amn
f (x) = 2x
3
2
1
0
-1
-2
-3
-3 -2 -1 0 1 2 3
Definition | Logarithmic
Where b is the base,
f (x) = logb x
(A selection of ) Important rules:
logb (mn) = logb m + logb n
m
logb ( ) = logb m logb n
n
logb (mr ) = r logb m
logb 1 = 0
f (x) = log10 x
3
2
1
0
-1
-2
-3
-3 -2 -1 0 1 2 3
Note: logb x is like saying, what power must I raise b to, to obtain x?
The connection between logarithms and exponentials...
12
by = x
corresponds to
log
Revise!
13
14
Lecture
Introduction
This week we begin a section of the course looking at the time value of money. Put
simply, the maths that we need when dealing with money. The reason we need to
develop an understanding of money mathematics (as opposed to, say, just numbersmathematics) is that numbers representing money, have the special property that
they are actually representing value. The trouble is, as opposed to (say) the number
3 which represents the same information yesterday, today, and tomorrow, if we were
talking about 3 dollars of some currency, we would have to be very careful about
when the number was quoted that is, the value of the representation (3 dollars)
is defined in part by the time that it is quoted. Three dollars today wouldnt get you
even a couple of cans of Coke, three dollars twenty years ago would have obtained
you three cans of coke.
An obvious question is, why does money have this peculiar time-value property?
For now, it is enough to raise it as a question. We start our inquiry into the realm of
time-value-of-money by looking at the different ways that interest can be calculated.
That is, the value of a deposit (some sum of money) can grow over time in the banks
hands. Part of this is to do with simple time-value considerations, and part of it has
to do with various investments the bank has made. More on this later!
Agenda
1. Simple interest
2. Compound interest
3. Continuous compounding
4. Present value
2.2
A Problem
The Problem
Were going O/S in 2 years and we need to make as much money as possible before
then through the bank as we dont have any time for work (were studying). We
only have $1500 currently, but the trip will cost $3,200.
15
The parameters:
Money in the hand: 1500
Time available: 2 years
Three banking options:
1. Option 1: Simple Interest
2. Option 2: Compound Interest
3. Option 3: Continuously Compounded Interest
2.3
2.3.1
Terminology
KZB 1.1
S
$3,200 (our aim)
r
t.b.d.
I
t.b.d.
Note: On S, P and A There is no real reason why the final value is given the pro-numeral
S my best guess is that is to do with savings (i.e. the amount that is in the account
after some time), but this is pretty tenuous. In any case, it is the convention of the
financial maths texts (both KZB and HPW use S for the final, or saved, value), so
well use it here.
For the initial value, when we are just doing investment calculations, generally we talk
about the Principal P being invested. However, when we are dealing with annuities
(later), we talk about the present-value of the Annuity A (not P ). In this course, well
try to follow the texts as best as possible: P for Principal, S for Savings (or future
value), and A for present-value of an Annuity.
16
2.3.2
Working it out
Simple Interest
2.4
2.4.1
Terminology
Compound Interest
Suppose that instead of I being paid once at the end of the investment
period, instead, the calculation (and payment) of I is paid periodically within
the period: such a scenario is that of compound interest.
17
2.4.2
Working it out
Example: Option 2: reverse compound interest
Returning to our problem, how long would it take to obtain $3,200 with an
initial investment of $1,500, if interest is compounded every two months
at a nominal rate of 5%?
18
2.5
2.5.1
Clearly, it is better to have interest compounded that is, calculated and added in
more than once a year. However, what would happen if we asked for compounding
to take place every week? every day? every second? continuously??!!!
Suppose we have our normal compound formula,
S = P (1 + r)n
However, to be clear about it, lets define ra to be the annual rate of interest
(the nominal rate), and k to be the number of times a year compounding
will occur, and t to be the number of years,
ra kt
S =P 1+
k
Now, what we are interested in, is making k approach ... (continuous compounding), that is,
ra kt
lim P 1 +
k
k
r t
ra rka a
= P lim 1 +
k
k
S =
Let x =
ra
k
i
h
1
But notice that the limit is actually e limx0 (1 + x) x , that is,
S = P era t
2.5.2
Working it out
19
2.6
Summary
To summarize...
5000
S = P ert
4000
S =P 1+
3000
r nt
n
S($)
2000
S = P + P rt
1000
0
0
t(years)
2.7
Present Value
21
22
Lecture
Introduction
We spend a little more time looking at how the value of money is actually dependent
on the time at which it is in our hand. That is, as before, we note that there
exists a time value of money; would you prefer $100 in your hand today, or $101
tomorrow?
There are various explanations for this fact. As you might have reflected above
Id prefer the money today, since Im not sure what will happen tomorrow, that
is the uncertainty of our lives kicking in. Just one of the factors that contribute
to the apparent value of money changing through time.
We then move on to applying some of our new-found skills in time-value-ofmoney to one of the most common problems faced in the commercial world, namely,
the problem of deciding whether or not to go ahead with a project, or if there is
choice between projects, deciding which of the projects to fund.
The reason it is so common (if not already obvious) is that in practically every
business situation, one has to spend money, to make money that is, make an
initial investment (called capital) and after time, begin to yield some kind of income
stream from the business. The big competition that then ensues is between that
money invested in your project, versus that money invested in the bank at some
going rate who gives the best return will decided how you will proceed. However,
the question of whether one project is actually worth it on its own, or in comparison
to another is not always immediately obvious. Not to worry by applying what we
have learnt up till now, we have the tools to become experts on these issues!
The methods we will develop are two of the most common the net present
value of the project on the one hand, and the internal rate of return on the
other. The two methods are very connected, but their interpretation requires some
care.
Agenda
1. Equations of value;
(a) Under simple interest;
(b) Under compound interest;
2. A campus investment conundrum;
23
3.2
KZB 1.4,
2.6
Equations of value
Equations of value
Scenario
You owe your parents some money. At present, you owe them $500 to be paid in
6 months and $350 in 9 months. You dont want to do installments, youd prefer
to pay $100 now and the rest in 12 months time. In negotiations, they agree to
consider either simple or compounded (quarterly) interest. What will you do?
3.2.1
Simple Interest
Solution technique:
1. Work out the timings;
2. Using the focal date bring all the payments and debts to it;
3. Set up the equation of value;
4. Solve.
Debts:
$500
2
Payments: $100
focal date
$350
8
10
t (months)
12
focal date
Example:
Using a focal date of now or in 12 months, and simple interest at the
nominal value of 7%, what would be the single sum you owe?
Checking the two payments (now = $715.63, 12 months = $766.63), the value of
the 12 month payment is,
P
= 766.63(1 + 0.07)1
= $716.48
24
!!!
3.2.2
Compound Interest
3.3
3.3.1
3.3.2
Costs
50,000
34,000
34,000
44,000
44,000
44,000
Income
0
25,000
45,000
60,000
70,000
75,000
Cash flow
-50,000
-9,000
11,000
16,000
26,000
31,000
Note
Set-up costs
Two-wages @ $17,000
Third wage @ $10,000
Working it out
Steps to a decision...
1. Adjusting the cash-flow numbers to turn them into present values (based
on the going alternative rate of return);
2. Sum each of the cash-flow values (in todays terms) to get the net present
value;
3. Make a decision:
If NPV > 0 worthwhile;
25
Costs
50,000
34,000
34,000
44,000
44,000
44,000
Income
0
25,000
45,000
60,000
70,000
75,000
I-C
-50,000
-9,000
11,000
16,000
26,000
31,000
(1 + 0.12)t
PV
NPV
(3.1)
3.3.3
Suppose we do the calculation of the NPV for a range of interest rates ...
20
16
12
8
4
N P V ($ 000) 0
4
8
12
16
20
3.4
IRR
b
r
b
0.05
0.10
b
0.15
b
b
b
r = IRR
then the return on the project (over its life) is exactly the same as if we put
our money into the bank! (the competition is a dead-heat!)
Definition | Internal Rate of Return (IRR)
The internal rate of return indicates the equivalent interest rate offered by a
financial institution (compounded yearly) that would give the same outcome
for my investment over the project life-time, as my project itself.
It is found by setting the N P V to zero, and solving for r, assuming cash
flows arrive at the end of the year,
N P V = F0 + F1 (1 + r)1 + + FT (1 + r)T = 0 .
(3.2)
Care with the IRR When interpreting the IRR, notice that it is
(by definition) independent of the current cost of capital (what
is actually offered by the banks). It is tempting to think that IRR
somehow depends on this value. It doesnt! (But we compare to it.)
27
3.4.1
Working it out
Example: IRR by hand
Suppose a project requires an initial investment of $20,000 and returns
$7,000 and $16,000 at the end of the first and second years respectively.
Find the IRR of the project assuming yearly compounding.
There are simple cases (esp. when t 2) that can be solved by hand using
the quadratic equation;
Obviously, it is difficult to solve for r in most cases (other than trial-anderror approximation), so we often use a software package (such as Microsoft
Excel, Open-office or Gnumeric);
Be careful how you use the software however...
Example:
Using a computer program of your choice, find the IRR and N P V , at 3%
interest, of the following stream of net profits: (-45, -25, -2, 12, 27, 30,
31).
The interpretation here needs care! Note that the cost of capital is so-called,
since it is the gain fore-gone (given up) when we use the investment money (the
capital) in our project. For this reason, if we cant do better than what the bank is
offering, we might as well put our backers money in the bank!
It is in this sense, that having capital (investment money) outside of the bank
is costly unless we are putting it to good use, it is literally costing us in interest
we could have been getting! (thats no-risk return too...)
3.5
Summary
3.5. SUMMARY
Clearly, at cost of capital 12%, the The Bean House isnt worth it wed do
better by putting our money in the bank at the offered rate of 12%;
However, by calculating the IRR, we could see that for any cost of capital
less than 10%, the The Bean House is a good idea! ... wed beat the best
interest going at the bank!
Finally, suppose that we had two different projects the coffee roaster being
one, the other being a simple bakery, if they both have a positive N P V , we
still wouldnt know how to pick between them.
However, if you cant do both, choosing the higher N P V project will be
the highest returning project.
29
30
Lecture
Introduction
Depending on your studies, you may never have heard of an annuity. However,
chances are, you have actually been thinking about, or seeing the work of, annuities
in everyday life for years. For example, when you are repaying your mobile phone in
a number of fixed installments you are paying an annuity. When you take out a loan
for a car, or some other purchase, and then begin repaying the loan, you are dealing
with an annuity. If you have an older friend who is receiving a regular pension
amount from a superanuation benefit such that there will be nothing left by their
lifes end, they are getting money through an annuity. Finally, if you have a savings
account which you regularly transfer money into (say, monthly) and dont intend
to touch for a number of years (as in the film, The Bank), you have an annuity.
Enough said.
You see, annuities do live something of a secret life we all use many financial
services which have their own specific names, but if we look a little deeper, we are
just dealing with an annuity. To understand these creatures better, we have to
start with a bit of maths to refresh ourselves on the nature of geometric progressions
and series, which will then enable us to investigate the many- and varied- forms
of an annuity. If you can get a handle on annuities, then doubt-less youll become
a favoured expert amongst friends and family as you crunch the numbers on their
various financial options!
Agenda
1. Background: the geometric progression and series;
2. Annuities present, future value;
3. Annuities due.
4.2
Geometric Progressions
r=
xi+1
xi
(4.1)
Of interest, is what the numbers (or terms) do over time do they get larger?
smaller? stay the same?;
Further, if they were added together, how will the sum of terms behave?
Definition | Geometric Series
A geometric series is simply an additive equation (sum) of the terms of
a geometric progression, i.e.,
a + ar + ar 2 + ar 3 + + ar n1 + ar n
The sum is given by,
s=
a(1 r n )
1r
Example:
Find the sum of the series,
s = 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512
4.3
HPW 5.4,
KZB 3.1,
3.2
Annuities
(4.2)
(4.3)
4.3. ANNUITIES
You have recently gone onto a plan for a mobile phone which includes a new phone.
In the contract, the repayments required per month for the phone alone are $17 per
month (calls are extra). The contract says youve got to pay this for two years. You
wonder to yourself, what is this phone worth anyhow? Should I just buy a phone
now outright???
4.3.1
Terminology
Definition | Annuity
An annuity is a sequence of agreed payments made at fixed intervals,
called the payment period, over a given length of time, called the term
of the annuity.
Example sequence repay a loan at $250 with a payment period of 2 months,
for a term of 12 months:
Deposits:
10
t (months)
12
Question then: how is this different to one lump-sum payoff at the outset? At the
end?
4.3.2
Present Value, A
Example: Present Value of Annuity
Show that the present value A of an annuity of agreed payments R, paid
at the end of each of n periods, with r interest rate (per period), is given
by (hint: use the geometric progression result in (4.3)),
A=R
KZB 3.3
1 (1 + r)n
.
r
1 (1 + r)n
r
(4.4)
4.3.3
Spreadsheeting it
Example:
Calculate the previous example with a spreadsheeting program, and check
the result. Set it up so that you can alter the interest rate. What happens?
(Why?)
34
4.3. ANNUITIES
Example: Car loan
Suppose you are considering purchasing a car. The model you want will
cost you $13,450. You have access to a loan through your bank, who would
charge 9.50% interest. What would the monthly repayments be if the term
of the loan was 5 years?
Interpretation
In each case, the repayments are fixed before the term of the annuity it is
a contract;
However, due to the time-value-of-money these apparently constant payments have changing value;
Infact, the agreed repayments include the interest component that the institution is charging;
It is for this reason that we need to work out the real value of what is being
paid out.
Deposits:
focal date
10
t (months)
12
Note: On Annuities You may be getting a quite confused here. Questions such as whose
interest rate? and what does an annuity actual mean? are quite natural.
When we calculate the present value of an annuity, we are really asking the question,
what is the amount that must be paid now to purchase the value of the payments Im
planning to make at various times throughout the future?
You see then, that by fixing the payments schedule, the bank (say) has already included
the interest components into those repayments. Which means, yes, as time goes by
consider a 30 year home loan the first payment of (say) $100 is worth quite a
lot, but by the 30th year, paying the face value of $100 is actually paying them a very
small amount of value (in terms of the value of $100 30 years from now).
Annuities cover a lot of financial services because they are the typical form of loan
repayments. A schedule of fixed amounts is set up to begin with, based on the interest
rate being charged. This includes retail agreements (like mobile phone repayments),
home loans (mortgages), and even investments used by pensioners to withdraw a fixed
amount over time (in this case, it is as if the bank has loaned the money from you
and is paying you back at a fixed amount for a number of years).
Infact, the word mortgage comes from two roots mort meaning death and gage
meaning pledge, so together we get a mortgage being to kill of the pledge or agreement between you and the bank!
35
4.3.4
Future Value, S
Notice, we can of course, work out the future value of the loan, just as easily as the
present value,
Deposits:
10
t (months)
12
focal date
Notice: the final payment is made on the focal date itself, so requires no
adjustment;
Thus, previous payments need adjustment up till the n 1 payment,
S = R + R(1 + r) + R(1 + r)2 + + R(1 + r)n1
Another geometric series. (Try proving the following result...)
Definition | Future value of an annuity
The future value of an annuity (ordinary) with payments of R per
payment period for n periods at interest rate r per period is,
S =R
4.4
KZB 3.4
(1 + r)n 1
r
(4.5)
Annuities Due
Alternatively, rather than an ordinary annuity (payments are at the end of each
payment period), suppose the first payment is at the start of the period (like a
magazine subscription, say).
Deposits:
$50
$50
$50
$50
$50
$50
$50
t (months)
7
term
This situation is called an annuity due and changes our definitions slightly...
Definition | Present value of annuity due
The PV of an annuity due is the same as the value of an ordinary annuity
one period before the present, brought to the present. So the PV of an
annuity due is just the PV of an annuity, with one periods interest added
(accumulated),
1 (1 + r)n
A = (1 + r) R
(4.6)
r
36
P V0
$50
P V1
$50
$50
$50
$50
$50
$50
1
2
3
4
5
Ordinary Annuity term
t (months)
7
$50
$50
$50
$50
$50
1
2
3
4
5
Ordinary Annuity term
$50 F V0
6
t (months)
Example:
Suppose you put $100 on the first of each month into a savings account
which pays 5.5% accumulated monthly. What would be size of the account
after 45 years?
37
38
Lecture
Introduction
We now move to a few studies in the world of matrices.1 Think about going on a trip
to a very special island, like the Galapogos Islands off the coast of South America.
The place is so special and different that it may even have different laws of nature
operating on it. Now this might be a very scary thought. Chances are, the scariness
comes directly from the fact that the world might operate so differently from the
one that we are familiar with, that we wont know what to do, how to behave, what
to expect. A natural reaction is to try to find ways of doing things on the special
island that we are used to doing back home.
This kind of journey is exactly what well be embarking on in this lecture. Well
venture into the world of Matrices, and immediately start looking for mathematical
elements that we are used to in our normal (scalar) world, so as to feel more
comfortable in the new place. The important implication of this journey is firstly,
that we shouldnt expect to be able to do our old maths in the new world, and
secondly, that we must recognise which world we are working in! Or else, we may
try to apply a rule to the wrong world that predictably will give rise to all kinds of
unintended consequences.
For some people, this area can cause a lot of trouble, since in a number of cases,
the way that we perform operations (e.g. subtraction, addition, multiplication) on
matrices gives rise to different outcomes than with just, well, numbers on their own.
In times such as these, just remember that matrices are simply a re-arrangement of
the information we are used to dealing with. In most cases, they simply represent
a collection of lists (e.g. shopping, products) which we describe by the number of
rows and columns in the list. The trick with matrices, is that we will begin to do
strange things with them, like multiplying two lists together! Sometimes this will be
exactly what we are after and matrix algebra (or linear algebra as it is sometimes
known) will prove an enormous help to us.
The special rules of matrices are there for a good reason and with a little practice
shouldnt be so foreign to you. If any anxieties remain, as ever, practice, practice,
practice! There are plenty of examples available in your text-book, on-line, or in
1
Note: in the prepartion of this section on Matrices, reference has been made to the excellent
text Linear Algebra (3rd Ed.) by Fraleigh and Beauregard (FB) (1995). By noting this, you may
feel tempted to find this text, which is a fine response, but note that in many areas, FB goes well
beyond what is required of us in our course. Beware!
39
5.2
HPW 6.1
Terminology
Maths by arrangement
Consider the following examples:
6x1 + 3x2 + x3 = 22
x1 + 4x2 2x3 = 12
4x1 x2 + 5x3 = 10
Income
Costs
Mon
54
51
Tues
60
45
6 3
1
x1
22
1 4 2 x2 = 12
4 1 5
x3
10
Wed
58
50
54 60 58
51 45 50
8 1 6
A = rows 3 5 7
4 9 2
A has 3 rows and 3 columns, so its size is expressed as 3 3 (r c);
40
5.2. TERMINOLOGY
A is thus a square matrix since rows(A) = cols(A);
Further, since A is square, we can refer to the main diagonal or principle diagonal of A;
If rows(A) = 1 or cols(A) = 1, then we refer to a row vector or column
vector respectively, e.g.,
1
8 1 6
5
9
We refer to a single position in the matrix as a matrix element or matrix
entry, normally by referring to the row and column positions,
5.2.1
Special matrices
0 0 0
0=
0 0 0
or, in general
0
.. . .
0 = .
.
0
0
..
.
0A = A0 = 0 .
The identity matrix, e.g.,
1 0 0
I = 0 1 0
0 0 1
AI = A .
A diagonal matrix is like the identity matrix, but can have non-zero
elements on the diagonal:
2
0
0
D = 0 0.32
0
0
0
345.1
A triangular matrix comes in one of two forms:
41
for
for
ij
i>j
e.g.
1 2
2
U = 0 0
3
0 0 345.1
5.3
for i j
for i < j
e.g.
1 0
0
L = 5 3
0
1 0 345.1
Operations
HPW 6.2
Example:
Are the matrices
4 3
2 0
and
2 0
4 3
equal?
A=
42
1 2 3 4
5 6 7 8
A =
1
2
3
4
5
6
7
8
5.3. OPERATIONS
5.3.1
2 0
4 9
+
0 7
2 1
Example:
Determine the solution to,
4 9 3
2 0
+
2 1 2
0 7
5.3.2
Scalar multiplication
3 1
0 5
determine 7A.
5.4
HPW 6.3
5.4.1
Matrix Multiplication
Working it out
Matrix multiplication has a special definition, requiring some care. Suppose we have
two matrices,
1 3
5
and B =
A= 2 8
9
4 0
and we wish to find C = AB (A times B), we must do the following:
1 3
5
A = 2 8 and B =
.
9
4 0
44
Example:
Under what conditions would the following equation be true?
(A + B)2 = A2 + 2AB + B2
45
46
Lecture
Introduction
This lecture is a significant step up in difficulty for our matrix algebra, but it is
also a significant improvement in the power of our matrix toolbox. We begin by
coming up with an equivalent operation to division in arithmetic, known as the
matrix inverse. It does just the same job (a matrix multiplied by its inverse
equals the identity matrix (the stand-in for 1 in matrix algebra)), but like other
matrix operations, has its own specific rules and properties.
Following from this, we are caused to wonder how we might actually come up
with the inverse? Afterall, it isnt much use unless we can find out what its value
is. Whilst there are a few techniques for obtaining the inverse (e.g. row reduction)
we will consider just one, the adjoint method. Now this is itself a little bit tricky,
even on small matrices, but it will introduce us to a very important property of any
square matrix, known as the determinant, and the adjoint method will give us an
idea about why sometimes we can get an inverse, and sometimes we cant. More on
this in the next lecture.
Although all of what we do in this lecture is applicable to much larger matrices
(and is where these techniques have real power), we wont be doing them on anything
bigger than a two-by-two or three-by-three. Next lecture well unleash the power of
the computer on our matrix world, and so do some tackle some really big problems.
Agenda
1. Matrix division? ... The inverse of a matrix;
2. Finding the inverse: the determinant and the adjoint method;
3. Application to systems of linear equations;
6.2
A problem?
HPW 6.6
47
for x?
6.2.1
Defined
Instead, we use the inverse of a matrix which has the following property,
Definition | Inverse of a matrix
If a square matrix A has an inverse, written A1 , then A1 has the following property:
AA1 = I ,
A
and
A = I.
not true!!
Ax = b
for x?
A1 =
(Ax) = A1 b
(A1 A)x = A1 b
Ix = A1 b
x = A1 b.
6.3
JS 4.6, 4.7,
4.9
6.3.1
Determinants of order 2
48
a11 a12
The determinant of a square, two-by-two matrix A =
is writa21 a22
a
a
ten |A| or 11 12 and is given by,
a21 a22
(6.1)
a11 a12
a21 a22
Example:
1 3
Calculate the determinant of the matrix
.
5 2
6.3.2
What about 3 x 3?
What if we need to find the inverse (and so check the determinant) of a 3 by
3 matrix?
... it is possible, but just needs care!
a11 a12
|A| = a21 a22
a31 a32
a
= +a11 22
a32
a13
a23
a33
a21 a23
a21 a22
a23
a12
+ a13
a33
a31 a33
a31 a32
49
2 1 2
Find the determinant of the matrix 5 1 3 .
10 2 4
6.3.3
(6.3)
Cofactors
Example: Cofactors & Determinants
2
3
Find the cofactor of the entry 3 in the matrix, A =
4
1
1
2
0
0
0
1
1
2
1
2
4
1
Properties of Determinants
Let A be a square matrix, then,
1. We have det(A) = det(A );
2. Exchanging two rows of A, causes determinant of resulting matrix to be
det(A);
50
6.4
6.4.1
4 0 1
Find the adjoint of the matrix, A = 2 2 0 .
3 1 1
6.4.2
1
adj(A) ,
det(A)
adjoint
method
0 1
2 0 by the adjoint method.
1 1
6.4.3
A Useful Check!
Do we have an inverse?
Definition | Non-singularity
For the square matrix A, if |A| is not equal to zero then A is nonsingular and thus has an inverse, if this is not the case, and |A| = 0, we
say that A is singular and will not have an inverse.
Note, then we have two checks to make of some matrix A, to determine if it
has an inverse or not:
1. Is A square?
2. Is |A| =
6 0?
If the answer is yes to both criteria, we can be sure that A has an inverse.
52
1 0
Determine whether the matrix A =
has an inverse.
9 2
6.5
6.5.1
A messy problem?
Suppose we wanted to solve,
p2 3p3 = 5
(6.4)
(6.6)
2p1 + 3p2 p3 = 7
(6.5)
(6.7)
Solving by hand...
Giving,
1
p1 = (7 + 15 8p3 ) = 11 4p3
2
Now substitute (6.7) and (6.8) into (6.6),
(6.8)
53
2p1 + 3p2 p3 = 7
To summarize...
We cant do normal division on matrices,
We can do the same job with the inverse;
But, if the matrix has a determinant equal to zero, we have no inverse (why?);
We can use the inverse to solve linear systems of equations!
54
Lecture
Introduction
Having learnt a bit about what is going on with matrices, we just have a few more
loose ends to tie up. Specifically, well go over the algebra of matrices. This is
just like what we would normally do with scalar algebra: rearranging equations,
simplifying, making a certain pro-numeral the subject of the equation. However,
with matrices, there are some very important differences in the rules and how to
apply them. Pay attention.
Following this, well cover a couple of important pieces of terminology singular
and non-singular on the one hand and consistent and inconsistent on the other.
These are really just labels for concepts that we are already familiar with, but they
have especial relevance when we move to using computers. I say this, because
although Microsoft Excel (which well be using for the moment) doesnt have
very elaborate error-messages, other programs do. For instance, Matlab might
report (when trying to obtain A1 ),
>> inv(A)
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate.
...
what does this mean? See below.
The main purpose of the second part of this lecture is to introduce the way
of matrices on computers, specifically using Microsoft Excel. As with most
computer packages, Excel is very fast to do lots of things, but fast doesnt always
equal correct! Its for this reason that we have gone through matrices by hand to
a point to begin with, so that we can actually uncover when the computer is telling
us fibs!
Agenda
1. A little more on Matrix Algebra;
2. Using computers to do Matrix Maths.
55
7.2
HPW
6.1-6.3
(normally)
Example:
Suppose A, B and C are all invertible matrices, and
[C1 A + X(A1 B)1 ]1 = C ,
express X in terms of A, B and C.
7.2.1
Consistency
1 3 5 3
[A|b] = 0 1 2 2 , .
0 0 0 1
1 3 5 3
[A|b] = 0 1 2 2 .
0 0 0 1
7.3
Matrices on Computers
An easier way?
In reality, many matrix manipulations and computations are hard work!
However, computers dont get tired like humans do!
There are some tricks, however ... well look at a few.
Terminology
In Microsoft Excel, matrices are known as arrays. They have some special
functions that can used on them:
+ - Add and subtract matrices as normal;
MMULT Matrix multiplication;
TRANSPOSE Transpose a matrix;
MDETERM Determinant of a matrix;
MINVERSE Inverse of a matrix.
Additionally, functions can be nested:
=MMULT(TRANSPOSE(A1:C3),MINVERSE(E1:G3))
Although...
Functions that would be nice, but we dont get to use:
A function to quickly create I, identity matrices (on some systems there is a
function called MUNIT;
A function to construct cofactor matrices;
A function for the adjoint;
etc..
The Golden Rule of Matrices on a Computer
There is always a special way to tell the program that we are dealing with an
array
Each of the numbers are related to each other;
They should be considered together!
58
59
60
Lecture
Introduction
We now take a couple of lectures to think about probability. This is partly because
it is another key feature of various economic problems (especially situations to do
with uncertainty) but also partly because it helps as a primer for further thinking
in probability and its cousin statistics.
For this lecture, we will focus on ways of counting things up. This may not seem
related to probability at first, but the fact is, if we cannot count the number of
possible occurrences, then we cannot determine the likelihood or probability of
seeing the one we have before us. More on this application in the following lecture.
Before we begin, one more note on probability. This is a very common word
in the popular media and discussions in general, for instance, the weather-man
talks about a 25% probability of rain tomorrow, or our family doctor talks about
a one-in-1,500 chance that we might inherit a particular disease trait, or even the
government might say there is a very low probability of any further interest rate rise
in the next two years. Do they all mean the same thing by the word probability ?
Sort of, however, sometimes we slip into using the word a bit informally.
The first two examples are quite correct in that the weather man and the
doctor are asserting that of all the cases we know about in the past that are like
this one, x% of them had y characteristic. To translate for the weather man, he is
saying, of all the days that are meteorologically similar to what we expect tomorrow
to be, 25% of them experienced rain-fall. For the doctor this is, of all the people we
know of who have your heritage, an average of 1 in 1,500 of them had this particular
disease. Notice that in both cases, each professional is asserting that they know
about the population (all days like tomorrow, or all people with the same heritage
as you), and therefore can say something about the instance in front of them. This
is what probability is about knowing information about a whole population gives
rise to estimations of likelihoods about a particular event. Statistics, on the other
hand, goes the other way (sample to population). More on this presently.
Agenda
1. Why counting?
61
8.2
Why Counting?
inference
Statistics
We have a sample, and infer about an unknown population.
likelihood
Probability
We can know the population, and ask the probability of getting the sample.
Note: Statistics and BES We wont be studying any statistics in QABE. The sister
quantitative course, Business and Economic Statistics does tackle a range of topics
in statistics (and a few probability topics that we dont touch on). The distinction
between probability and statistics should be helpful to orientate your understanding in
both areas.
8.3
Basic Counting
HPW 8.1
8.3.1
By Boxes
Example: The number-plate population
The first step in dealing with our scenario is to work out the total number
of number plates possible of the kind {LL ## LL} where L stands for
any captial letter from A Z and # stands for any number from 1-9.
63
8.3.2
By Trees
Or in other words...
Another way to think about the boxes method, is to translate the problem into
a tree diagram.
Tree Diagrams
1. Are made of an initial node;
2. Links show possible paths of construction;
3. Each successive bank of nodes (a choice) is called a level.
A
B
1
2
2
3
B
C
Level 1
Level 2
C
Level 4
Level 5
Level 6
Level 3
By another name
Seen in this way (as a tree), the question becomes, in how many ways can I
construct a path through the tree?
Definition | Basic Counting Principle
Given some procedure having k levels. If n1 is the number of choices for procedure at the first level, n2 at the second, and so on, then the total number of
different ways the procedure can occur (by the basic counting principle)
is simply,
n1 n2 n3 nk1 nk .
(8.1)
64
8.4. PERMUTATIONS
Example: For the record...
The police have a photo from the Kingsford BP petrol station that shows
AA 3 K. How many number plates could have this configuration? What
proportion of the total number do they comprise?
8.4
Permutations
For example, suppose the police knows that a thief has bought exactly (and
only) six decals to onto a blank number-plate how many possible number
plates could he make?
Definition | Permutations
Suppose a basket contains exactly n different (distinct) objects, then if an
arrangement (an ordering) of r these were taken from the basket, we would
have a permutation of n objects taken r at a time. The total number of
ways of doing this, the number of permutations is given by the symbol,
n Pr
or n Pr .
65
8.4.1
By the formula
Is there a rule?
This is OK when n and r are small, but would be a pain for larger factors...
Actually, we can make some progress on the maths by using factorials (!).
Writing out what we just did (in the previous example) we have,
12 P3
= 12(12 1)(12 2)
n!
(n r)!
(8.2)
n Pr
key.
8.5. COMBINATIONS
Example: On Factorials
Try to do 112!
109! on your calculator. Problems? Can you work it out another
way??
8.5
Combinations
HPW 8.2
Recall our thief had some letter and number decals that he was using to make
up fake number plates;
Suppose now that there is a glitch in the video recording system, and that when
they use the recognition technology, all it tells the police is which selection
of letters and numbers was used on the fake plate, not what order they were
in;
The question is then, in how many ways can I select (not order) r objects
from a total of n objects?
Counting combinations has wide application, since it is what happens whenever
we have a constraint on the feedstock (the n objects) but dont care about the
ordering, just which of the possible objects is selected.
Example: how many different soccer teams can be selected from a group of
20 school yard kids? (without regard to on-field positions!).
Working it out
For starters, suppose we were forming teams of 3 players, from a total of 5
kids.
Label the kids {A,B,C,D,E}, and write down all the permutations you could
get (choosing 3 from 5):
ABC
ACB
BAC
BCA
CAB
CBA
ABD
ADB
BAD
BDA
DAB
DBA
ABE
AEB
BAE
BEA
EAB
EBA
ACD
ADC
CAD
CDA
DAC
DCA
ACE
AEC
CAE
CEA
EAC
ECA
ADE
AED
DAE
DEA
EAD
EDA
BCD
BDC
CBD
CDB
DBC
DCB
BCE
BEC
CBE
CEB
EBC
ECB
BDE
CED
DCE
DEC
ECD
EDC
CDE
CED
DEC
DCE
ECD
EDC
Look carefully at the way we have written them down ... actually each of the
columns is just a re-arrangement of three base letters:
ABC
ABD
ABE
ACD
ACE
ADE
BCD
BCE
BDE
CDE
67
n Pr
r!
n!
r!(n r)!
(8.3)
8.6
Summary
Case by case...
Sensitive
to Order?
yes
Limited
stocks?
no
yes
yes
Combinations
no
yes
Less Basic
Counting
no
no
Basic Counting
Permutations
68
Formula
n1 n2 . . . nk
Example
Number
plates
n!
Letter
arn Pr = (nr)!
rangements
in Scrabble
n!
Choosing
n Cr = r!(nr)!
an executive
team
Assigning non-exclusive jobs
to workers
Lecture
Introduction
Continuing our two-part look at probability, we now get our teeth into more complicated scenarios of probability. In particular, we will be interested to consider what
makes sense when we think about how two, or three, or more events occur in time.
Along the way, well notice that the ordering of the events matters sometimes, but
not always; its a question of dependence.
Most of our time will be spent drawing and understanding a very useful visualisation of probability problems known as probability trees. It should be pointed
out that there is more than one way of thinking about probability, for example,
seeing probability in terms of sets is another helpful one. However, in the interests
of time, and because trees are especially useful for introducing more complicated
topics like Bayes Formula, well stick to the trees!
Agenda
1. Probability by the trees;
2. Rules of probability for independent events;
3. Conditional probability and Bayes Formula.
9.2
Probability Trees
Re-introducing Trees
We looked at Probability Trees last time, as a diagram with levels.
A
B
1
A
A
1
2
3
B
69
Pr (
Re
d)
Red
By the cards...
13
52
)
(
13
52
13
52
)
(
Pr
Pr
Pr
(
)
Pr
13
52
(
)
With a 52 card pack, there are 13 cards of each suit, giving a probability of
each event occuring (drawing a card of that suit) equal to 13
52 .
9.3
9.3.1
Rules of Probability
Multiplication
= Pr(B)Pr(A|B) .
Pr(A)
70
Pr(B|A)
9.3.2
Conditional Probability
Conditional Probabilities
HPW 8.5
Often, we have a sequence of events, where the possible outcome of the second
layer depends on the first layer.
71
)
1
(A
r
P
A 1 ) B1
A1
Pr(
B2 |
Pr
(A
A1 ) B2
B 1|
Pr(
2)
A 2 ) B1
A2
Pr(
B2 |
9.3.3
A2 ) B2
Probability Trees
Multiple levels...
If there is more than one level, we have some kind of order to the events.
Probabilities given on Probability Trees When drawing Probability Trees, it is conventional to give the conditional probability
of the event occurring for all branches deeper than the first level.
C |A
Pr (
)
(A
Pr
Pr
) C
A
Pr(
D |A
E |B
Pr (
(B
)
) E
B
Pr(
F |B
(A
Pr
A 1 ) B1
A1
Pr(
B2 |
Pr
(A
A1 ) B2
B 1|
Pr(
2)
A 2 ) B1
A2
Pr(
B2 |
72
A2 ) B2
9.3.4
Independant Events
Suppose we were to draw a Probability Tree to represent the flipping of a (fair coin)
twice:
H 2|
Pr (
)
1
(H
r
P
Pr
H 1) H2
H1
Pr(
T2 |
(T
H2
Pr(
1)
H1 ) T2
)
|T 1 H2
T1
Pr (
T2 |
T1 ) T2
That is, the order doesnt matter, or in other words, we are dealing with independent events:
Definition | Independent Events
Suppose A and B are events with positive probabilities, then if is true that,
Pr(B|A) = Pr(B) or
Pr(A|B) = Pr(A) ,
then A and B are said to be independent events.
Special Multiplication Law Notice, that if A and B are independent events then we simply have,
Pr(A B) = Pr(A)Pr(B)
e.g. the probability of getting two heads in a row is just ( 21 )( 12 ).
9.4
Bayes Formula
HPW 8.7
S
)
(S
Pr 5
0.8
0.
Pr 15
(N
)
)
P|N P
Pr(
0.54
0.46
Pr (
F|N
) F
We want:
Pr(S|P) =
Pr(S P)
Pr(P)
with numbers,
Pr(S|P) =
(0.85)(0.81)
(0.85)(0.81) + (0.15)(0.54)
Notice, that this question asks things the other way around to our normal
thinking for conditional probability;
Here, the sequence is backwards:
1. Rather than: Prob. layer-2 event, given layer-1 event;
2. We have: Prob. layer-1 event, given layer-2 event !
This has a special name in probability theory ...
Definition | Bayes Formula
Suppose A1 . . . An is an exhaustive list of n mutually exclusive events that
can occur for a given population S, and B is any event in S such that
Pr(B) > 0, then the conditional probability of some Ai , given that event B
has occurred is given by,
Pr(Ai |B) =
Pr(Ai )Pr(B|Ai )
,
Pr(A1 )Pr(B|A1 ) + + Pr(An )Pr(B|An )
(9.1)
Pr(Ai |Bj ) =
B 1|
Pr(
)
1
r(A
Pr
A 1 ) B1
A1
Pr(
B2 |
A1 ) B2
B 1|
Pr(
(A
2)
A 2 ) B1
A2
Pr(
B2 |
A2 ) B2
75
76
Lecture
10
Markov Chains
10.1
Introduction
10.2
The Basics
In 1907, Andrei Markov started studying a very important new type of experiments.
In these processes, the outcome of a given experiment can affect the outcome of the
next experiment. This type of stochastic process is called a Markov chain.
HPW 9.3
10.2.1
Employment Example
Example
Economically active people are either employed, unemployed or self-employed.
Suppose they are never employed for two periods in a row.
If they are employed in one period, they are just as likely to be unemployed
or self-employed the next period.
If they are unemployed or self-employed, they have an even chance of being in
the same job state the next period.
If there is change from unemployment or self-employment, only half of the
time this is a change to an employed status.
Example: The Employment Problem
Form a Markov chain with this information. First, identify the system and
states.
Next State
Self Emp
T = Emp
U nemp
78
CurrentState
Self
Emp
Emp U nemp
10.3
10.3.1
Transition Probabilities
The entries in the first column of the transition matrix T in the employment
example above represent the probabilities for the various kinds of employment condition following a self-employment state. Similarly, the entries in the second and
third column represent the probabilities for the various kinds of employment conditions following an employed or unemployed state, respectively.
79
Hint: The equation should remind you of a product of two vectors; we are
multiplying the first row of T with the third column of T . This is just what is done
in obtaining the (1, 3)-entry of the product of T with itself.
Definition |
Let T be the transition matrix of a Markov chain. The ij th entry tnij of the
matrix T n gives the probability that the Markov chain, starting in state si ,
will be in state si after n steps, where:
t2ij =
for k states.
10.3.2
Xk
r=1
tir trj ,
80
Next State
Self Emp
T 5 = Emp
U nemp
CurrentState
Self
Emp
Emp U nemp
Next State
Self Emp
T 6 = Emp
U nemp
CurrentState
Self
Emp
Emp U nemp
Note that after six periods our employment condition predictions are, to threedecimal-place accuracy, independent of the current employment status.
The probabilities for the three types of employment condition, Self-employed,
Employed and Unemployed are 0.4, 0.2, and 0.4 no matter where the chain
started.
This is an example of a regular Markov chain. For this type of chain,
long-range predictions are independent of the starting state.
Definition | Regular Markov Chain
A transition matrix T is regular if there exists an integer power of T for
which all entries are strictly positive. A regular Markov chain is a
Markov chain whose transition matrix is regular.
10.3.3
State Vector
1/3
X0 = 1/3
1/3
Definition | State Vector
The state vector Xn for a k-state Markov chain is a k-entry column
vector in which the entry si is the probability of being in state i after the nth
trial or step. Moreover, its entries are non-negative and sum to 1.
If X0 is a probability vector which represents the initial state of a Markov chain,
then we think of the ith component of X0 as representing the probability that the
chain starts in state si .
We consider the question of determining the probability that, given the chain is
in state j today, it will be in state i in n steps from now. We denote this probability
by tnij , or collectively T n .
Definition |
Let T be the transition matrix of a Markov chain, and let X0 be the probability vector which represents the starting distribution. Then the probability
that the chain is in state si after n steps is the ith entry in the vector
Xn = T Xn1 = T n X0 .
Note: If we want to examine the behavior of the chain under the assumption
that it starts in a certain state si , we simply choose X0 to be the probability vector
with the ith entry equal to 1 and all other entries equal to 0.
Example:
In our employment example,
let initially all three types of employment be
82
X5
X6
0.402 0.398
= T X4 = T 5 X0 = 0.199 0.203
0.398 0.398
=
0.399 0.200 0.399
0.400
= T X5 = T 6 X0 = 0.200
0.400
=
0.400 0.200 0.400
0.400
0.200
0.400
=Q
0.398
1/3
0.199 1/3
0.402
1/3
1/3
0.400
0.200 1/3
1/3
0.400
We can see that, as the number of trials increase, the entries in the state vector
get closer and closer to the corresponding entries in the vector Q.
Remember that:
0.400
Q = 0.200
0.400
which remains unchanged from trial to trial and
0.500
T Q = 0.250
0.250
0.500
0
0.500
0.4
0.250
0.4
0.250 0.2 = 0.2 = Q.
0.4
0.500
0.4
Hint: Use
T Q = Q = IQ
T Q IQ = 0
(T I) Q = 0.
83
10.4
There are many cases in which economic decisions are made in situations of conflict,
where one partys actions induces a reaction from others. For example:
Wage bargaining between employers and unions or duopoly.
Deciding how much money to invest in research and development; if one firm
invests in R&D, can another rival firm decide not to follow?
The mathematical theory of games has been applied to economics to help elucidate
problems of this kind.
So, game theory studies strategic interaction in competitive and cooperative
environments because
The best games are not those in which all goes smoothly and steadily
toward a certain conclusion, but those in which the outcome is always in
doubt. George B. Leonard
Doubt is the main factor in a famous game called Prisoners Dilemma: two
suspects of a crime are held in separate rooms, are interrogated and cannot communicate with each other.
Player 1
Conf ess
Deny
Player 2
Conf ess Deny
(4, 4) (1, 5)
(5, 1) (2, 2)
10.4.1
Repeated Games
2
0 0 1 0
T1 =
0 1 0 0
3
4
0 0 0 1
Example: Iterative Game
Suppose we start with the state 2 (player 1 confesses but player 2 denies).
The next round, state 3 will be observed (player 2 confesses but player 1
denies). The next round, they will play state 2 again (player 1 confesses
but player 2 denies) and so on. What are the state vectors?
How can one get out of the trap? The solution is a modified version of Tit-for
Tat, that gives each player, say, 10% chance of cooperating, after the other one has
85
Current State
1
2
3
4
1 0.1 0.1 0.01
0
0 0.9 0.09
0 0.9
0 0.09
0
0
0 0.81
If both deny (state 4), next round they will keep denying with 0.9 0.9 = 0.81
probability,
or player 1 confess and player 2 denies with 0.9 0.1 = 0.09 probability,
or player 2 confess and player 1 denies with 0.1 0.9 = 0.09 probability,
or both confess with 0.1 0.1 = 0.01 probability.
86
Lecture
11
Introduction
We move now away from the world of matrix algebra and into the world of linear
programming. It is natural to think that this would require us to do some kind of
computer programming(!), but this is not the case. In fact the word programming
is an artefact of the historical background of the techniques well be studying rather
than saying something about our method.
You see, we will be dealing with the very common problem that anyone faces
when they must attempt to maximize (or minimize) some quantity, subject to a
number of constraints. These constraints might include the minimum production
level that must be attained, or the maximum number of days that can be worked, or
the limit of what an individual can carry at one time.1 The reason why this process
is called linear programming is that for a great many problems, the constraint
and success equations are linear in nature, and the programming bit comes from
the names given to various war-time schedules of activity that were the outcome
of solving just these kinds of problems during World War II. They called them
programmes.
Before jumping straight into the solution method of these problems, we need to
spend some time considering equations where the left- and right-hand sides dont
necessarily equal each other, but instead must be greater-than, less-than, or some
combination of these with equal-to. These are known as inequalities. We look at
these because they are generally how our constraints will be given. Knowing how to
deal with such constraints, well be well-placed to solve bigger linear programming
problems.
Agenda
1. The business headache!
1
An account by Chris Bonnington, expedition leader of the first ascent of the Western Face of
Mt Everest, describes how he had to solve exactly our kind of linear programming problem; he had
to get an amount of equipment, provisions and oxygen up the mountain to support his climbers
with all kinds of constraints, one of which was the amount that any one climber could carry in a
single load.
87
11.2
HPW 7.1
11.3
11.3.1
But first...
We need to learn some useful techniques...
Recall, we are quite familiar with linear equations,
y = mx + c
where y was the dependent variable and x was the independant variable
(m and c are the gradient and constant respectively);
88
10
x1
4
10
x1
4
11.3.2
Linear inequalities
Definition |
A linear inequality involving variables x and y is of the form,
ax + by + c < 0 or,
ax + by + c 0 or,
ax + by + c > 0 or,
ax + by + c 0
where a, b, and c are constants and a and b cant both be zero.
Graphically, there will be a whole region of (x, y) points that satisfy a linear
inequality;
However, by requiring that several linear inequalities must be satisfied, it is
possible to have,
1. No solution;
2. A bounded region of solutions; or
3. Infinite solutions (unbounded).
89
11.3.3
11.3.4
Step 2: Draw the boundary lines as if they were equalities; Step 3: Identify the
region where each is satisfied; Step 4: Find the intersection of those regions (if it
exists).
HPW 7.2
11.4
Linear Programming
11.4.1
Terminology
Linear programming
The equations that we have looked at can be thought of as problem constraints they determine the region within which we are allowed to draw a
pair of numbers for x1 and x2 ;
Often, the problem has some kind of objective function:
Definition | Objective function
An objective function is a function of some number (e.g. f (x1 , x3 , x4 ))
or all (e.g. f (x1 , x2 , . . . , xn ) of the problem inputs, that determines the
overall value of a particular set of chosen input values. In economics, it
is usually a measurement of the net-profit.
Linear programming is the process we use to find out a set of inputs that
fulfill some problem criteria (e.g. maximize net profits, minimize total mistakes);
The name comes from schedules (programs) used in WWII.
The solving process...
90
Stop
Start
Yes
x1
x2
Constraints
x3
Objective
function
f (x1 , x2 , x3 )
The best
solution?
No (try again)
11.4.2
Application
(11.1)
(Raw Beans) It takes 200 g of Raw Beans per Boutique Blend and 1 kg of
Raw Beans per House Pack to make them, so:
60 0.2x1 + 1.0x2
(11.2)
(11.3)
91
80
Constant Profit Lines
x (House Pack)
70
60
Optimal Production
Point
50
40
30
20
Feasible Area
10
0
0
50
100
150
x (Boutique Blend)
1
93
0
0
x1
0
0
x1
94
80
x2 (House Pack)
70
60
50
40
30
20
10
0
0
50
100
150
x (Boutique Blend)
1
95
96
Lecture
12
Introduction
12.2
Last time, we dealt with constraints, the objective function and put it
together to solve the The Bean House Problem with linear programming;
However, we have different types of solutions that can arise:
1. Bounded;
97
HPW
7.2,7.3
12.3
Recall our The Bean House example from last time. We had optimimum outputs
at (132,10) yielding a profit of $1,080.12.
What if things change???
Well consider two types of changes;
1. The effect of changing inputs on our profits;
2. When the objective function itself changes, forcing us to reconsider our
optimal production point.
12.3.1
We find that the new optimum point is the solution to the system:
1000 5x1 + 14x2
10 x2
12.3.2
60
x2 (House Pack)
50
40
30
20
10
0
0
50
100
150
200
x (Boutique Blend)
1
p1 = $4.50
In this case, the binding constraint changed from the Electricity constraint
line, to the Raw Coffee Bean constraint line;
If we plotted the Profit at each production point, we would have found:
100
1400
1400
Profit point 1 (172,10)
1300
1200
1200
1100
1100
Profit ($)
Profit ($)
1300
1000
900
800
$6.06
900
700
5.0
6.0
7.0
8.0
9.0
12.3.3
1000
800
700
600
4.0
600
4.0
5.0
6.0
7.0
8.0
9.0
Solution Technique
Solving it
1. Write down equation that has changed;
2. Re-plot the equation, or objective function (to see the new slope);
3. Decide if the changes causes:
No change to optimal conditions;
New optimal conditions;
101
Working Page I
Note: This page intentionally left mostly blank so that you can work along with the examples we will do in class. Use pencil if you are unsure!
6
0
0
x1
0
0
x1
102
80
x2 (House Pack)
70
60
50
40
30
20
10
0
0
50
100
150
x (Boutique Blend)
1
103
104
Lecture
13
Introduction
In the past two lectures we have seen how to set up a linear programming problem
and solve it using the graphical method. The Microsoft Excel program offers us an
alternative method where the problem can be very quickly solved and if necessary
altered and sensitivity analysis performed. To illustrate the use of Solver we will
use a question from a past exam paper in ECON1202. (It has been altered slightly
as it was originally required to be done using the graphical method.)
Agenda
105
13.2
The Problem
Example: REVCO Motor Company
REVCO motor company has two engine-manufacturing plants in Sydney,
plants A and B, producing the 2-litre clean burning engine used in their
new car model. The maximum production capacity of plants A and B are
50 engines and 55 engines per month respectively.
The car engines are sent by road to the 2 car assembly plants of
the company, one in Adelaide and one in Melbourne. The transport
costs per engine from plant A in Sydney to Adelaide and Melbourne
are $100 and $60 respectively while the transport costs per engine
from plant B in Sydney to Adelaide and Melbourne are $120 and $70
respectively.
In a given month, the Adelaide car assembly plant requires 40 engines while the Melbourne car assembly plant requires 35 engines.
In satisfying the engine requirements of the assembly plants in Adelaide and Melbourne, the objective of the company is to minimise the
transport costs of the engines from Sydney to the 2 assembly plants
in Adelaide and Melbourne. How many engines should be sent to
each plant if cost is to be minimised?
You can try working this out by hand if you like, but lets try another way. First,
we need to set the problem up.
13.2.1
(40 x) + (35 y) 55
x y 20
x + y 20
And: x 0, y 0.
Also: x 40, y 35.
13.3
Using Solver
107
Note that 6650 is the initial value of Cost resulting from our guess.
Now we will enter the constraints.
1. First enter the labels Constraint 1 . . . Constraint 6 in the range A4:A9.
2. Then enter the expressions on the left hand side of each constraint in formula
form using appropriate cell addresses for x and y.
3. For the first two constraints we need x + y so we enter the formula = A2 + B2
The resulting value for the constraint is derived using the initial guess values of
20 and 20.
Screenshot 2:
Continue until all constraints have their appropriate values in the range B4:B9.
We will set up the remaining parts of each inequality within the Solver.
Click on Solver at the far right of the Excel ribbon section, with the Data tab
selected. We need to enter the target (cost) cell and the cells we are trying to change
as shown in Screenshot 3 and make sure we are minimising cost by selecting Min.
108
Once this is done click on Add to add the remaining parts of the constraints.
Screenshot 4 shows how Constraint 2 (x + y 20) is added. Note the correct sign
>= has been chosen and the value 20 entered. Press Add between each addition
and OK once all are completed.
Screenshot 4:
Screenshot 5 shows the Solver Parameters dialog box with all information for
the problem added and the problem ready to be solved.
Screenshot 5:
109
Once you press OK you will find that the solution is shown in your original
spreadsheet. See Screenshot 7.
Screenshot 7:
Notice that the values of x and y on Sheet 1 are now 40 and 10 and that the
corresponding cost is 6350.
This represents the optimal solution, i.e. minimum cost of shipping engines
that satisfies all the constraints.
We will now look at the information provided in the three reports.
The Answer Report, shown in Screenshot 8, shows the original guess values
for x, y and cost and the final ones.
It also shows which two constraints are binding. In graphical terms this would
mean which lines are intersecting at the optimal corner point of the feasible
region.
110
Notice that there are no slack values for the binding constraints. All the
available amounts have been used. For Constraint 1 the Slack Value = 0. This
means that all the capacity of Plant A is being utilised.
Looking at Constraint 2 we see that Plant B has 30 units slack or 30 units not
utilised.
The second report is called the Sensitivity Report. See Screenshot 9.
Screenshot 9:
111
When the solution is found we see that the minimum cost on Screenshot 10 has
indeed gone down by 10, from a cost of $6350 using x = 40 and y = 10 to $6340
using x = 40 and y = 11.
Now we also need to know how much x and y can vary, with the other variable
held constant, and still meet all the original constraints.
Screenshot 11:
The third answer report, the Limits Report, shown in Screenshot 11 helps
us to see this.
112
13.4
Multiple Solutions
We have just seen that it is easy to change the value of a constraint and run
Solver again to conduct sensitivity analysis. Its also easy to re-solve the problem
with a new objective function. Imagine that the cost of transport to Adelaide
changes. From Plant A it now costs $110 and from plant B $120 for each engine to
be shipped plus an extra $200 fixed cost.
This changes the objective function to:
Cost = 110x + 120(40 x) + 60y + 70(35 y) + 200
We will run Solver again with the original constraints and guess values of x = 20,
y = 20. We also will change the equation in cell C2. What should the new equation
be?
= 10 A2 10 B2 + 7450
After running Solver if we look at the spreadsheet it seems that the minimum cost
has changed might be as expected .
Screenshot 12:
113
When we delve a little deeper we discover that the solution is correct but not
unique.
The answer report (Screenshot 13) now shows that only Constraint 1 is binding.
In a graphical sense we can explain this. The iso-objective line is parallel to this
binding constraint so we have multiple optimal solutions lying along this line. There
are many combinations of x and y values that give the minimum cost of $6950.
Screenshot 14:
114
13.5. SUMMARY
By looking at the Sensitivity Report in Screenshot 14 we also see that only
Constraint 1 has a Lagrange Multiplier or marginal value.
This means that any other constraint is free to move by one unit without
affecting the minimum cost value, but cost decreases for each extra unit of
capacity in Plant A.
How can we tell what some of the other combinations of x and y give the minimum
cost? We dont get much help from the Limits Report in Screenshot 15.
Screenshot 15:
13.5
Summary
Solver Wrap Up
We have learned how to use a computer technique which can solve many linear
programming problems efficiently and quickly.
115
116
Lecture
14
Introduction
14.2
Limits
3
f (x)
HPW
10.1-10.2
-1
-1
-2
-2
-3
f (x)
-3
-3 -2 -1 0
-3 -2 -1 0
117
(14.1)
14.3
Rates of change
14.3.1
The problem
4
.
x2 9
A function describes some output value (the dependent variable), for a given
input value(s) (the independent variable(s));
We often would like to know by how much the output is affected by a change
in the input;
x ???f (x)
This can be represented by the following,
x f (x)
where just means change in.
118
f (x)
f (x)
4
3
f (x)
2
1
0
0
10
But...
f (x)
f (x)
5
4
3
f (x) = 0
1
0
0
10
It would be therefore useful to come up with some way of finding out the rate
of change of a function for a given change of an input at a point on the
function;
For example: how will my appetite for packets of chips change if I finish eating
my first packet of chips? What about my 12th packet of chips?
This is the aim of differentiation:
119
14.3.2
Suppose we wanted to find out the rate of change of the point marked;
This is the same as trying to find a line that has the same slope right at
that point the tangent;
Suppose we approximate this line, by calculating slopes we can compute
by:
1. Choosing another point away from ours;
2. Drawing a secant between them;
3. Measuring the slope.
To get a better approximation we choose another point closer to our point
of interest;
And continue!
Eventually, by making our x so small (approaching 0) we will have a very
good approximation of the slope:
f (x0 + x) f (x0 )
x0
x
f (x) = lim
10
9
8
7
6
f (x)
5
4
3
2
1
0
0
10
x0
120
f (x + x) f (x)
.
x
(14.2)
14.4. DIFFERENTIATION
(x + x, f (x + x))
f (x + x) f (x)
(x, f (x))
x
14.3.3
Example:
Show that the derivative of f (x) = x2 + x 4 is 2x + 1.
Example:
Find the tangent to the function f (x) = x2 + x 4 at the point x = 3.
121
HPW 11.2
14.4
Differentiation
14.4.1
Definition |
Given the following functions of x, the derivative
f (x) =
f (x) = 0
f (x) = xn f (x) = nx
d
dx
is the following:
(k constant)
n1
(power-function rule)
which implies,
f (x) =
x0 ,
f (x) = 0
f (x) =
cxn ,
f (x) = cnxn1
Example:
Find the derivative with respect to x of the following functions,
14.4.2
HPW 11.5
14.4. DIFFERENTIATION
Differentiation in the field...
HPW 11.3
dR
.
dq
(14.4)
dC
dQ .
123
14.4.3
HPW 11.6
2x3
x+1 .
124
dz
dx .
14.4. DIFFERENTIATION
Example: Chain rule (harder)
(Challenge) Find the solution to
dz
dx
if
dC
dq );
dR
dq );
dS
dI );
125
126
Lecture
15
Introduction
HPW 12.4
15.2
Implicit Differentiation
15.2.1
Implicit functions
y + y3 x = 7
we cannot assume the full form of the equation of that variable, instead,
we can only know this form implicitly from the function. The resultant
function for y in terms of x is an implicit function.
Example:
Determine whether y is defined explicitly or implicitly in each of the following functions:
x2 y 3 + 2 = 0,
128
ln a (2 x)2 = y,
(y + x)2 2y = 4
15.2.2
dy
dx
dy
dx
part;
dy
dx .
y 3 + 3x2 y = 13 .
d
dx
to implicit functions:
d 3
dy 2
y 6=
y
dx
dx
rather, must apply the chain rule, say on z = f (y):
dz dy
dz
=
dx
dy dx
that is, if z = [y(x)]3 ,
dz
dx
dz dy
dy dx
dy
= 3y 2 .
dx
=
129
15.3
HPW 12.1,
12.2, 12.5
f (x) = ex ;
Definition | Derivative of ex
If f (x) = ex then f (x) has the remarkable property that,
f (x) = f (x) = ex ,
(15.1)
(15.2)
Example:
Show that if f (x) = ln x, then f (x) = x1 , using the result that eln x = x.
1
,
x
and, more generally, if f (x) = ln g(x), then,
f (x) =
f (x) =
(15.3)
g (x)
.
g(x)
(15.4)
1 1
.
ln a x
(15.5)
131
Example:
Find the derivative w.r.t. x of y = ln
15.4
HPW 12.7
3x
1+x
d2 y
= f(x)
dx2
d
f (x)
dx
f (x) =
d
f (x)
dx
3. And so on...
But what does f (x) mean? ... next lecture (!)
132
15.5
Elasticity of Demand
Application: elasticity
HPW 12.3
We often would like to know, if the price of x changes by $1, then by how
much will the demand for x change?
Trouble is that the units of measurement of price and quantity can vary
so it is hard to get a comparative picture;
Solution: Calculate the percentage change that results for a 1% change in
the inputs...
Definition | Point Elasticity of f at x
If f (x) is some function, differentiable at x, and f (x) 6= 0, then we define
the elasticity of f w.r.t. x as,
=
x
f (x)
f (x)
(15.6)
p dq
.
q dp
(15.7)
Notes on (q):
1. If |(q)| > 1, then q is elastic at p;
Example:
If the demand for coffee is given by the demand equation, q(p) = 8000p1.5 ,
find an expression for the elasticity of demand, and so, approximate the
change in quantity demanded for a 1% increase in price at p = 4.
134
Lecture
16
Introduction
After the past two weeks of introducing the various techniques of differentiation
(or going over old ground for some) you may be keen to see your new knowledge
applied to the real world. Not only is differentiation of interest to give us access to
measurement of rates of change (e.g. the speed or acceleration of a car), but with
some insight we can get at a similarly powerful concept that of optimization.
Optimization is (literally) the process of finding the optimum. The highest,
the lowest; the maximum, the minimum; the top, the bottom; the ... you get the
picture. It turns out that the work we have done in finding the slope of a function,
which is equivalent to, say, finding the gradient of a hill, helps us to identify when
the ground beneath our feet (figuratively speaking) is flat and when it is flat, if
you think about it for a moment, you know that you have reached a point that is a
little higher, or a little lower, than the surrounding ground. In some cases, it will
be the highest or lowest point for miles into the distance. That is exactly the same
logic we apply to find maxima and minima of functions. However, we need to pay
some care to exactly what we have found when we use our new-fangled optimization
methods have we found the highest point? ... or perhaps just a bump along the
way.
To get our thinking on the practical track, well start and finish with our nascent
micro-coffee roasting business, The Bean House , to see if we can help our business
partner to find the optimum quantity of Boutique Blend packs to produce in order
to yield maximum profits. This is similar in flavour to the work we did in linear
programming a few weeks back, but as youll see, optimization by differentiation
drills down on the functional form of the problem itself. For now, to the hills!
Agenda
1. A problem of optimization;
2. What can the first-derivative tell us?
3. What can the second-derivative add?
135
16.2
HPW 13.1
Extrema of Functions
f (x)
136
16.2.1
t
.
t2 + 4
Classification by Observation
16.2.2
HPW 13.4
To classify relative extrema takes some time with certain functions seeing
whether the function is larger or smaller to the left and right of a critical value;
However, we can do the characterisation much faster by noticing that:
By checking the less than or greater than of the function to each side of the
point where the slope is zero, we are asking;
Does the slope of the function change positively or negatively as
it goes through the critical point?
Definition | The Second Derivative Test
If f (x) is a twice differentiable function around some critical value x0 , then:
If f (x0 ) < 0, x0 is a local maximum point;
If f (x0 ) > 0, x0 is a local minumum point; and
If f (x0 ) = 0, x0 is ?
Consider the function f (x) = x3 + 2x2 . To find any maxima and minima we
would:
1. Derive f (x);
2. Solve f (x) = 0 for x to obtain critical values;
3. Derive f (x);
4. Find the sign of f (x) at each critical value.
y
138
Example:
Classify the stationary points of the function f (x) = 19 x3 61 x2 32 x + 1
by using the second derivative test.
Notice that a relative or local maximum can also be the absolute or global maximum for the function;
We distinguish between them...
16.2.3
You will hear quite often this classification of local extrema talked about in
terms of two special words: concavity and convexity... what do they mean?
Definition | Convex & Concave Functions
If f (x) > 0 for all values of a < x < b then f is said to be convex on the
domain (a, b). On the other hand, if f (x) < 0 for all values in the domain,
f is said to be concave on the domain (a, b).
139
convex
concave
16.2.4
Points of Inflection
Note: On Points of Inflection What exactly does the point of inflection mean? You will
notice that we got there by the necessary condition that f (x0 ) = 0. So what is this
saying? Recall, that to find the maximum or minimum value of some primitive
function f (x) we looked at where the derivative was equal to zero. That is, by solving
d
the equation dx
f (x) = 0, found the values of x where f reached an extreme value. In
d
the same way, by applying dx
to f (x) and equating to zero, we are asking, when does
the function f (x) reach an extreme value?. That is, when does the derivative
itself attain a maximum or minimum?
In plain terms then, if there is a point where f (x) = 0, then this is saying that at that
point, the slope of the primitive function f (x) has reached a maximum or minimum.
So there are two types of inflection points as shown below:
140
f (x) = x3
g(x) =
1
1+ex
x
y
y
f (x) = 3x2
g (x) =
ex
(1+ex )2
On the left, we have the more normal type, where the point of inflection coincides
with a stationary point (f (x) = 0). Whereas on the right, we have the situation where
the point of inflection is telling us that the slope of the primitive function (g(x)) has
reached its peak, to the left and right of x0 = 0 the slope of g(x) is smaller than at
the inflection point (x0 ).
Example:
Determine whether the function f (x) = x6 has an inflection point at x0 =
0.
16.3
HPW 13.6
Example:
Given the The Bean House data as above, find the profit maximizing
output of Boutique Blend packs , and the profits obtained at this point.
142
Lecture
17
Introduction
In the previous two lectures, we have been interested in finding the rate of change of
some function, and we have used this to (for example) identify where some output
is at a maximum or minimum. While this is very useful for a variety of applications,
it seems natural to expect that there will be times where rather than having access
to some primitive function describing how an output is affected by an input, we will
instead have observed the rate of change itself, and so wish to find the primitive
function.
In fact, this is the other side of the coin of our differentiation work of the past
two lectures, and it involves, appropriately enough, finding the antiderivative of
a function, or as it is commonly known, the integral. In particular, integration
(the process of going from the derivative to its primitive) has a natural application
when we deal with quantities that change over time. That is, as in our first example
below, we might observe the birth and death rate of a nations population, and
wish to determine what the population will actually be at some time point in the
future. This is exactly the kind of step that integration can deliver if we can put
an equation down for the rate of change of the population, then we should be able
to go back one step to an equation of population at a given time.
Notice the word should in the previous sentence. Two things are against us.
First, as with differentiation, there are integration rules for some functions, but not
all! Second, even if we do have a rule that will give us the primitive function we
are after, we still need one more piece of information a single measurement of the
primitive function at a point in time. For our population example, this will be the
population of the country in some year. By using this, we can actually go from a
general description of the primitive function, to a specific one, which is useful for
further work. All of which, we will aim to cover presently.
Agenda
1. Why integration?
2. Some rules of integration;
143
17.2
HPW
14.214.5
Why Integration?
Economic Dynamics?
Suppose you had collected data from the registry of births and deaths for one
area in Sydney over a year; it suggests that the population had a rate of change
expressed by
1
dP
= 0.8t 2 .
dt
However, you would like to know the actual population of Australia in
any given year since 2000;
We have information in terms of a rate of change, but we want information
in terms of the time path of a variable (the population of Australia);
This sounds like differentiation should be involved but ...
Integral calculus to the rescue...
Previously, we have been dealing with this situation:
differentiation
dy
?
y(x)
dx
However, now (in terms of our population change example) we are asking the
reverse question:
integration
dP
P (t)?
dt
Example:
Suppose as in our example, we have,
1
dP
= 0.8t 2 ,
dt
find an expression for P (t), the population of Australia each year, where
t = 0 is the year 2000.
144
17.3
17.3.1
Notation
For the moment, we note that what we are doing is actually finding an antiderivative of p(t):
Definition | Antiderivative, or Primitive Function
The antiderivative of some function f (x) is some function whose derivative is f (x). Normally, we use the notation,
F (x) = f (x) ,
(17.1)
(17.2)
f (x) dx = F (x)+c
17.3.2
...
F (x) = f (x) = 4
Note: On finding a value for c In the example above we used an initial value, that is,
when t = 0 to find our value for c. This is the easiest way to go, if such an initial
point is available, because it directly gives you the value for c, as above. However, any
known (x, f (x)) pair will enable you to solve for c.
17.3.3
Basic rules
Definition | Integration results
Following from corresponding rules of differentiation, we have,
Z
1
xa dx =
xa+1 + c (a 6= 1)
a+1
Z
1
dx = ln |x| + c
x
Z
1 ax
e + c (a 6= 0)
eax dx =
a
Z
1 x
ax dx =
a + c (a > 0, a 6= 1)
ln a
146
[f (x) + g(x)] dx =
f (x) dx +
Z
Z
(multiple)
kf (x) dx = k f (x) dx
g(x) dx
... notice the similarity to the differentiation rules weve already covered.
Example:
R
R
Find (x3 x + 1) dx and 3x2 dx.
17.3.4
(x 6= 0).
Techniques of Integration
Example:
really useful substitution rule!
R 2The
3
Find 6x (x + 2)99 dx.
HPW 14.7
17.4
17.4.1
Notation
Being definite!
HPW 14.8
So far, we have only considered (with the exception of our population example)
integrals of the indefinite kind only variables were used in place of numbers;
However, we can actually calculate the value of our integrals, in particular,
we often wish to calculate the value of an integral between two values of x in
the domain of f , say b, a where b > a;
We do this by calculating the difference between F (b) and F (a),
[F (b) + c] [F (a) + c] = F (b) F (a)
Notice, we lose the value of the constant c
Definition | The Definite Integral
R
To find the numerical value of an integral f (x) dx over the interval x =
(a, b), where b > a, we calculate the definite integral written,
Z
b
a
b
f (x) dx = F (x) = F (b) F (a)
(17.5)
where b and a are the upper limit of integration and lower limit of
integration respectively.
148
Example:
Rb
Suppose f (x) = k(1 ex ), find a f (x) dx (k is a constant).
17.4.2
As an Area
Rb
Leaving the first part aside for the moment, a , consider what the f (x) dx
part is doing: An area of an rectangle is being calculated, having dimensions
A = f (x0 ) dx
y
Rb
In fact, as we calculate the definite integral a f (x) dx we are actually calculating a sum of areas that lie between the function and the x axis between
points b and a;
149
b
a
The definite integral, calculating the area between the function and
the x-axis,
Z b
f (x) dx
a
will give a positive area for regions above the x-axis, but a negative
area for regions below the x-axis.
With our area understanding of the definite integral, we have the following:
Definition | Properties of the Definite Integral
Z
Z aa
a
b
f (x) dx =
f (x) dx
f (x) dx = 0
Z
f (x) dx
kf (x) dx = k
a
a
Z b
Z c
Z c
f (x) dx
f (x) dx +
f (x) dx =
a
In the last rule, it is assumed a < b < c, that is, we can chop up the area
into parts.
Example:
R6
Suppose f (x) = ex/3 3, evaluate 3 f (x) dx and compare it to the
region that lies between the x-axis and f (x) on the interval [3, 6].
150
Lecture
18
Introduction
HPW 15.5
18.2
Differential Equations
18.2.1
Notation
Terminology
Suppose you were faced with the following relationship between x and y,
2
dy
+ y 4 = 0,
dx
Since we have an equation where a variable enters both plainly and as some
form of derivative we have a differential equation;
Definition | Differential Equation
An equation where a variable enters as a derivative is called a differential
equation,
a b
d y
+ ky = c
(18.1)
dxa
where a and b indicate the order and degree of the equation respectively,
and k and c are constants, e.g. a first-order differential equation
of degree 2, is one in which a = 1 and b = 2,
dy
dx
2
+ 2y = 4
Example:
Consider the equations,
(a)
dy
dx
3
+ 4y = 12
(b)
d2 y
y = 0 ,
dt2
152
(18.2)
18.2.2
Solution Technique
Example:
Find the general solution to,
dy
= xy
dx
where
y > 0.
Separation of variables
dy
dx
. . . dy =
. . . dx
18.2.3
dy
dt
Being definite
Up till now we have left our solutions with a constant in them (either c or
A);
Such a solution is known as a general solution;
However, just like in integration of last lecture, we can use an initial condition to find a definite solution...
Example:
Given the general solution, y = Ae2t + 3, and initial condition y(0) = 10,
find the definite solution.
Note: Definite vs. Particular Solutions You may also find discussion of a particular
solution of a differential equation. This arises because, as you will have seen, the
choice of the constant A (for example) in the above equation is somewhat arbitrary.
Any choice of A as a constant will give rise to a solution of the initial differential
equation that is, the particular equation that this choice gives rise to will display
dynamics in line with the original differential equation. However, there is one special
choice of A that will satisfy an initial condition when t = 0. This is special, since
it will uniquely describe not only the dynamics of the system being analysed, but also,
the actual value at a given time of the system itself, due to solving for A with the
initial conditions of the system in mind. In this way, we can talk about three kinds of
solutions: the general solution,
yg (t) = Ae2t + 3 ,
a particular solution, where we just choose some A arbitrarily,
yp (t) = 16e2t + 3 ,
154
Example:
Show that the general solution to the non-homogeneous first-order differat + b . (Harder)
ential equation, dy
dt + ay = b (y > b/a) is y(t) = Ae
a
Example:
Using the result of the previous example and assuming that y(0) = y0 ,
show that the definite solution is y(t) = [y0 ab ]eat + ab .
From the previous two examples, we can now say the following.
Definition | Solution of a Non-homogeneous Differential Equation
Given a first-order non-homogeneous differential equation of the form,
dy
+ ay(t) = b
dt
and
y(0) = y0
(18.3)
By realising that the homogeneous case is where b = 0 we can say the following.
155
and
y(0) = y0
Example: Check
Solve (again) the differential equation
HPW 15.6
18.3
Topics in Growth
18.3.1
Exponential Growth
dy
dt
(18.4)
= Sr
Z
1
dS =
r dt
S
ln |S| + c1 = rt + c2
Z
156
S = ert+c = Aert
(18.5)
Example:
The CIA fact-book1 predicted Australias population growth rate in 2006
to be 0.85%. Find a general equation for Australias population at any
given time.
157
Example:
However, the fact-book also says that Australias net migration is 3.85
migrants per 1000 population per year (2006). Given this fact, re-calculate
the years to double the population of Australia.
158
Lecture
19
Introduction
We introduced the concept of growth last lecture. However, despite all the interest
that we can gain from the exponential growth story, the reality is that it has some
not very pleasing properties. The most significant of which is its limit behaviour.
As time goes to infinity, we find the exponential curve sky-rocketing off any graph
paper in the world, itself reaching infinite heights. Now while some may think that
this is true that populations, stocks, money can grow and grow infinitely others
beg to differ!
The more realistic view would suggest that just like money doesnt grow on
trees, there are limits to growth. Whether in the form of capacity constraints for
manufacturing plants (we just cant get any more inputs out of the ground), or as
in-built restraint mechanisms as in yeast growth (they literally begin to die in their
own waste), things eventually reach a limit. So first up, we will study a limited
growth equation, and see how it can be used. In the second case, we will round off
one more sharp edge to get a possibly even more realistic growth equation.
Of course, we could keep going and going, creating richer and richer models of
growth, but for now, it will suffice to cover the main three models. They are relatively
simple, but despite any failings they still describe some situations very well. Thus
they are commonly used in modern commercial and economic calculations. Well
even attempt to go back to 1788 and see if we can calculate the growth rate of the
recorded Australian population, and along the way, make a bold prediction about
the limits to Australias population growth!
Agenda
1. Study the exponential growth curve;
2. Correct the limit behaviour the limited growth curve;
3. A further attempt the logistic growth curve;
4. Apply to Australian data since 1788!
159
HPW 15.6
19.2
Limited Growth
19.2.1
A Problem of Limits
Limits to Growth?
Last time, we considered the case of exponential growth, that is, where we
had a growth equation,
dy
+ ay = b and y(0) = y0
dt
giving an equation with respect to time of,
b at b
e
+ .
y(t) = y0
a
a
What about at t ?
Example:
Show that the limit of y(t) = y0 ab et +
> 0.
b
a
is
b
a
The second case of the previous example presents us with a problem: exponential growth can be unbounded!;
This might be desirable for some situations, but for most, we will want the
growth to find a natural limit, due to some carrying capacity constraint
for example:
y
What is needed is that the growth rate begins high, but goes to zero as some
capacity level is reached;
In other words, we need the growth rate to be proportional to the deviation
from the carrying capacity:
dN
= k(M N (t))
dt
... where M is the carrying capacity, and k is a rate constant.
160
19.2.2
(19.1)
where M is the growth limit and k is the rate constant, then the
quantity will have the limited growth equation of time,
N (t) = M Aekt
(19.2)
Example:
By the method of separation of variables, prove the previous definition for
limited growth.
19.2.3
Seeing it Graphically
161
HPW 15.6
19.3
Logistic Growth
19.3.1
A further refinement?
Consider again the limited growth curve:
y
... if this were for population growth, is there still something a bit worrying
about its shape?
The curve starts with maximum slope! But a population is likely to start
off very slowly and then build in gradient, before slowing under the capacity
constraint.
Building a Better Curve
We still want the exponential growth component of the dynamics, but wed
like the capacity constraint to stop growth when p K, but also to be small
for small p;
So... how about taking our exponential growth rate (in terms of population
dynamics),
M p
dp
= kp
dt
M
... and then multiplying by the fraction
162
M p
M ;
19.3.2
(19.3)
M
1 + Aekt
(19.4)
M
p0
M
,
1 + Aekt
1.
19.3.3
19.3.4
M
p0
M
1 + Aek(tt0 )
x 10
3.5
3
p(t)
2.5
2
1.5
1
0.5
0
1800
1900
2000
2100
164
2200
2300
2400
Summary
Growth is important in economics and business;
Different systems will grow in different ways, we can now model three common
ones:
1. Exponential growth;
2. Limited (exponential) growth;
3. Logistic growth.
The last (logistic) seems the most natural (scarcity is our reason for study!),
but it has its critics.
Keep watching the Australian data youve seen Australias carrying capacity
(30 million) here first!!
165
19.4
(From challenge above) Prove that the equation for logistic growth,
M N
dN
= kN
dt
M
yields the following equation with respect to time:
N (t) =
M
?
1 + Aekt
M N
M
k
[N (M N )]
M
1
dy =
N (M N )
k
dt
M
N
M N
+ c1 =
k
t + c2
M
(recall, that
Z
1
1
dx = ln
x(ax + b)
b
ax + b
x
N
M N
kt
N (1 + Ae ) = M Aekt (let A = ec )
M Aekt
.
N =
1 + Aekt
ekt+c =
M
1 kt
Ae
+1
1
A,
M
1 + Bekt
Lecture
20
Introduction
Up until now you may have been wondering why we have only dealt with (mainly)
functions of just one variable (e.g. f (x)). The reason is that this is the simplest
case, and therefore is a good place to begin. However, as you are no doubt aware,
much of the useful quantitative work that gets done is on functions of more than
one variable multivariable functions (e.g. f (x, y)). (In fact, if you can remember
back to linear programming, we were actually dealing with functions of this sort,
but only in very straight-forward, but still useful, ways).
What does a function of more than one variable look like? Given the usefulness
to business and economic problems of being able to find the maxima and minima
of functions, can we do the same in the many variable case? In regards to the first
questions, if the function is just of two-variables then we can make a representation
of it in three-dimensional space. But anything more than this, and we dont really
have the means to show it graphically. For the purposes of this course, however,
well stick to functions of two-variables. Moreover, the techniques we develop on
two-variable functions are all applicable to any multivariable functions.
In terms of the second question about finding maxima and minima this
requires us as a first step to be able to deal with rates of change in the multivariable
case. Here, we do a similar thing to what we did in the single variable case, but
we have to make sure we are careful that we are precise about the input/output
rate-effect that we are analysing. Since in this many-variable world, we have more
than one input variable that might cause the output variable to change. Therefore,
when we try to look at the slope of the function, we must look at one variables
effect at a time. This technique is called partial differentiation.
Agenda
1. Functions of two-variables the third dimension;
2. Analysing slope in 3D the partial derivative;
3. Applications of the partial derivative;
167
20.2
HPW 17.1
Functions of two-variables
The third-dimension...
So far, we have dealt (in calculus) with functions of the form,
f (x) ,
f (x),
f (x)
???
f (x1 , x2 )
20.2.1
Seeing it Graphically
...
(x1 , x2 )
x2
x1
xz
yz
e
plan
lane
p
y
x
pl
an
e
b
x
y
20.2.2
x
y
df
d...
... that is, we differentiate with respect to a variable we are calculating
the change in the function value, with respect to a change in an input
variable...
169
fx (x0 , y0 ) = lim
(20.2)
(20.3)
fx
fy
y0 )
(x 0 ,
b
(x
0,
y0
x
y
20.3
20.3.1
Example:
Find fx and fy given that f (x, y) = (2x + 4)(y 3).
20.3.2
HPW 17.5
...
d2 f
dx2
...
d3 f
dx3
...
... Which was useful to determine the rate of change of the derivative of f
in other words, the acceleration or deceleration of the change in f ;
Can we do a similar thing with partial derivatives? What would it mean?
Suppose we took the partial derivatives of a function f (x, y),
(fx )
x
fx
and
fy
(fx )
y
and
(fy )
y
(fy )
x
fxy
fyy
fyx
20.3.3
Seeing it graphically
b
b
x
y
172
Example:
Find the second-order partial derivatives of the function z = f (x, y) =
x3 e2y .
20.4
x
y
x
y
g
t
h
20.4.1
HPW 17.6
z
t ?
Definition | Chain-rule
Given a function z = f (x, y) where x and y are both functions of another
variable (or variables), e.g. x = g(t), and y = h(t), then if the functions f ,
g and h have continuous partial derivatives, then we have,
or,
z
z x z y
=
+
t
x t
y t
(20.4)
x
y
z
= fx
+ fy .
t
t
t
(20.5)
20.4.2
x+y
2x2
Total Differentials
1
dt
(20.6)
(20.7)
175
176
Lecture
21
Multi-variable Optimisation
21.1
Introduction
We now come to our final lecture in calculus. We met last time the partial derivative
as a way of finding the rate of change of a function of more than one variable.
Further, we could then use the partial derivative to find the total derivative of a
function and so, get at how infinitesimal changes in one of the inputs would change
the output. This time, we use this knowledge, to go one step further and use the
idea of multi-variable calculus to perform optimization.
In some ways, this will look very familiar to our optimization problems under
normal single-variable calculus, but in others, well need extra tools. In the first
case, the first- and second- order conditions that we apply will look very similar, but
in the second case where we have to deal with constraints on where we are allowed
to look for maxima or minima things will get quite a bit more complicated!
In particular, we have to somehow perform our normal optimisation, but at the
same time, ensure that we dont get off the constraint line. This sounds difficult,
but in fact, a device called the Lagrange multiplier will come in very handy. It
should be pointed out that some of the steps in between in the later cases are not
shown, and are not required in this course well just take the conditions as is. For
those interested however, any undergraduate text in calculus will be a good place
to look, most probably under the title of Jacobian or Hessian matrices. For the
rest of us, we just need to be able to apply these nice results to find out when (and
if) we really are at the top (or bottom) of the hill (or depression).
Agenda
1. Extrema in two-variable functions;
2. First and second order criteria to find them;
3. Dealing with constraints;
4. Applying the technique.
21.2
Unconstrained optimisation
A natural problem
HPW 17.7
177
fx
fy
y0 )
(x 0 ,
(x
0,
y0
x
y
A natural solution...
Recall, that for functions of one variable, we solved:
f (x) = 0
checking:
sign[f (x)]
21.2.1
and
fy (x0 , y0 ) = 0 .
Example:
Find the extreme values of the function,
z = f (x1 , x2 ) = 2x21 + x1 x2 + 4x22 .
Example:
For the plotted function used previously,
z = f (x, y) = 2 (x 1)2 (y 1)2 ,
find the location of the local maximum.
21.2.2
=
(fx dx + fy dy) dx + (fx dx + fy dy) dy
x
y
= ...
d2 z = d( dz) =
Note: If you were wondering where the rest of the previous derivation ends up, then the
following will satisfy you, though this particular derivation is not something we
expect you to be able to reproduce it is for your general understanding (if you
wish!):
( dz)
( dz)
dx +
dy
x
y
d2 z = d( dz) =
|H| =
fxy
.
fyy
Which must be greater than zero for us to be able to solve our original second derivative, and so this is where the seemingly peculiar part of the sufficient second-order
condition in the definition below comes from:
|H| > 0
1
...
2
fxx fyy fxy
>0.
b2 4ac
2a
where the square-root part (b2 4ac) is known as the discriminant, and of course, must be greater
than zero to have a square-root.
180
and
2
fxx fyy fxy
>0,
(21.1)
and
2
fxx fyy fxy
>0.
(21.2)
Summary of conditions
We can give a summary of the necessary and sufficient conditions for establishing local maxima and minima of functions of two variables as follows:
Condition
First-order necessary
Second-order sufficient
Example:
Find the extreme value(s) of the function z = f (x, y) = 8x3 + 2xy 3x2 +
y 2 + 1.
21.2.3
Saddle points
b
b
21.3
HPW 17.8
Constrained optimisation
Up until now, we have been allowing our search of the function to go anywhere ... it has been unconstrained;
What about the realistic situation where we face a constraint (e.g. a budgetline)?
x
y
21.3.1
By substitution
182
21.3.2
21.3.3
(21.3)
Lx = fx gx = 0 , and
Ly = fy gy = 0 .
Example:
Check the previous example, using the Lagrange Multiplier method.
21.3.4
Which extremum?
Definition | Second-order sufficient conditions, constrained case
The second-order sufficient conditions for a constrained optimization problem, having Lagrangian,
L = f (x, y) + [c g(x, y)] ,
and partial derivative (bordered Hessian) matrix,
0 gx
gy
(21.4)
185
186
Lecture
22
Applications of Constrained
Optimisation
22.1
Introduction
22.2
Economic Applications
22.2.1
(22.1)
(22.2)
subject to:
px x + py y = M
188
0x + 1y px = a
Ly = 0 :
1x + 0y py = a
L = 0 :
px x + py y + 0 = M
0 1 px
x
a
1 0 py y = a
px py
0
If you solve this correctly, you will find that the solution is:
x
y =
M +(py px )a
2px
M +(px py )a
,
2py
where we will assume that a is small enough such that these are non-negative.
These expressions provide some insight into how prices and incomes influence the
demand for both products. We see that the consumption of both goods increases as
income increases, decreases as its own price increases and increases as the price of
the other good increases. Does this seem reasonable?
At this point we can ask What is the utility level that maximizing individuals
will achieve when their income is M and they face prices px and py ?. This is simply
the value that their utility function takes when evaluated at the optimal (as opposed
to arbitrary) consumption levels.
By plugging in the solutions by brute force, we end up with:
M + (py px )a M + (px py )a
+
u(x , y ) =
a
2px
2py
M + (py px )a
M + (px py )a
+
.
(22.3)
2px
2py
Definition | Direct and Indirect Utility Functions
Since the optimal consumption choices depend on prices and income, we
can think of u(x , y ) as being a function of prices and income. Let this
function be denoted V (M, px , py ). The function V (M, px , py ) is known as
the indirect utility function, whereas the underlying function, u(x, y)
is known as the direct utility function.
To simplify matters, lets just focus on the case where a = 0. Here we have
V (M, px , py ) =
M2
.
4px py
(22.4)
Again, this tells us how the maximized level of utility that an individual obtains is
related to income and prices (when a = 0). This function will help us later on when
we discuss the interpretation of Lagrange multipliers.
189
> 0?
g(x, y) = px x + py y
and that the Lagrangian function is
L = a[x + y] + xy + [M (px x + py y)]
Clearly gx = px and gy = py . The others are not difficult to work out:
Lxx = 0
Lyy = 0
Lxy = 1.
Therefore, we have
0 px py
= px 0 1 ,
|H|
py 1 0
which is easily calculated as 2px py . Since this is greater than zero, the second-order
condition for a maximum is satisfied.
22.2.2
An Interesting Observation?
22.2.3
Y (L, K) = L 2 K 2
subject to:
L,K
That is:
max L 2 K 2 ,
L,K
subject to:
E(L, K) = B
wL + rK = B
g(L, K) = E(L, K)
c=B
= L 2 K 2 + [B (wL + rK)],
and the first-order conditions are:
1 1 1
L 2 K 2 = w
2
1 1 1
L 2 K 2 = r
2
B = wL + rK
LL = 0 :
LK = 0 :
L = 0 :
(22.5)
(22.6)
(22.7)
L=
r
K.
w
(22.8)
191
hr
w
= 2rK.
K + rK
B
,
2r
L =
B
.
2w
g(L, K) = wL + rK
and that the Lagrangian function is
1
L = L 2 K 2 + [B (wL + rK)]
Clearly gL = w and gK = r.
192
3
1
1
= L 2 K 2
4
3
1 1
= L 2 K 2
4
1 1 1
= L 2K 2.
4
We can not just use these expressions in the bordered Hessian, since they
depend on L and K.
It is therefore important to remember that we want to evaluate the bordered
Hessian at the proposed solution point.
Thus, we need to evaluate the above expressions at K = K =
B
.
L = 2w
LLL
LKK
LLK
1
B 2
2r
1 3
2
1 B 2 B
=
4 2w
2r
1 1
2
2
B
1 B
=
4 2w
2r
1
=
4
B
2w
3
B
2r
and L =
1 w 2 r 2
2 B
1
1 w 2 r 2
=
2 B
1
1 w2r2
.
2 B
22.3
dF (c)
.
dc
(22.9)
(22.10)
(22.11)
(22.12)
(22.13)
The term in brackets (by reverse-engineering the chain rule) just describes how much
g changes when c changes. That is, since the constraint requires
g(x1 (c), x2 (c)) = c,
(22.14)
(22.15)
By using the chain rule, the derivative on the left will exactly by the term in brackets
above. Therefore, we are left with the conclusion that
dF (c)
= [1] = .
dc
(22.16)
For instance, if you use the first-order conditions to solve for in the output
maximization problem, you will find that
1
1 1 2
=
.
2 wr
194
(22.17)
M
.
2 px py
V (M, px , py ) =
Notice that
M2
.
4 px py
V
2M
M
=
=
= .
M
4 px py
2 px py
22.4
(22.18)
(22.19)
While perhaps initially daunting, using the Lagrange method to solve constrained
optimization problems gets much easier with practice. Once you have invested the
effort in understanding the method, it may seem that there must be easier ways of
solving these problems (via substitution of the constraint, for example). In some
cases this will be true, however the method presented here is just the tip of the
iceberg the basic method that you have (hopefully) mastered can be applied to
much larger problems. Covering these extensions in any detail is beyond the scope
of this course, however it is useful to get a sense of just how powerful these (and
related) methods are.
22.4.1
Multiple Constraints
So far we have worked with a single constraint. You are quite right in thinking
that a useful tool will be able to accommodate many constraints simultaneously
- the method described above does this with minimal fuss.
Simply, one extra Lagrange multiplier is added for each additional constraint.
The value of the multiplier has the expected interpretation - the change in the
optimized objective function when the associated constraint is slightly relaxed.
195
22.4.2
Inequality Constraints
Throughout we have only considered constraints that hold with equality. In many
cases this is natural - e.g. if there exists at least one good for which it is always desirable to have greater quantities of, then choosing quantities to consume to maximize
utility will always require that you spend all of your available resources.1 Similarly,
if you are trying to maximize output then you will always spend your entire budget
in purchasing inputs that are to be transformed into output. In these cases, it makes
sense that we use an equality constraint.
However, even in these cases, the problem we really want to analyze is one in
which there is an inequality constraint. For instance, we want our consumer to be
able to spend any amount that they like as long as it is no greater than their available
budget. We do not want to force the consumer to spend all of their resources if they
find it optimal to not do so.2 We may also wish to model a firm that faces various
inequality constraints, such as restrictions on inputs, much like we did when studying
linear programming.
Fortunately, the Lagrange method has been extended in this important direction.
The conditions for a solution, known as the Kuhn-Tucker conditions, are slightly
more complex and you may come across them in higher level economics classes. This
type of constrained optimization is a widespread and very powerful tool used in a
whole range of economic problems.
1
If it did not, then you can always increase your utility by consuming more of good that you
cant get enough of.
2
This is not a statement based on the idea that some consumers wish to save part of their
income. We can just think of savings as another good to be consumed. It is based on the idea that
the consumer should really always have the option to burn their money if they wish. For example,
suppose that there are only two goods in the economy: Beer and Family Guy DVDs. Both of these
goods are enjoyable in moderate quantities, but there comes a point at which consuming greater
quantities becomes painful. If we forced ourselves to use equality constraints, then we would be
denying the consumer the ability to stop purchasing these goods once they become tiresome (e.g.
a multi-millionare may be worse off than a guy with only $100 since the former would be forced to
consume vast quantities of beer and tiresome DVDs).
196