// Numbas version: exam_results_page_options {"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.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Consider a firm with cost function \\[ C: \\mathbb{R}^+ \\to \\mathbb{R} : q \\mapsto C(q) = \\simplify[]{{a}*q^3-{b}*q^2+{c}*q+{d}} \\]

", "advice": "

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

\n

c) 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}}\\]

\n

d) 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}} . \\]

\n

This first order derivative equals 0 at the values \\( q_1 = \\var{q1} \\) and  \\( q_2 = \\var{q2} \\).

\n

Since

\n

\\[ \\frac {d^2 W}{dq^2} (q) =  \\simplify[]{{-6*a}*q+{2*b}} \\]

\n

it follows

\n

\\[ \\frac {d^2 W}{dq^2} (\\var{q1}) =  \\var{-6*a*q1+2*b} > 0  \\]

\n

and

\n

\\[ \\frac {d^2 W}{dq^2} (\\var{q2}) =  \\var{-6*a*q2+2*b} < 0 . \\]

\n

This implies that the pofit is maximal at \\( q = \\var{q2} \\).

\n

\n

e) \\( W( \\var{q2}) =  \\var{-a*q2^3+b*q2^2+(prijs-c)*q2-d}\\)

\n

Graph of the profit function:

\n

{ShowWinst()}

\n

\n

\n

f) The startup/shutdown price is the minimal value of the average variable cost function: 

\n

\\[ p_{startup/shutdown} = min \\,  AVC ,\\]

\n

where \\( AVC(q) \\) equals the total variable cost divided by \\( q \\):

\n

\\[ AVC(q) = \\frac {TVC(q)} {q} .\\]

\n

In this problem

\n

\\[ AVC(q) = \\simplify[]{{a}*q^2-{b}*q+{c}} \\]

\n

has as derivative

\n

\\[ \\frac {dAVC}{dq} (q) = \\simplify[]{{2*a}*q-{b}} .\\]

\n

This derivative is equal to 0 at

\n

\\[ q = \\simplify[all,FractionNumbers]{{b}/{2*a}} .\\]

\n

This 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}} ,\\]

\n

such that rounded up to 2 decimals \\(  p_{startup/shutdown} \\) is given by

\n

\\[  \\simplify[]{{a*(b/(2*a))^2-b*(b/(2*a))+c}} .\\]

\n

Graphs of MC , AC and AVC :

\n

{ShowKosten()}

", "rulesets": {}, "extensions": ["jsxgraph"], "variables": {"topCy": {"name": "topCy", "group": "Ungrouped variables", "definition": "a*grensq^3-b*grensq^2+c*grensq+d", "description": "", "templateType": "anything"}, "grensy": {"name": "grensy", "group": "Ungrouped variables", "definition": "2*a*s^2+2*s*t+d", "description": "", "templateType": "anything"}, "startupprijs": {"name": "startupprijs", "group": "Ungrouped variables", "definition": "c-b^2/(4*a)", "description": "", "templateType": "anything"}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "templateType": "anything"}, "prijs": {"name": "prijs", "group": "Ungrouped variables", "definition": "3*a*v^2+t", "description": "", "templateType": "anything"}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "random(3..10)", "description": "", "templateType": "anything"}, "grensq": {"name": "grensq", "group": "Ungrouped variables", "definition": "2*s", "description": "

grensq

", "templateType": "anything"}, "q1": {"name": "q1", "group": "Ungrouped variables", "definition": "s-v", "description": "

q1

", "templateType": "anything"}, "qstup": {"name": "qstup", "group": "Ungrouped variables", "definition": "b/(2*a)", "description": "", "templateType": "anything"}, "onderaan": {"name": "onderaan", "group": "Ungrouped variables", "definition": "-a*q1^3+b*q1^2+(prijs-c)*q1-d-20", "description": "", "templateType": "anything"}, "q2": {"name": "q2", "group": "Ungrouped variables", "definition": "s+v", "description": "", "templateType": "anything"}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "3*a*s^2+t", "description": "", "templateType": "anything"}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "10*random(1..8)", "description": "", "templateType": "anything"}, "bovenaan": {"name": "bovenaan", "group": "Ungrouped variables", "definition": "-a*q2^3+b*q2^2+(prijs-c)*q2-d+20", "description": "", "templateType": "anything"}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "random(ceil(s/2)..s-1)", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "templateType": "anything"}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "3*a*s", "description": "", "templateType": "anything"}}, "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});\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});\nxaxis.removeAllTicks();\nyaxis.removeAllTicks();\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});\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\nxaxis.removeAllTicks();\nyaxis.removeAllTicks();\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, "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, "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} € .

\n

What 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, "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, "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, "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", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{startupprijs}", "answerSimplification": "all,FractionNumbers", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": []}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{startupprijs}", "maxValue": "{startupprijs}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Paul Verheyen", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3610/"}, {"name": "Dirk Janssens", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3705/"}]}]}], "contributors": [{"name": "Paul Verheyen", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3610/"}, {"name": "Dirk Janssens", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3705/"}]}