Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168733
Image: ubuntu2004
First we derive the hacker supply functions
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()
\frac{{{f_{2} q_{2}} {L_{1}}^{1 - \alpha} }}{f_{1}}
\frac{{{f_{1} q_{1}} {L_{2}}^{1 - \alpha} }}{f_{2}}
Then using the demand functions we get the optimal hacking levels
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()
<html><div class="math">\frac{{{p_{2}}^{\beta} A}}{{{f_{2} p_{1}} q_{2
/div>
\frac
}}} {{{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()
<html><div class="math">\frac{{{p_{1}}^{\beta} A}}{{{f_{1} p_{2}} q_{1
/div>
\frac
}}} From these we can derive some insightful expressions on the ratios L1/L2 and q1/q2.<br/> I will turn now to the firms' profit maximisation problem. <br/> 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()
{{{{{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} } }
solve([q1==q1.substitute(q2=sol2[0][1].right()).simplify_full()], q1)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/sage/sagenb/sage_notebook/worksheets/nagyv/1/code/8.py", line 7, in <module> exec compile(ur'solve([q1==q1.substitute(q2=sol2[_sage_const_0 ][_sage_const_1 ].right()).simplify_full()], q1)' + '\n', '', 'single') File "/home/sage/sage_install/sage-a/local/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/", line 1, in <module> File "/home/sage/sage_install/sage-a/local/lib/python2.5/site-packages/sage/calculus/equations.py", line 1563, in solve raise TypeError, "%s is not a valid variable."%v TypeError: alpha alpha - 1 beta - alpha beta alpha 1 - alpha f2 p1 p2 q2 A ---------------------------------------------------------- f1 is not a valid variable.
D1p = q1==A*(p2^(beta-alpha)/p1^(1-alpha*beta))^(1/(1+alpha))*f1^-1*f2^(-alpha/(1-alpha^2)) D1p.right().show()
\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} }} }}