Starting from:

$24.99

COO-MTH377 Coding Assignment 2 Solution

Instructions
2. Please upload your code as a jupyter notebook on Google Classrooom. Written work, if any, should be scanned as a pdf and then uploaded. You should preferably do your written work in the same jupyter notebook using markdown cells.
3. Please run your code and show the output by printing meaningful output statements.
4. Readability of code is a criterion for grading. So write code with ample comments.
5. You need the CVXPY package for the first two problems. Go and spend some time on www.cvxpy.org to familiarize yourself with the package and the syntax.
Prisoners’ Dilemma as a Bargaining Problem
The Prisoners’ Dilemma is a famous model for illustrating the conflict between social cooperation and self-interested behavior. Consider a two player Prisoners’ Dilemma in which the cooperative payoff possibilities are mathematically described by a polytope which is defined as the convex hull of the payoff vectors (4,4), (6,0), (0,6) and (0,0). Suppose we think of the Prisoners’ Dilemma as a bargaining situation where the disagreement point is d = (d1,d2). The notion of a disagreement point introduces a constraint that player i cannot get a payoff below her disagreement point payoff di.
Whether or not you want to invest in understanding this model, you can always start your work taking as given that the feasible set F of payoff vectors (u1,u2) for the bargaining problem is mathematically described as
u1 + 2u2 ≤ 12 2u1 + u2 ≤ 12 u1 ≥ d1, u2 ≥ d2
Problem 1 (5 points). (Linear optimization using CVXPY). Use the CVXPY package to do this problem.
Suppose the disagreement point is given by d = (3.5,2). A weighted utilitarian criterion is defined as
W(u1,u2) = θu1 + (1 − θ)u2 where θ ∈ [0,1]
The weighted utilitarian solution of the bargaining problem, defined as
max W(u1,u2) such that (u1,u2) ∈F
u1,u2
Plot player 1’s utilitarian optimum u1(θ) as the weight θ varies in [0,1].
Problem 2. (8 points). (Convex optimization using CVXPY). Use the CVXPY package to do this problem.
Suppose the disagreement point is given by d = (3.5,2). A Nash welfare criterion is defined as
N(u1,u2) = log(u1 − d1) + log(u2 − d2)
Find the Nash bargaining solution of the bargaining problem, defined as
such that (u1,u2) ∈F
(a) (4 points). In addition to displaying the Nash bargaining solution, display the primaloptimal value and the optimal dual variables for the constraints as well.
(b) (4 points). (Comparative statics). Now fix the disagreement payoff of player 2 at d2 = 2. In the same figure, plot how both players’ payoffs in the Nash bargaining solution vary as the disagreement payoff d1 of player 1 varies over the interval [2,5].
Problem 3. (7 points). (Convex optimization using interior point algorithm). You cannot use the CVXPY package here. Please implement the algorithm.
Suppose the disagreement point is given by d = (2,1). Solve Problem 2(a) by implementing the interior point algorithm that uses log barrier for inequality constraints. Display the following
(i) initial t and final t
(ii) Nash bargaining solution
(iii) primal optimal value (Maximized Nash welfare)
(iv) dual optimal variables for constraints
(v) inequality constraint function values at the optimum

More products