︠e8c1f699-cfcd-4818-acae-0dfc2c4ed21di︠ %html First we derive the hacker supply functions ︡a691355c-02b3-4da6-bdf1-417bb9d3cf9f︡{"html": "First we derive the hacker supply functions"}︡ ︠c39399e4-2314-4b63-9481-d6295a6b0e8a︠ reset() var('L1 L2 q1 q2 f1 f2 A alpha beta p1 p2') assume(alpha>0) assume(alpha<1) assume(beta>0) assume(beta<1) S1 = solve([L1^(alpha-1) == q2*f2/(q1*f1)], q1)[0] S2 = solve([L2^(alpha-1) == q1*f1/(q2*f2)], q2)[0] S1.right().show() S2.right().show() ︡3152a03c-c061-43a1-afbd-f5aa585d7374︡{"html": "
\\frac{{{f_{2} q_{2}} {L_{1}}^{1 - \\alpha} }}{f_{1}}
"}︡{"html": "
\\frac{{{f_{1} q_{1}} {L_{2}}^{1 - \\alpha} }}{f_{2}}
"}︡ ︠8c7f9fb6-d65b-4fe1-a6ca-a761905d8638i︠ %html Then using the demand functions we get the optimal hacking levels ︡0fe5b0b1-6dfb-4f0e-81ce-c0986129bfe8︡{"html": "Then using the demand functions we get the optimal hacking levels"}︡ ︠46f90044-ce17-496e-be88-4b8d16055310︠ D1 = q1 == A*(L1^alpha*f1)^-1*p2^beta/p1 sol1 = solve([S1, D1], L1, q1) L1 = sol1[0][0].right() q1 = sol1[0][1].right() L1.show() q1.show() ︡95841781-a67f-427c-8df2-4bf63d882f1b︡{"stdout": "
\\frac{{{p_{2}}^{\\beta} A}}{{{f_{2} p_{1}} q_{2"}︡ ︠6e50599c-04a4-4941-99a1-8c80365ccbddi︠ %html /div>
\frac ︡d57dc6e1-3e06-40b5-959c-26ec64c8c7d3︡{"html": "/div>\n
\\frac"}︡ ︠0905dd73-6006-4228-ac0c-44fc4ed90b0e︠ }}} {{{id=13| D2 = q2 == A*(L2^alpha*f2)^-1*p1^beta/p2 sol2 = solve([S2, D2], L2, q2) L2 = sol2[0][0].right() q2 = sol2[0][1].right() L2.show() q2.show() ︡e5ff0756-09a5-4421-84f1-f42f7750e16b︡{"stdout": "
\\frac{{{p_{1}}^{\\beta} A}}{{{f_{1} p_{2}} q_{1"}︡ ︠ee0eed1e-9a55-44d8-b706-f82dc32f26eci︠ %html /div>
\frac ︡a551e150-9260-41f1-a7f2-c9a1f6b60eb6︡{"html": "/div>\n
\\frac"}︡ ︠093d51e1-99bb-472b-8f97-6f27c2aa61a9︠ }}} From these we can derive some insightful expressions on the ratios L1/L2 and q1/q2.
I will turn now to the firms' profit maximisation problem.
For some reason maxima fails to express q1(p1,p2) after substituting q2 from above. But we can easily do it by hand. This is the demand after the substitution. Of what we will express q1. {{{id=14| q1.substitute(q2=sol2[0][1].right()).simplify_full().show() ︡79eaea9c-e0fb-46ce-95ae-cc7ca09be9de︡{"html": "
{{{{{f_{1}}^{{\\alpha}^{2} - 1} {p_{1}}^{{\\left( \\alpha - {\\alpha}^{2} \\right) \\beta} + \\alpha - 1} } {p_{2}}^{{\\left( 1 - \\alpha \\right) \\beta} + {\\alpha}^{2} - \\alpha} } {q_{1}}^{{\\alpha}^{2} } } {A}^{1 - {\\alpha}^{2} } }
"}︡ ︠df7c01cd-7178-440d-b5e9-a189a473d4be︠ solve([q1==q1.substitute(q2=sol2[0][1].right()).simplify_full()], q1) ︡bbec961c-ac39-4c1d-ab85-dc81f72f6310︡{"stderr": "Traceback (most recent call last):\n File \"\", line 1, in \n File \"/home/sage/sagenb/sage_notebook/worksheets/nagyv/1/code/8.py\", line 7, in \n exec compile(ur'solve([q1==q1.substitute(q2=sol2[_sage_const_0 ][_sage_const_1 ].right()).simplify_full()], q1)' + '\\n', '', 'single')\n File \"/home/sage/sage_install/sage-a/local/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/\", line 1, in \n \n File \"/home/sage/sage_install/sage-a/local/lib/python2.5/site-packages/sage/calculus/equations.py\", line 1563, in solve\n raise TypeError, \"%s is not a valid variable.\"%v\nTypeError: \n alpha alpha - 1 beta - alpha beta alpha 1 - alpha\n f2 p1 p2 q2 A\n ----------------------------------------------------------\n f1 is not a valid variable."}︡ ︠dcba9507-9d2b-42ab-b2a9-bc953a4e61ba︠ D1p = q1==A*(p2^(beta-alpha)/p1^(1-alpha*beta))^(1/(1+alpha))*f1^-1*f2^(-alpha/(1-alpha^2)) D1p.right().show() ︡2d708cfd-6112-41f6-92a4-523b8068f2aa︡{"html": "
\\frac{{{\\left( {{p_{1}}^{{\\alpha \\beta} - 1} {p_{2}}^{\\beta - \\alpha} } \\right)}^{\\frac{1}{\\alpha + 1}} A}}{{f_{1} {f_{2}}^{\\frac{\\alpha}{1 - {\\alpha}^{2} }} }}
"}︡