ECOS3022-无代写
时间:2023-03-20
ECOS3022 Tutorials
Joshua Wong
Overview
• Each tutorial is based on the material from the lecture in the previous week.
• Course content does often build on the understanding of earlier course content.
• A certain level of maths proficiency is assumed. In particular, derivatives, simultaneous
equations, basic matrix and vector operations.
• The tutorial is most e↵ective when you ask questions when you have one.
• Outside the tutorial, please use Ed for questions.
Tutorial 1 - Maths
Overview
• Basic operations on vectors and matrices.
• Constrained optimisation.
Q1 - Vector Operations
We have that a = (1, 2) and b = (1, 0), what do these look like plotted?
Let c = a+ b and d = b a, how do we do subtraction and addition of vectors? We subtract
and add the components.
c = (1 + 1, 2 + 0) = (2, 2), d = (1 1, 0 2) = (0,2)
1
How does one do multiplication in vectors? One type is the scalar product (aka the dot
product), so called because the answer will be a scalar and not a vector. We multiply
component wise and then sum.
a · b = 1 ⇤ 1 + 2 ⇤ 0 = 1
a · c = 1 ⇤ 2 + 2 ⇤ 2 = 6
b · c = 2
d · c = 4
b · d = 0
We can then say that b and d are orthogonal because their dot product is zero. In two-
dimensions orthogonal just means at 90 degrees to each other.
Q2 - More Vector Operations
Let a = (1, 2, 3) and b = (2,1, 3), find c = a+ b and d = a b as well as a · b, a · c and b · c.
c = (1 + 2, 2 1, 3 + 3) = (3, 1, 6), d = (1 2, 2 + 1, 3 3) = (1, 3, 0)
a · b = (1 ⇤ 2) + (2 ⇤ 1) + (3 ⇤ 3) = 9
a · c = (1 ⇤ 3) + (2 ⇤ 1) + (3 ⇤ 6) = 23
b · c = (2 ⇤ 3) + (1 ⇤ 1) + (3 ⇤ 6) = 23
Q3 - Matrix Multiplication
Let a = (1,1) and B =

2 1
3 1

. a0 or aT is the transpose of a and swaps the rows and
columns. Here we have
a0 =

1
1

When we multiply matrices the operation is not commutative which is to say that the order
of the elements matters. The number of columns in the first matrix must equal the number
of rows in the second for the operation to work.
The result will have the number of rows of the first matrix and the number of coloumns in
the second. Here a · B will have one row and two column, while B · a0 will have two rows
and one column.
Each entry of the result is the dot product of a row from the first matrix and a column from
2
the second. Which rows and columns we use is determined by that entry’s position in the
resultant matrix. If the entry is in the 2nd row and 1st column then we take the 2nd row
from the first matrix and the 1st column from the second matrix.
a · B = (1,1) ·

2 1
3 1

=

(1,1) · (2, 3), (1,1) · (1, 1) = (2 3, 1 1) = (1, 0)
B · a0 =

2 1
3 1

·

1
1

=

(2, 1) · (1,1)
(3, 1) · (1,1)

=

2 ⇤ 1 1
3 ⇤ 1 1

=

1
2

a · a0 = (1,1)

1
1

= 2
a0 · a =

1
1

(1,1) =

1 1
1 1

Q4 Derivatives
(a) f(x) = 3x2 =) f 0(x) = 6x
(b) f(x) = 3x2 =) f 0(x) = 6x3
(c) f(x) = aex =) f 0(x) = aex
(d) f(x) = 1e
x
x =) f 0(x) = xe
x1+ex
x2 (Quotient Rule)
(e) f(x) = a ln(x) =) f 0(x) = ax
(f) f(x) = h(g(x)) =) f 0(x) = g0(x)h0(g(x)) (Chain Rule)
(g) f(x, y) = 3x3 + 12y
2 =) fx(x, y) = 9x2, fy(x, y) = y (Partial Derivatives)
Q5 - Total Derivative
Take the budget p1x1 + p2x2 = w, how do we find the slope of the function x2(x1)? That is,
how do we find dx2dx1 ?
We take the total derivative of both sides, that is, the sum of all the partial derivatives.
p1dx1 + p2dx2 = 0
We can then re-arrange this for
dx2
dx1
= p1
p2
This is a result you should be quite familiar with.
3
Q6 - Optimisation with Equality Constraints
You will certainly get an optimisation question in the exam and it will certainly be worth a
lot of marks.
The process: (1) Objective function (2) Budget Constraint (3) Lagrangian (4) First-order
Conditions (5) Simultaneous Equations
Let there be two goods for the consumer, A and B and let xi be the amount of good i that
is demanded. Let the consumer’s utility be
u(xA, xB) = ln(1 + xA) + ln(1 + xB)
and let M be the consumer’s income. Her budget constraint is then
xApA + xBpB = M
(a) What is the optimal bundle that she will choose?
The constrained optimisation problem she solves is
max
xA,xB
u(xA, xB) s.t xApA + xBpB = M
We write out our Lagrangian
L = ln(1 + xA) + ln(1 + xB) (xApA + xBpB M)
Taking the partial derivatives
LxA =
1
1 + xA
pA = 0
LxB =
1
1 + xB
pB = 0
L = xApA + xBpB M = 0
Solve the first two simultaneously to remove the and we get
pA
pB
=
1 + xB
1 + xA
4
We can then solve the above simultaneously with the budget constraint
xA =
1
2

M + pB
pA
1

xB =
1
2

M + pA
pB
1

(b) What is the e↵ect of the budget constraint? We know that
@u(x⇤)
@M
=
@L (x⇤,)
@M
If we take the partial of the Lagrangian with respect to M, we get that
@u(x⇤)
@M
=
@L (x⇤,)
@M
=
You will not be assessed on proving this result, however working is on Canvas for those
interested. What is important is understanding what this result means, it tells us that
the Lagrange multiplier represents the e↵ect of income on the the optimal level of
utility.
Using the first order conditions we have found we can solve for lambda
=
2
M + pB + pA
There is going to be a lot of constrained optimisation in this course and so with each week
I’m going to assume you’re more and more familiar with this process.
Q7
Someone has 100m of fencing and wishes to know the maximum area she can fence in with
a rectangle.
(1) What is the objective? Let x and y be the dimensions of the rectangle, the area she
wants to maximise is then A = xy. We have our objective
(2) What is the BC? The perimeter of the rectangle must be less than 100m, we can deduce
pretty easily that she will use all of the fencing
2x+ 2y = 100() x+ y = 50
5
(3) Lagrangian. The optimisation problem she solves is
max
x,y
xy s.t. x+ y = 50
We can write the Lagrangian
L = xy (x+ y 50)
(4) First Order Conditions
Lx = y = 0 (1)
Ly = x = 0 (2)
L = x+ y 50 = 0 (3)
(5) So clearly we have x⇤ = y⇤ = = 25.
Q8 - Please do in your own time
essay、essay代写