# OK to post homework # Vikrant, Feb 06 2022, Assignment 4 # ================================================================================ # 0. Code that has been given. # ================================================================================ read("C4.txt"): # ================================================================================ # 1. Samples from Garvan's Maple Primer. # ================================================================================ (* with(linalg): A:= matrix(2,2,[1,2,3,4]); A+A; evalm(%); 3*A; evalm(%); A^2; evalm(%); evalm(A&*inverse(A)); gausselim(A); gaussjord(A); eigenvals(A); jordan(A,`P`); print(P); B:= matrix(2,4,[1,2,3,4,5,6,7,8]); rank(B); rowspace(B); colspace(B); nullspace(B); *) # ================================================================================ # 2. Read and understand C4.txt. # Confirm BRij with PureNashEqui for three games. # ================================================================================ (* randomize(614900547): for i from 1 to 3 do G:= RandDisGame(30,30): print(PureNashEqui(G) subset {seq(seq([x,y], x in FP(BR12(G))), y in FP(BR21(G)))}): od: *) # ================================================================================ # 3. Read and understand 2.1B of Gibbons. # ================================================================================ # Done. # ================================================================================ # 4. Read and understand 1.2A of Gibbons. # ================================================================================ # Done. # ================================================================================ # 5. Total profit maximization. # ================================================================================ (* # I'd choose monopoly, where both firms agree to produce A/4 goods each (i.e. A/2 goods produced in total). # Since the price for each good is the same regardless of who sells it, we want to be maximizing # [Total Quantity of Goods]*[Price Per Good] = [q_1+q_2]*[A-(q_1+q_2)]. # The total profit is thus maximized when q_1+q_2 = A/2. # No such solution results in a Nash Equilibrium, however. # Informal proof by picture (the area of region P_i is the profit of firm i): (* <----A/2----> ^ ___________ ^ | | | | q_1 | P_1 | | | |___________| A/2 x | P_2 | | q_2 |___________| | v v *) # From the picture we can see that firm i will want to square-ify their region with q_i + A/2 semiperimeter; # that is, firm i will increase their quantity of goods produced to (q_i + A/2)/2 in order to maximize the area of the region P_i. *) # ================================================================================ # 6. Quantity to produce when price is (A-q)^d. # ================================================================================ (* # (i) Monopoly # Solves to q = A/(d+1), which is in [0,A] and so feasible. solve(diff(q*(A-q)^d,q)=0,q); # Testing the endpoints 0 and A, we conclude that q = A/(d+1) maximizes profit. *) (* # (ii) Stackelberg Duopoly # Repeating the result for monopoly in a backwards induction fashion, we get: # q_1 = A/(d+1) and q_2 = dA/(d+1)^2. *) (* # (iii) Cournot Duopoly # Solves to q_1 = q_2 = A/(d+2), which is in [0,A] and so feasible. solve({diff(q__1*(A-q__1-q__2)^d,q__1)=0,diff(q__2*(A-q__1-q__2)^d,q__2)=0},{q__1,q__2}); *) # ================================================================================ # oo. Helpers from past homeworks. # ================================================================================ IsNash:= proc(G,a1,a2) a1 = BR1d(G,a2) and a2 = BR2d(G,a1): end: PureNashEqui:= proc(G) local i,j: {seq(seq(`if`(IsNash(G,i,j),[i,j],NULL),j=1..nops(G[i])),i=1..nops(G))}: end: