// Numbas version: finer_feedback_settings {"name": "Cost and profit functions", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Cost and profit functions", "tags": [], "metadata": {"description": "
Calculate the marginal and average cost for a given cost function. Find the corresponding startup/shutdown price.
Maximize the profit function at a given price.
a) en b) From the expression \\[ C(q) = \\simplify[]{{a}*q^3-{b}*q^2+{c}*q+{d}}\\] we get the marginal cost
\n\\[ MC(q) = \\frac {dC}{dq} (q) =\\simplify[]{{3*a}*q^2-{2*b}*q+{c}}\\] and the average cost
\n\\[ AC(q) = \\frac {C(q)}{q} = \\simplify[]{{a}*q^2-{b}*q+{c}+{d}/q} .\\]
\n\nc) The profit equals the difference of the revenues and the costs:
\n\\[ W(q) = R(q) - C(q) = \\var{prijs} \\cdot q - \\left( \\simplify[]{{a}*q^3-{b}*q^2+{c}*q+{d}} \\right) = \\simplify[]{{-a}*q^3+{b}*q^2+{prijs-c}*q-{d}}\\]
\nd) In order to maximize the profit, the derivative of \\( W \\) with respect to \\( q \\) must be equal to 0:
\n\\[ \\frac {dW}{dq} (q) = \\simplify[]{{-3*a}*q^2+{2*b}*q+{prijs-c}} . \\]
\nThis first order derivative equals 0 at the values \\( q_1 = \\var{q1} \\) and \\( q_2 = \\var{q2} \\).
\nSince
\n\\[ \\frac {d^2 W}{dq^2} (q) = \\simplify[]{{-6*a}*q+{2*b}} \\]
\nit follows
\n\\[ \\frac {d^2 W}{dq^2} (\\var{q1}) = \\var{-6*a*q1+2*b} > 0 \\]
\nand
\n\\[ \\frac {d^2 W}{dq^2} (\\var{q2}) = \\var{-6*a*q2+2*b} < 0 . \\]
\nThis implies that the pofit is maximal at \\( q = \\var{q2} \\).
\n\ne) \\( W( \\var{q2}) = \\var{-a*q2^3+b*q2^2+(prijs-c)*q2-d}\\)
\nGraph of the profit function:
\n{ShowWinst()}
\n\n\nf) The startup/shutdown price is the minimal value of the average variable cost function:
\n\\[ p_{startup/shutdown} = min \\, AVC ,\\]
\nwhere \\( AVC(q) \\) equals the total variable cost divided by \\( q \\):
\n\\[ AVC(q) = \\frac {TVC(q)} {q} .\\]
\nIn this problem
\n\\[ AVC(q) = \\simplify[]{{a}*q^2-{b}*q+{c}} \\]
\nhas as derivative
\n\\[ \\frac {dAVC}{dq} (q) = \\simplify[]{{2*a}*q-{b}} .\\]
\nThis derivative is equal to 0 at
\n\\[ q = \\simplify[all,FractionNumbers]{{b}/{2*a}} .\\]
\nThis value indeed leads to a minimum of \\( AVC \\), with
\n\\[ AVC \\left( \\simplify[all,FractionNumbers]{{b}/{2*a}} \\right) = \\simplify[all,FractionNumbers]{{a*(b/(2*a))^2-b*(b/(2*a))+c}} ,\\]
\nsuch that rounded up to 2 decimals \\( p_{startup/shutdown} \\) is given by
\n\\[ \\simplify[]{{a*(b/(2*a))^2-b*(b/(2*a))+c}} .\\]
\nGraphs of MC , AC and AVC :
\n{ShowKosten()}
", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"topCy": {"name": "topCy", "group": "Ungrouped variables", "definition": "a*grensq^3-b*grensq^2+c*grensq+d", "description": "", "templateType": "anything", "can_override": false}, "grensy": {"name": "grensy", "group": "Ungrouped variables", "definition": "2*a*s^2+2*s*t+d", "description": "", "templateType": "anything", "can_override": false}, "startupprijs": {"name": "startupprijs", "group": "Ungrouped variables", "definition": "c-b^2/(4*a)", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "templateType": "anything", "can_override": false}, "prijs": {"name": "prijs", "group": "Ungrouped variables", "definition": "3*a*v^2+t", "description": "", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "random(3..10)", "description": "", "templateType": "anything", "can_override": false}, "grensq": {"name": "grensq", "group": "Ungrouped variables", "definition": "2*s", "description": "grensq
", "templateType": "anything", "can_override": false}, "q1": {"name": "q1", "group": "Ungrouped variables", "definition": "s-v", "description": "q1
", "templateType": "anything", "can_override": false}, "qstup": {"name": "qstup", "group": "Ungrouped variables", "definition": "b/(2*a)", "description": "", "templateType": "anything", "can_override": false}, "onderaan": {"name": "onderaan", "group": "Ungrouped variables", "definition": "-a*q1^3+b*q1^2+(prijs-c)*q1-d-20", "description": "", "templateType": "anything", "can_override": false}, "q2": {"name": "q2", "group": "Ungrouped variables", "definition": "s+v", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "3*a*s^2+t", "description": "", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "10*random(1..8)", "description": "", "templateType": "anything", "can_override": false}, "bovenaan": {"name": "bovenaan", "group": "Ungrouped variables", "definition": "-a*q2^3+b*q2^2+(prijs-c)*q2-d+20", "description": "", "templateType": "anything", "can_override": false}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "random(ceil(s/2)..s-1)", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "3*a*s", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "s", "t", "grensq", "grensy", "b", "c", "d", "v", "prijs", "q1", "q2", "startupprijs", "bovenaan", "onderaan", "topCy", "qstup"], "variable_groups": [], "functions": {"ShowKosten": {"parameters": [], "type": "html", "language": "javascript", "definition": "//variables\nvar a = Numbas.jme.unwrapValue(scope.variables.a);\nvar b = Numbas.jme.unwrapValue(scope.variables.b);\nvar c = Numbas.jme.unwrapValue(scope.variables.c);\nvar d = Numbas.jme.unwrapValue(scope.variables.d);\nvar s = Numbas.jme.unwrapValue(scope.variables.s);\nvar v = Numbas.jme.unwrapValue(scope.variables.v);\nvar prijs = Numbas.jme.unwrapValue(scope.variables.prijs);\nvar grensq = Numbas.jme.unwrapValue(scope.variables.grensq);\nvar grensy = Numbas.jme.unwrapValue(scope.variables.grensy);\nvar qstup = Numbas.jme.unwrapValue(scope.variables.qstup); \n//make board\nvar div = Numbas.extensions.jsxgraph.makeBoard('600px','600px',\n{boundingBox:[-2,grensy,grensq+2,-30],grid: false,axis:true,keepaspectratio:false,\ndefaultAxes:{x:{ticks:{label:{visible:false}}},y:{ticks:{label:{visible:false}}}}});\n// boundingbox:[left, top, right, bottom]\nvar board = div.board;\n\n\txaxis = board.create('axis', [[0, 0], [1,0]], \n\t {name:'q', \n\t\t\twithLabel: true, \n\t\t\tlabel: {position: 'rt', // possible values are 'lft', 'rt', 'top', 'bot'\n\t\t\t\t\t offset: [-15, 10] // (in pixels)\n\t\t\t\t\t }\n\t\t\t});\n yaxis = board.create('axis', [[0, 0], [0, 1]], \n\t\t {name:'\u20ac', \n\t\t\twithLabel: true, \n\t\t\tlabel: {\n\t\t\t position: 'rt', // possible values are 'lft', 'rt', 'top', 'bot'\n\t\t\t offset: [-20, 0] // (in pixels)\n\t\t\t\t}\n\t\t\t});\n\n \nvar grafMC = board.create('functiongraph',\n [function(x){ return 3*a*x*x-2*b*x+c;},0,b/(2*a)], \n{strokeColor:\"red\",setLabelText:'MC',visible: true, strokeWidth: 2, dash:2, highlightStrokeColor: 'red'} \n ); \n\nvar grafMC2 = board.create('functiongraph',\n [function(x){ return 3*a*x*x-2*b*x+c;},b/(2*a),grensq+2], \n{strokeColor:\"red\",setLabelText:'MC',visible: true, strokeWidth: 4, highlightStrokeColor: 'red'} \n ); \n\nvar grafAC = board.create('functiongraph',\n [function(x){ return a*x*x-b*x+c+d/x;},0,grensq+2], \n{strokeColor:\"green\",setLabelText:'AC',visible: true, strokeWidth: 2, dash:2, highlightStrokeColor: 'green'} \n ); \nvar grafAVC = board.create('functiongraph',\n [function(x){ return a*x*x-b*x+c;},0,grensq+2], \n{strokeColor:\"blue\",setLabelText:'AVC',visible: true, strokeWidth: 4, highlightStrokeColor: 'blue'} \n ); \n\nreturn div;"}, "ShowWinst": {"parameters": [], "type": "html", "language": "javascript", "definition": "//variables\nvar a = Numbas.jme.unwrapValue(scope.variables.a);\nvar b = Numbas.jme.unwrapValue(scope.variables.b);\nvar c = Numbas.jme.unwrapValue(scope.variables.c);\nvar d = Numbas.jme.unwrapValue(scope.variables.d);\nvar s = Numbas.jme.unwrapValue(scope.variables.s);\nvar v = Numbas.jme.unwrapValue(scope.variables.v);\nvar prijs = Numbas.jme.unwrapValue(scope.variables.prijs);\nvar bovenaan = Numbas.jme.unwrapValue(scope.variables.bovenaan);\nvar onderaan = Numbas.jme.unwrapValue(scope.variables.onderaan);\nif(bovenaan>10) {bovengrens = bovenaan} else {bovengrens = 50};\n\n\n//make board\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n{boundingBox:[-3,bovengrens,s+v+5,onderaan],grid: false,axis:true,keepaspectratio:false,\ndefaultAxes:{x:{ticks:{label:{visible:false}}},y:{ticks:{label:{visible:false}}}}});\n// boundingbox:[left, top, right, bottom]\nvar board = div.board;\n\n\txaxis = board.create('axis', [[0, 0], [1,0]], \n\t {name:'q', \n\t\t\twithLabel: true, \n\t\t\tlabel: {position: 'rt', // possible values are 'lft', 'rt', 'top', 'bot'\n\t\t\t\t\t offset: [-15, 10] // (in pixels)\n\t\t\t\t\t }\n\t\t\t});\n yaxis = board.create('axis', [[0, 0], [0, 1]], \n\t\t {name:'\u20ac', \n\t\t\twithLabel: true, \n\t\t\tlabel: {\n\t\t\t position: 'rt', // possible values are 'lft', 'rt', 'top', 'bot'\n\t\t\t offset: [-20, 0] // (in pixels)\n\t\t\t\t}\n\t\t\t});\n\n\nvar grafiek = board.create('functiongraph',\n [function(x){ return -a*x*x*x+b*x*x+(prijs-c)*x-d},0,s+v+5], \n{strokeColor:\"green\",setLabelText:'Winst',visible: true, strokeWidth: 4, highlightStrokeColor: 'green'} \n ); \n\nreturn div;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Determine the marginal cost function:
\n\\( MC(q) = \\) [[0]]
", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{3*a} *q^2 +{-6*a*s}*q+{3*a*s^2+t}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "q", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Write down a formula for the average cost function:
\n\\( AC(q) = \\) [[0]]
", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{a}*q^2-{b}*q+{c}+{d}/q", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "q", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Suppose this firm operates in a market of perfect competition, where the corresponding product is sold at a unit price {prijs} € .
\nWhat is the profit function?
\n\\( W(q) = \\) [[0]]
", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{-a}q^3+{3*a*s}q^2+{{prijs}-3*a*s^2-t}q+{-d}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "q", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "This firm wants to maximize its profits. Which value of \\( q \\) leads to a maximum profit?
\n[[0]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "3", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "s+v", "maxValue": "s+v", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "What is the value of this maximum profit?
\n[[0]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{-a*q2^3+b*q2^2+(prijs-c)*q2-d}", "maxValue": "{-a*q2^3+b*q2^2+(prijs-c)*q2-d}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Calculate the startup/shutdown price for this firm. Formulate the answer
\n