{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"## TV Manufactoring Problem Unconstraint\n",
"## Variables\n",
"$x = $number of 19 in sets\n",
"\n",
"$y = $number of 21-in sets\n",
"\n",
"$c_x = $ cost of manufacturing 19 in sets\n",
"\n",
"$c_y = $ cost of manufacturing 21 in sets\n",
"\n",
"$c_{tot} = $ total cost\n",
"\n",
"$s_x = $ selling price of 19 in sets \n",
"\n",
"$s_y = $ selling price of 21 in sets\n",
"\n",
"$R = $ revenue\n",
"\n",
"$ P = $ profit\n",
"\n",
"## Assumptions\n",
"\n",
"$x\\geq 0, y\\geq 0$\n",
"\n",
"$c_x = 195x$\n",
"\n",
"$c_y = 225y$\n",
"\n",
"$c_{tot} = 400,000 + c_x +c_y$\n",
"\n",
"$s_x = 339-0.01x -0.003y$\n",
"\n",
"$s_y = 399 - 0.01y - 0.004x$\n",
"\n",
"$R = x\\cdot s_x + y\\cdot s_y$\n",
"\n",
"$P = R - c_{tot}$\n",
"\n",
"### Objective \n",
"\n",
"Maximize P"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"cx(x, y) = 195*x\n",
"cy(x, y) = 225*y\n",
"ctot(x,y) = 400000 + cx(x,y) + cy(x,y)\n",
"sx(x, y) = 339 - 0.01*x -0.003*y# sellin price of 19-inch\n",
"sy(x, y) = 399 -0.01*y - 0.004*x\n",
"R(x, y) = x*sx(x, y) + y*sy(x, y)\n",
"P(x, y) = R(x,y) - ctot(x,y)\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "5821c6dd02fb1e05073c8f8f7fe0ff4494747aa1"
}
}
],
"source": [
"contour_plot(P(x,y),(x, 0, 10000),(y,0, 10000))"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"We find all points $(x,y)$ with $\\frac{dP}{dx} =0$ and $\\frac{dP}{dy} =0$"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"eq = solve([diff(P(x,y),x)==0, diff(P(x,y),y)==0],x,y)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
]
},
"execution_count": 4,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"show(eq)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"4735.04273504274"
]
},
"execution_count": 5,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"n(eq[0][0].rhs())"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"7042.73504273504"
]
},
"execution_count": 6,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"n(eq[0][1].rhs())"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"## Maximum Profit"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"553641.025641026"
]
},
"execution_count": 7,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"P(eq[0][0].rhs(),eq[0][1].rhs())"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"sensitivity of $x$ and $y$ to the elasticity of the 19 in sets and 21 inch sets"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"\n",
"sxa(x,y,a) = 339 - a*x -0.003*y\n",
"Ra(x,y,a) = x*sxa(x, y,a) + y*sy(x, y)\n",
"Pa(x,y,a) = Ra(x,y,a) - ctot(x,y)\n"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"eq_1 = solve([diff(Pa(x,y,a),x)==0,diff(Pa(x,y,a),y)==0,],x,y)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
]
},
"execution_count": 10,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"show(eq_1)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"xa = eq_1[0][0].rhs()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
]
},
"execution_count": 12,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"show(xa)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
]
},
"execution_count": 13,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"sxa(a)= xa.diff(a)*a/xa\n",
"show(sxa(.01))"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"Our computations suggest that we should expect a 1.14% decrease in manufacturing of 19 in monitors for every 1% increase in the elasticity coefficient for 19 in monitors."
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"ya = eq_1[0][1].rhs()"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
]
},
"execution_count": 15,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"show(ya)\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
]
},
"execution_count": 16,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"sya(a)= ya.diff(a)*a/ya\n",
"show((sya(.01)))"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"Our computations suggest that we should expect a 2.7% decrease in manufacturing of 21 in monitors for every 1% increase in the elasticity coefficient for 21 in monitors."
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"#### Computing the sensitivity of the maximum profit with respect to the elasticity of the 19 inch monitors\n"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"pmax(a) = Pa(xa,ya,a)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
]
},
"execution_count": 18,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"show(pmax)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"-0.404966912932827"
]
},
"execution_count": 19,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"spmax = pmax.diff(a)*a/pmax\n",
"spmax(0.01)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"#### Sensitivity of the maximum profit using the chain rule (Alternate method)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"-x^2"
]
},
"execution_count": 20,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"diff(Pa(x,y,a),a)"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"-0.404966913401712"
]
},
"execution_count": 21,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"-eq[0][0].rhs()^2*0.01/(553641.025)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"#Lagrange Multipliers Problem\n",
"#We reconsider the color TV problem (Example 2.1) introduced in the previous section. There we assumed that the company has the potential to produce any number of TV sets per year. Now we introduce constraints based on the available production capacity. \n",
"Consideration of these two products came about because the company plans to discontinue manufacture of some older models,\n",
"#thus providing excess capacity at its assembly plant. This excess capacity could be used to increase production of other existing product lines, but the company feels that the new products will be more profitable. It is estimated that the available\n",
"production capacity will be sufficient to produce 10,000 sets per year. The company has an ample supply of 19-inch and 21-inch LCD panels and other standard components; however, the circuit boards necessary for constructing the sets are currently in short supply. Also, the 19-inch TV requires a different board than the 21-inch models because of the internal configuration, which cannot be changed without a major redesign, which the company is not prepared to undertake at this time. The supplier is able to\n",
"supply 8,000 boards per year for the 21-inch model and 5,000 boards per year for the 19-inch model.\n",
"#1. Taking this information into account, how should the company set production levels?\n",
"#2.2 Lagrange Multiplier\n",
"cx(x, y) = 195*x\n",
"cy(x, y) = 225*y\n",
"ctot(x,y) = 400000 + cx(x,y) + cy(x,y)\n",
"sx(x, y) = 339 - 0.01*x -0.003*y\n",
"sy(x, y) = 399 -0.01*y - 0.004*x\n",
"R(x, y) = x*sx(x, y) + y*sy(x, y)\n",
"P(x, y) = R(x,y) - ctot(x,y)\n"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "0b9b4a7a5d942b0f56f4e4feda9c605e4a4c0365"
}
}
],
"source": [
"p1 = contour_plot(P(x,y),(x, 0, 10000), (y,0,10000))\n",
"p2 = implicit_plot(x==5000,(x,0,10000),(y,0,10000),color='red')\n",
"p3 = implicit_plot(y ==8000,(x,0,10000),(y,0,10000), color = 'blue')\n",
"p4 = implicit_plot(x+y ==10000,(x,0,10000),(y,0,10000),color='green')\n",
"show(p1 + p2+ p3 + p4)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"### Maximize $p$ subject to the constraint x = 5000."
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[[x == 5000, y == 6950, L1 == (-93/20)]]"
]
},
"execution_count": 24,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"L1 = var('L1')\n",
"solve([P.diff(x)==L1,P.diff(y)==0,x==5000],x,y,L1)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"#### The above point is outside of the feasible region and should not be used."
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[[x == 4400, y == 8000, L2 == (-84/5)]]"
]
},
"execution_count": 25,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"L2 = var('L2')\n",
"solve([P.diff(x)==0,P.diff(y)==L2,y==8000],x,y,L2)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"#### The above point is outside of the feasible region and should not be used."
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[[x == (50000/13), y == (80000/13), L3 == 24]]"
]
},
"execution_count": 27,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"L3 = var('L3') # Lambda values have an important meaning.\n",
"solve([P.diff(x)==L3,P.diff(y)==L3, x+y ==10000],x,y,L3)"
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"### The above point is a candidate for max"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"##### Maximize $P$ subject to the constraint x = 0"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[[x == 0, y == 8700, L4 == (831/10)]]"
]
},
"execution_count": 28,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"L4 = var('L4')\n",
"solve([P.diff(x)==L4, P.diff(y)==0, x== 0],x,y,L4)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"### The above point is outside of the feasible point"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"### Maximize P subject to the constraint y = 0."
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[[x == 7200, y == 0, L5 == (618/5)]]"
]
},
"execution_count": 29,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"L5 = var('L5')\n",
"solve([P.diff(x)==0, P.diff(y)==L5, y==0],x,y,L5)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"#### The solution to the unconstraint problem is outside of the feasible region"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"#### Test Points\n",
"(5000,0)\n",
"\n",
"(5000, 5000)\n",
"\n",
"(50,000/13, 80,000/13)\n",
"\n",
"(2000, 8000)\n",
"\n",
"(0, 8000)\n",
"\n",
"(0,0)\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
]
},
"execution_count": 7,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"show(P(50000/13, 80000/13))"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"70000.0000000000"
]
},
"execution_count": 8,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"P(5000,0)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"515000.000000000"
]
},
"execution_count": 9,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"P(5000,5000)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"488000.000000000"
]
},
"execution_count": 10,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"P(2000, 8000)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"352000.000000000"
]
},
"execution_count": 11,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"P(0, 8000)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"-400000.000000000"
]
},
"execution_count": 12,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"P(0,0)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"\n",
"\n",
"sxa(x, y,a) = 339 - a*x -0.003*y\n",
"sy(x, y) = 399 -0.01*y - 0.004*x\n",
"Ra(x, y,a) = x*sxa(x, y,a) + y*sy(x, y)\n",
"Pa(x, y,a) = Ra(x,y,a) - ctot(x,y)\n"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[[x == 50000/(1000*a + 3), y == 20000*(500*a - 1)/(1000*a + 3), La == -52*(500*a - 11)/(1000*a + 3)]]"
]
},
"execution_count": 31,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"La = var('La')\n",
"solve([Pa.diff(x)==La,Pa.diff(y)==La, x+y ==10000],x,y,La)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"xa(a)=50000/(1000*a + 3)"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"Sxa(a)= xa.diff(a)*a/xa"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"### The result below suggests that if $a$ increases by 10%, $x$ decreases by 7.7%"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"-0.769230769230769"
]
},
"execution_count": 17,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"Sxa(0.01) # If a goes up by 10%, x decreases by 7,7% "
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"ya(a)=20000*(500*a - 1)/(1000*a + 3) "
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"optimalP(a) = Pa(xa,ya,a)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"Spa(a) = optimalP.diff(a)*a/optimalP"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"#### The rsult below suggests that if $a$ increases by 10%, the maximum profit decreases by 2.8%"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"-0.277901289461984"
]
},
"execution_count": 21,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"Spa(0.01) # If \"a\" goes up 10%, profit will go down by 2.8%."
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"Sensitivity of the profit with respect to the condition $ x+y =10000$"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"L= var('L')\n",
"c = var('c')\n",
"sol = solve([P.diff(x)==L,P.diff(y)==L, x+y ==c],x,y,L)"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"pmaxc(c) = P(sol[0][0].rhs(), sol[0][1].rhs())"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"SPc(c) = pmaxc.diff(c)*c/pmaxc"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"0.450867052023121"
]
},
"execution_count": 25,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"SPc(10000)"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[[x == (100013/26), y == (160013/26), L3 == (47973/2000)]]"
]
},
"execution_count": 26,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"L3 = var('L3')\n",
"solve([P.diff(x)==L3,P.diff(y)==L3, x+y ==10001],x,y,L3)"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"532331.685557693"
]
},
"execution_count": 27,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"P(100013/26, 160013/26)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"##### $pmaxc(10001)-pmaxc(10000)/1 =dpmaxc/dc$"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"pmaxcdiff(c)= pmaxc.diff(c)"
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"24.0000000000000"
]
},
"execution_count": 29,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"pmaxcdiff(10000)# How much you're willing to pay to increase production?"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"Suppose now that we have the constraint x<= 3000\n"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"523000.000000000"
]
},
"execution_count": 31,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"P(3000, 7000)\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"488000.000000000"
]
},
"execution_count": 32,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"P(2000, 8000)"
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"collapsed": false,
"scrolled": true
},
"outputs": [
],
"source": [
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"Shadow price is to increase the c by one"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"to increase 19-inch by 1, you should'nt pay more than 22 dollars, to increase total production by one , you shouldn't pay more than $13."
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[[x == 3000, y == 7000, L1 == 22, L2 == 13]]"
]
},
"execution_count": 37,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"solve([P.diff(x)==L1 + L2, P.diff(y)==L2, x==3000, x+y==10000],x,y,L1,L2)"
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"\n"
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
]
}
],
"metadata": {
"kernelspec": {
"display_name": "SageMath 7.6",
"name": "sage-7.6"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.13"
}
},
"nbformat": 4,
"nbformat_minor": 0
}