ECOS3022 Tutorials 1 - Maths
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
ECOS3022 Tutorials
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)
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 = [3(2) 1(1)]. a\ or aT is the transpose of a and swaps the rows and
columns. Here we have
a\ = ( 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 · a\ 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 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) · [3(2) B · a\ = [3(2)
1(1)] =‘(1, − 1) · (2, 3), (1, − 1) · (1, 1)) = (2 − 3, 1 − 1) = ( −1, 0) 1(1)] · ( 1) = ) = ) = ( )2(1)
a · a\ = (1, − 1) ( 1) = 2
a\ · a = ( 1) (1, − 1) = ]
Q4 Derivatives
(a) f(x) = 3x2 =⇒ f\ (x) = 6x
(b) f(x) =北2(3) =⇒ f\ (x) = −6x−3
(c) f(x) = ae北 =⇒ f\ (x) = ae北
(d) f(x) = 1 −e北−x =⇒ f\ (x) = 北e −x 北(−)e −x (Quotient Rule) (e) f(x) = aln(x) =⇒ f\ (x) = a北
(f) f(x) = h(g(x)) =⇒ f\ (x) = g\ (x)h\ (g(x)) (Chain Rule)
(g) f(x,y) = 3x3 + y2 =⇒ f北 (x,y) = 9x2 , fy (x,y) = y (Partial Derivatives)
Q5 - Total Derivative
Take the budget p1 x1 + p2 x2 = w, how do we find the slope of the function x2 (x1 )? That is, how do we find d(d)北(北)1(2) ?
We take the total derivative of both sides, that is, the sum of all the partial derivatives. p1 dx1 + p2 dx2 = 0
We can then re-arrange this for
dx2 p1
dx1 p2
This is a result you should be quite familiar with.
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
xAdA + xBdB = M
(a) What is the optimal bundle that she will choose?
The constrained optimisation problem she solves is
max u(xA ‘xB ) s.t xAdA + xBdB = M
xA ,xB
We write out our Lagrangian
L = ln(1 + xA ) + ln(1 + xB ) − Y(xAdA + xBdB − M)
Taking the partial derivatives
LxA = − YdA = 0
LxB = − YdB = 0
Lλ = xAdA + xBdB − M = 0
Solve the first two simultaneously to remove the Y and we get
dA 1 + xB
dB 1 + xA
We can then solve the above simultaneously with the budget constraint
xA = [ − 1]
xB = [ − 1]
(b) What is the effect of the budget constraint? We know that
∂u(x∗ ) ∂L (x∗ ‘Y)
∂M ∂M
If we take the partial of the Lagrangian with respect to M, we get that
∂u(x∗ ) ∂L (x∗ ‘Y)
∂M ∂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 effect of income on the the optimal level of utility.
Using the first order conditions we have found we can solve for lambda
λ =
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
(3) Lagrangian. The optimisation problem she solves is
max xy s.t. x + y = 50
北,y
We can write the Lagrangian
L = xy − λ(x + y − 50)
(4) First Order Conditions
L北 = y − λ = 0 (1) Ly = x − λ = 0 (2) Lλ = x + y − 50 = 0 (3)
(5) So clearly we have x∗ = y ∗ = λ = 25.
2022-09-17