// Numbas version: finer_feedback_settings {"name": "Elementair grafisch lineair programma 2026", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "feedback": {"showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showpartfeedbackmessageswhen": "always", "allowrevealanswer": true, "showexpectedanswerswhen": "inreview", "showadvicewhen": "inreview"}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Elementair grafisch lineair programma 2026", "tags": [], "metadata": {"description": "

Formuleer een eenvoudig tweedimensionaal LP en los op.

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

{business_long} ({business_short}) vervaardigt twee producten: {product_1} en {product_2}.

\n

Bestaande bestellingen eisen dat {business} dagelijks minimaal {xconstraint} {product_1s} en {yconstraint} {product_2s} produceert.

\n

Per eenheid {product_1} zijn {resource1x} {resource_1_units} {resource_1} en {resource2x} {resource_2_units} {resource_2} nodig.

\n

Elke eenheid {product_2} vereist {resource1y} {resource_1_units} {resource_1} en {resource2y} {resource_2_units} {resource_2}.

\n

Deze grondstoffen zijn echter schaars: {business} beschikt dagelijks slechts over {totalresource1} {resource_1_units} {resource_1} en {totalresource2} {resource_2_units} {resource_2}.

\n

De verkoop van één eenheid {product_1} levert £{profitx} winst. De verkoop van één eenheid {product_2} levert £{profity} winst.
Veronderstel dat elke geproduceerde eenheid ook verkocht wordt.

", "advice": "

a)

\n

Wegens de uitstaande bestellingen gelden de twee volgende voorwaarden, die strenger zijn dan  $x \\geq 0 $ en $y \\geq 0$:

\n

\\begin{align}
x &\\geq \\var{xconstraint} \\\\
y &\\geq \\var{yconstraint}
\\end{align}

\n

b)

\n

Uit de schaarsheid van de grondstoffen volgt:

\n

\\begin{align}
\\simplify{{resource1x}x + {resource1y}y} &\\leq \\var{totalresource1} \\\\
\\simplify{{resource2x}x + {resource2y}y} &\\leq \\var{totalresource2}
\\end{align}

\n

c)

\n

De doelfunctie wordt gegeven door:

\n

\\[ \\simplify{{profitx}x + {profity}y} \\]

\n

d)

\n

{oplossinggrafisch()}

\n

De minimale winst bekom je door net genoeg {product_1s} en {product_2s} te produceren zodat aan de reeds bestaande vraag (d.w.z. de al binnengekomen bestellingen) wordt voldaan. Als je de doelfunctielijn verschuift naar de doorsnede van de minimale te produceren hoeveelheden rechten, zie je inderdaad dat er geen andere punten gemeenschappelijk zijn met het aanvaardingsgebied onder deze doelfunctielijn.

\n

\n

Door de doelfunctielijn te verschuiven naar rechts, tot er hierboven geen punten meer uit het aanvaardbare gebied zichtbaar zijn, ontstaat de oplossing in de doorsnede van de nevenvoorwaarden corresponderend met de {line_names[best_lines[0]]} en {line_names[best_lines[1]]}.

\n

De oplossing van het stelsel:

\n

\\[ \\simplify{{resource1x}x + {resource1y}y = {totalresource1}} \\]\\[ \\simplify{{resource2x}x + {resource2y}y = {totalresource2}} \\]

\n

\\[ \\simplify{{resource2x}x + {resource2y}y = {totalresource2}} \\]\\[ x = \\var{xconstraint} \\]\\[ y = \\var{yconstraint} \\]

\n

geeft dan deze oplossing $x = \\var{best_x}$, $y = \\var{best_y}$, met een totale winst

\n

\\[ \\text{Winst} = \\simplify[]{{profitx}  {best_x} + {profity}  {best_y}} = \\text{£}\\var{best_profit} \\]

", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"business": {"name": "business", "group": "Text strings", "definition": "if(business_short=\"\",business_long,business_short)", "description": "", "templateType": "anything", "can_override": false}, "resource_1_units": {"name": "resource_1_units", "group": "Text strings", "definition": "safe(\"kg\")", "description": "

Dimension of the first resource

", "templateType": "string", "can_override": false}, "product_1s": {"name": "product_1s", "group": "Text strings", "definition": "safe(\"eenheden A\")", "description": "

Plural name of the first product

", "templateType": "string", "can_override": false}, "constraint1xvalue": {"name": "constraint1xvalue", "group": "Bounds", "definition": "round(scalingfactor1*resource1y+xconstraint)", "description": "

Where the constraint line for resource 1 crosses the y-constraint

", "templateType": "anything", "can_override": false}, "business_short": {"name": "business_short", "group": "Text strings", "definition": "safe(\"AMS\")", "description": "

A shorter name for the business, to be repeated throughout the text. If the business name is short enough for repeated use, leave this empty.

", "templateType": "string", "can_override": false}, "constraint2xvalue": {"name": "constraint2xvalue", "group": "Bounds", "definition": "round(scalingfactor2*resource2y+xconstraint)", "description": "

Where the constraint line for resource 2 cuts the y-constraint

", "templateType": "anything", "can_override": false}, "product_2s": {"name": "product_2s", "group": "Text strings", "definition": "safe(\"eenheden B\")", "description": "

Plural name of the second product

", "templateType": "string", "can_override": false}, "constraint2yvalue": {"name": "constraint2yvalue", "group": "Bounds", "definition": "r1+yconstraint", "description": "

Where the constraint line for the second resource cuts the x-constraint.

\n

Second resource line cuts x-constraint at a point greater than the y-constraint

", "templateType": "anything", "can_override": false}, "totalresource2": {"name": "totalresource2", "group": "Constraints", "definition": "siground(\n scalingfactor2*resource2x*resource2y +\n resource2y*yconstraint +\n resource2x*xconstraint\n,5)", "description": "

Total amount of resource 2 available

", "templateType": "anything", "can_override": false}, "best_profit_float": {"name": "best_profit_float", "group": "Optimum strategy", "definition": "profit(best_x_float,best_y_float)", "description": "

The profit at the best intersection point, if fractions of units are allowed

", "templateType": "anything", "can_override": false}, "xconstraint": {"name": "xconstraint", "group": "Constraints", "definition": "\nrandom(4..10)", "description": "

Minimum production of the first product

", "templateType": "anything", "can_override": false}, "product_1": {"name": "product_1", "group": "Text strings", "definition": "safe(\"A\")", "description": "

Singular name of the first product

", "templateType": "string", "can_override": false}, "resource_2_units": {"name": "resource_2_units", "group": "Text strings", "definition": "safe(\"liter\")", "description": "

Dimension of the second resource

", "templateType": "string", "can_override": false}, "resource1y": {"name": "resource1y", "group": "Constraints", "definition": "random(50..70)", "description": "

How much of resource 1 the second product uses per unit

", "templateType": "anything", "can_override": false}, "line_names": {"name": "line_names", "group": "Optimum strategy", "definition": "[ \"gebruikte hoeveelheid van grondstof 1 \", \"gebruikte hoeveelheid van grondstof 2 \", \"minimum te produceren hoeveelheid van A\", \"minimum te produceren hoeveelheid van B\" ]", "description": "

Names of the lines, coded as in the definition of best_lines

", "templateType": "list of strings", "can_override": false}, "totalresource1": {"name": "totalresource1", "group": "Constraints", "definition": "siground(\n scalingfactor1*resource1x*resource1y +\n resource1y*yconstraint +\n resource1x*xconstraint\n,4)", "description": "

Total amount of resource 1 available

", "templateType": "anything", "can_override": false}, "best_point": {"name": "best_point", "group": "Optimum strategy", "definition": "best_by(possible_points,profits)", "description": "

The index of the valid intersection point with the highest profit

", "templateType": "anything", "can_override": false}, "boundx": {"name": "boundx", "group": "Bounds", "definition": "max(constraint1xvalue,constraint2xvalue)", "description": "

Right bound of the diagram

", "templateType": "anything", "can_override": false}, "resource_2": {"name": "resource_2", "group": "Text strings", "definition": "safe(\"grondstof 2\")", "description": "

The name of the second resource

", "templateType": "string", "can_override": false}, "best_x": {"name": "best_x", "group": "Optimum strategy", "definition": "floor(best_x_float)", "description": "

The integer number of units of the first product to produce to earn the highest profit

", "templateType": "anything", "can_override": false}, "boundy": {"name": "boundy", "group": "Bounds", "definition": "max(constraint1yvalue,constraint2yvalue)", "description": "

Upper bound of the diagram

", "templateType": "anything", "can_override": false}, "best_y": {"name": "best_y", "group": "Optimum strategy", "definition": "floor(best_y_float)", "description": "

The integer number of units of the second product to produce to earn the highest profit

", "templateType": "anything", "can_override": false}, "yconstraint": {"name": "yconstraint", "group": "Constraints", "definition": "random(4..10)", "description": "

Minimum production of the second product

", "templateType": "anything", "can_override": false}, "resource_1": {"name": "resource_1", "group": "Text strings", "definition": "safe(\"grondstof 1\")", "description": "

The name of the first resource

", "templateType": "string", "can_override": false}, "intersection_points": {"name": "intersection_points", "group": "Optimum strategy", "definition": "[\n [xconstraint, (totalresource1-resource1x*xconstraint)/resource1y], //resource 1 intersecting with minimum x\n [xconstraint, (totalresource2-resource2x*xconstraint)/resource2y], //resource 2 intersecting with minimum x\n [(totalresource1-resource1y*yconstraint)/resource1x, yconstraint], //resource 1 intersecting with minimum y\n [(totalresource2-resource2y*yconstraint)/resource2x, yconstraint], //resource 2 intersecting with minimum y\n let(y, (totalresource1-totalresource2*resource1x/resource2x)/(resource1y - resource1x/resource2x * resource2y),\n [(totalresource1-resource1y*y)/resource1x, y] // intersection of the two resource constraints\n )\n]", "description": "

Intersection points of the constraints - the optimum strategy will be one of these

", "templateType": "anything", "can_override": false}, "best_lines": {"name": "best_lines", "group": "Optimum strategy", "definition": "[[0,2],[1,2],[0,3],[1,3],[0,1]][best_point]", "description": "

Which lines are involed in the best point? Coded as follows:

\n

0 - resource 1

\n

1 - resource 2

\n

2 - minimum x

\n

3 - minimum y

\n

Note that (minimum x,minimum y) is never the best point

", "templateType": "anything", "can_override": false}, "scalingfactor1": {"name": "scalingfactor1", "group": "Constraints", "definition": "precround((r1+r2)/resource1x,1)", "description": "", "templateType": "anything", "can_override": false}, "resource2y": {"name": "resource2y", "group": "Constraints", "definition": "\nrandom(1500..3000#100)", "description": "

How much of resource 2 the second product uses per unit

", "templateType": "anything", "can_override": false}, "best_x_float": {"name": "best_x_float", "group": "Optimum strategy", "definition": "intersection_points[best_point][0]", "description": "

The number of units of X to produce to earn the highest profit, if fractions are allowed

", "templateType": "anything", "can_override": false}, "resource2x": {"name": "resource2x", "group": "Constraints", "definition": "\nrandom(250..450#10)", "description": "

How much of resource 2 the first product uses per unit

", "templateType": "anything", "can_override": false}, "possible_points": {"name": "possible_points", "group": "Optimum strategy", "definition": "filter(\n let(x,floor(intersection_points[j][0]),y,floor(intersection_points[j][1]),\n resource1x*x+resource1y*y <= totalresource1+1 and \n resource2x*x+resource2y*y <= totalresource2+1 and\n x>=xconstraint and\n y>=yconstraint\n ),\n j,\n 0..len(intersection_points)-1\n)", "description": "

Indices of intersection points which satisfy all the constraints.

", "templateType": "anything", "can_override": false}, "scalingfactor2": {"name": "scalingfactor2", "group": "Constraints", "definition": "precround((r1)/resource2x,2)", "description": "", "templateType": "anything", "can_override": false}, "resource1x": {"name": "resource1x", "group": "Constraints", "definition": "random(20..40)", "description": "

How much of resource 1 the first product uses per unit

", "templateType": "anything", "can_override": false}, "profitx": {"name": "profitx", "group": "Profit", "definition": "//the coeff of x in the objective function\nrandom(2..4)", "description": "

Profit for each unit of the first product sold

", "templateType": "anything", "can_override": false}, "profity": {"name": "profity", "group": "Profit", "definition": "//the coeff of y in the objective function\nceil(profitx*(resource1y/resource1x)*random(1.5..3))", "description": "

Profit for each unit of the second product sold

", "templateType": "anything", "can_override": false}, "constraint1yvalue": {"name": "constraint1yvalue", "group": "Bounds", "definition": "r2+constraint2yvalue", "description": "

Where line given by resource 1 constraint cuts the x-constraint line.

\n

It is always greater than the point at which the second resource line cuts.

", "templateType": "anything", "can_override": false}, "product_2": {"name": "product_2", "group": "Text strings", "definition": "safe(\"B\")", "description": "

Singular name of the second product

", "templateType": "string", "can_override": false}, "business_long": {"name": "business_long", "group": "Text strings", "definition": "safe(\"Amalgamated Mines and Sheep, Inc.\")", "description": "

The full name of the business

", "templateType": "string", "can_override": false}, "r1": {"name": "r1", "group": "Constraints", "definition": "random(10..20)", "description": "

The second constraint line cuts the x-constraint line at this value more than the y-constraint

", "templateType": "anything", "can_override": false}, "best_profit": {"name": "best_profit", "group": "Optimum strategy", "definition": "profit(best_x,best_y)", "description": "

The profit at the best intersection point

", "templateType": "anything", "can_override": false}, "best_y_float": {"name": "best_y_float", "group": "Optimum strategy", "definition": "intersection_points[best_point][1]", "description": "

The number of units of the second product to produce to earn the highest profit, if fractions are allowed

", "templateType": "anything", "can_override": false}, "r2": {"name": "r2", "group": "Constraints", "definition": "random(5..15)", "description": "

The first constraint line cuts the x-constraint line at this value greater than where the second constraint cuts.

", "templateType": "anything", "can_override": false}, "profits": {"name": "profits", "group": "Optimum strategy", "definition": "map(let(x,p[0],y,p[1],profitx*x+profity*y),p,intersection_points)", "description": "

Profit earned at each intersection point

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "Constraints", "variables": ["xconstraint", "yconstraint", "resource1x", "resource1y", "resource2x", "resource2y", "r1", "r2", "scalingfactor1", "scalingfactor2", "totalresource1", "totalresource2"]}, {"name": "Bounds", "variables": ["boundx", "boundy", "constraint1xvalue", "constraint1yvalue", "constraint2xvalue", "constraint2yvalue"]}, {"name": "Profit", "variables": ["profitx", "profity"]}, {"name": "Optimum strategy", "variables": ["intersection_points", "possible_points", "profits", "best_point", "best_x_float", "best_y_float", "best_profit_float", "best_x", "best_y", "best_profit", "best_lines", "line_names"]}, {"name": "Text strings", "variables": ["business_long", "business_short", "business", "resource_1", "resource_1_units", "resource_2", "resource_2_units", "product_1", "product_1s", "product_2", "product_2s"]}], "functions": {"best_by": {"parameters": [["l1", "list"], ["l2", "list"]], "type": "number", "language": "javascript", "definition": "// l1 is a list of indices on l2\n// return the element of l1 which has the biggest corresponding value in l2 \n// (i.e. i such that l2[l1[i]] is biggest)\n\nvar best_1 = null;\nvar best_2 = null;\nfor(var i=0;ibest_2) {\n best_2 = l2[l1[i]];\n best_1 = l1[i];\n }\n}\nreturn best_1"}, "profit": {"parameters": [["x", "number"], ["y", "number"]], "type": "number", "language": "jme", "definition": "profitx*x+profity*y"}, "test": {"parameters": [], "type": "html", "language": "javascript", "definition": "var xconstraint = Numbas.jme.unwrapValue(scope.variables.xconstraint);\nvar yconstraint = Numbas.jme.unwrapValue(scope.variables.yconstraint);\nvar resource1x = Numbas.jme.unwrapValue(scope.variables.resource1x);\nvar resource1y = Numbas.jme.unwrapValue(scope.variables.resource1y);\nvar resource2x = Numbas.jme.unwrapValue(scope.variables.resource2x);\nvar resource2y = Numbas.jme.unwrapValue(scope.variables.resource2y);\nvar r1 = Numbas.jme.unwrapValue(scope.variables.r1);\nvar r2 = Numbas.jme.unwrapValue(scope.variables.r2);\nvar scalingfactor1 = Numbas.jme.unwrapValue(scope.variables.scalingfactor1);\nvar scalingfactor2 = Numbas.jme.unwrapValue(scope.variables.scalingfactor2);\nvar totalresource1 = Numbas.jme.unwrapValue(scope.variables.totalresource1);\nvar totalresource2 = Numbas.jme.unwrapValue(scope.variables.totalresource2);\nvar boundx = Numbas.jme.unwrapValue(scope.variables.boundx);\nvar boundy = Numbas.jme.unwrapValue(scope.variables.boundy);\nvar constraint1xvalue = Numbas.jme.unwrapValue(scope.variables.constraint1xvalue);\nvar constraint1yvalue = Numbas.jme.unwrapValue(scope.variables.constraint1yvalue);\nvar constraint2xvalue = Numbas.jme.unwrapValue(scope.variables.constraint2xvalue);\nvar constraint2yvalue = Numbas.jme.unwrapValue(scope.variables.constraint2yvalue);\nvar profitx = Numbas.jme.unwrapValue(scope.variables.profitx);\nvar profity = Numbas.jme.unwrapValue(scope.variables.profity);\nvar ux=Math.max(totalresource1/resource1x,totalresource2/resource2x)+10;\nvar uy=Math.max(totalresource1/resource1y,totalresource2/resource2y)+10;\n//make board\nvar div = Numbas.extensions.jsxgraph.makeBoard('600px','400px',\n{boundingBox:[-10,uy,ux,-10],grid: false,axis:false,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:'X', \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: [0, 20] // (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:'Y', \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 l1 = board.create('line', [xconstraint, -1, 0],{fixed: true}),\n ineq1 = board.create('inequality', [l1], {inverse:true});\nvar l2 = board.create('line', [yconstraint, 0, -1],{fixed: true}),\n ineq2 = board.create('inequality', [l2], {inverse:true});\nvar l3 = board.create('line', [-totalresource1, resource1x, resource1y],{fixed: true}),\n ineq3 = board.create('inequality', [l3], {inverse:true});\nvar l4 = board.create('line', [-totalresource2, resource2x, resource2y],{fixed: true}),\n ineq4 = board.create('inequality', [l4], {inverse:true});\n\n// Create two draggable points\n const p1 = board.create('point', [-100*profity, 100*profitx], { name: 'A', size: 4, strokeColor: 'blue', fillColor: 'blue' });\n const p2 = board.create('point', [-10*profity, 10*profitx], { name: 'B', size: 4, strokeColor: 'red', fillColor: 'red' });\n\n // Create a line through the two points\n const line = board.create('line', [p1, p2], {\n strokeColor: 'red',\n strokeWidth: 4\n });\n\n // Optional: Make the line itself draggable (moves both points together)\n line.on('drag', function(evt) {\n const dx = board.mouseCoords.x - line.point1.X();\n const dy = board.mouseCoords.y - line.point1.Y();\n\n p1.moveTo([p1.X() + dx, p1.Y() + dy]);\n p2.moveTo([p2.X() + dx, p2.Y() + dy]);\n });\n\nreturn div;"}, "oplossinggrafisch": {"parameters": [], "type": "html", "language": "javascript", "definition": "var xconstraint = Numbas.jme.unwrapValue(scope.variables.xconstraint);\nvar yconstraint = Numbas.jme.unwrapValue(scope.variables.yconstraint);\nvar resource1x = Numbas.jme.unwrapValue(scope.variables.resource1x);\nvar resource1y = Numbas.jme.unwrapValue(scope.variables.resource1y);\nvar resource2x = Numbas.jme.unwrapValue(scope.variables.resource2x);\nvar resource2y = Numbas.jme.unwrapValue(scope.variables.resource2y);\nvar r1 = Numbas.jme.unwrapValue(scope.variables.r1);\nvar r2 = Numbas.jme.unwrapValue(scope.variables.r2);\nvar scalingfactor1 = Numbas.jme.unwrapValue(scope.variables.scalingfactor1);\nvar scalingfactor2 = Numbas.jme.unwrapValue(scope.variables.scalingfactor2);\nvar totalresource1 = Numbas.jme.unwrapValue(scope.variables.totalresource1);\nvar totalresource2 = Numbas.jme.unwrapValue(scope.variables.totalresource2);\nvar boundx = Numbas.jme.unwrapValue(scope.variables.boundx);\nvar boundy = Numbas.jme.unwrapValue(scope.variables.boundy);\nvar constraint1xvalue = Numbas.jme.unwrapValue(scope.variables.constraint1xvalue);\nvar constraint1yvalue = Numbas.jme.unwrapValue(scope.variables.constraint1yvalue);\nvar constraint2xvalue = Numbas.jme.unwrapValue(scope.variables.constraint2xvalue);\nvar constraint2yvalue = Numbas.jme.unwrapValue(scope.variables.constraint2yvalue);\nvar profitx = Numbas.jme.unwrapValue(scope.variables.profitx);\nvar profity = Numbas.jme.unwrapValue(scope.variables.profity);\nvar best_profit_float = Numbas.jme.unwrapValue(scope.variables.best_profit_float);\nvar best_x_float = Numbas.jme.unwrapValue(scope.variables.best_x_float);\nvar best_y_float = Numbas.jme.unwrapValue(scope.variables.best_y_float);\n\nvar ux=Math.max(totalresource1/resource1x,totalresource2/resource2x)+10;\nvar uy=Math.max(totalresource1/resource1y,totalresource2/resource2y)+10;\n\n//make board\nvar div = Numbas.extensions.jsxgraph.makeBoard('600px','400px',\n{boundingBox:[-10,uy,ux,-10],grid: false,axis:false,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:'X', \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: [0, 20] // (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:'Y', \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//var p3 = board.create('point', [best_x_float, best_y_float]);\n\nvar l1 = board.create('line', [xconstraint, -1, 0],{fixed: true}),\n ineq1 = board.create('inequality', [l1], {inverse:true});\nvar l2 = board.create('line', [yconstraint, 0, -1],{fixed: true}),\n ineq2 = board.create('inequality', [l2], {inverse:true});\nvar l3 = board.create('line', [-totalresource1, resource1x, resource1y],{fixed: true}),\n ineq3 = board.create('inequality', [l3], {inverse:true});\nvar l4 = board.create('line', [-totalresource2, resource2x, resource2y],{fixed: true}),\n ineq4 = board.create('inequality', [l4], {inverse:true});\n\nvar l = board.create('line', [-best_profit_float, profitx, profity],{strokeColor:\"red\"});\n//board.create('point', [50, 25]);\n\nreturn div;"}}, "preamble": {"js": "function userinput_diagram() {\n\nwith(question.unwrappedVariables) {\n\n var options = {\n x_bound: boundx, \n y_bound: boundy\n };\n\n options.objective_line_coordinates = [[0,0],[1,-profitx/profity]];\n \n function getStudentAnswer(path) {\n var part = question.getPart(path);\n return ko.computed(function() {\n return parseFloat(part.display.studentAnswer());\n });\n }\n \n options.minimum_x = getStudentAnswer('p0g0');\n options.minimum_y = getStudentAnswer('p0g1');\n\n var x_coefficient_1 = getStudentAnswer('p1g0');\n var y_coefficient_1 = getStudentAnswer('p1g1');\n var total_1 = getStudentAnswer('p1g2');\n options.inequality_1_coordinates = [ko.computed(function() {\n return [-total_1(),x_coefficient_1(),y_coefficient_1()];\n })];\n\n options.inequality_1_ok = ko.computed(function() {\n return !(isNaN(x_coefficient_1()) || isNaN(y_coefficient_1()) || isNaN(total_1()));\n });\n\n var x_coefficient_2 = getStudentAnswer('p1g3');\n var y_coefficient_2 = getStudentAnswer('p1g4');\n var total_2 = getStudentAnswer('p1g5');\n options.inequality_2_coordinates = [ko.computed(function() {\n return [-total_2(),x_coefficient_2(),y_coefficient_2()];\n })];\n\n options.inequality_2_ok = ko.computed(function() {\n return !(isNaN(x_coefficient_2()) || isNaN(y_coefficient_2()) || isNaN(total_2()));\n });\n\nvar result = Numbas.extensions.optimisation.linear_programming_board(options);\n\nxaxis = result.div.board.create('axis', [[0, 0], [1,0]], \n\t\t {name:'X', \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, 20] // (in pixels)\n\t\t\t\t\t }\n\t\t\t});\nyaxis = result.div.board.create('axis', [[0, 0], [0, 1]], \n\t\t {name:'Y', \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});\t\t\t\n\n\n$(question.display.html).find('.lp-graph').html('').append(result.div);\n \n\n}\n \n}\n\nfunction advice_diagram() {\nwith(question.unwrappedVariables) {\n\n var result1 = Numbas.extensions.optimisation.linear_programming_board({\n x_bound: boundx,\n y_bound: boundy,\n objective_line_coordinates: [[0,best_profit_float/profity],[1,(best_profit_float-profitx)/profity]],\n minimum_x: xconstraint,\n minimum_y: yconstraint,\n inequality_1_coordinates: [-totalresource1, resource1x, resource1y],\n inequality_2_coordinates: [-totalresource2, resource2x, resource2y]\n });\n $(question.display.html).find('#advicediagram').html('').append(result1.div);\n \nvar board = result1.div.board;\nxaxis = board.create('axis', [[0, 0], [1,0]], \n\t\t {name:'X', \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, 20] // (in pixels)\n\t\t\t\t\t }\n\t\t\t});\nyaxis = board.create('axis', [[0, 0], [0, 1]], \n\t\t {name:'Y', \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});\t\t\t\nlinear_programming_board = board;\n}\n}\n\nquestion.signals.on('HTMLAttached',function() {\n userinput_diagram();\n advice_diagram();\n});\n", "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, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "prompt": "

Noem $x$ en $y$ respectievelijk het aantal geproduceerde {product_1s} en {product_2s}.

\n

Schrijf hieronder de voorwaarden neer voor de reeds geplaatste bestellingen:

\n

$x \\geq$ [[0]]

\n

$y \\geq$ [[1]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": ".5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "xconstraint", "maxValue": "xconstraint", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": ".5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "yconstraint", "maxValue": "yconstraint", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false, "inlineCorrectAnswer": true}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "prompt": "

Geef de nevenvoorwaarden qua beschikbaarheid van {resource_1} en {resource_2}:

\n

{capitalise(resource_1)}: [[0]] $x + $ [[1]] $y \\le $ [[2]]

\n

{capitalise(resource_2)}: [[3]] $x + $ [[4]] $y \\le $ [[5]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": ".5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "resource1x", "maxValue": "resource1x", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": ".5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "resource1y", "maxValue": "resource1y", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": ".5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "totalresource1", "maxValue": "totalresource1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": ".5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "resource2x", "maxValue": "resource2x", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": ".5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "resource2y", "maxValue": "resource2y", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": ".5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "totalresource2", "maxValue": "totalresource2", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false, "inlineCorrectAnswer": true}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "prompt": "

Bepaal de doelfunctie in termen van $x$ en $y$: [[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, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "answer": "{profitx}*x+{profity}*y", "answerSimplification": "all", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "notation": "standard", "mustmatchpattern": {"pattern": "$n x + $n y", "partialCredit": 0, "message": "", "nameToCompare": "", "warningTime": "submission"}, "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": ""}], "functionsets": [], "enabledfunctions": [], "disabledfunctions": []}], "sortAnswers": false, "inlineCorrectAnswer": true}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "prompt": "

De volgende figuur toon het oplosssingsgebied in het wit, d.w.z. dat voor de ongelijkheden telkens het complementaire gebied wordt gekleurd.

\n

{test()}

\n

Versleep de rode doelfunctielijn op bovenstaande figuur om de maximale winst te bekomen.

\n

Bereken vervolgens de overeenkomstige geproduceerde eenheden om een maximale winst te verkrijgen.

\n

Produceer [[0]] {product_1s} en  [[1]] {product_2s}, met totale winst £ [[2]] .

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "xconstraint", "part": "p0g0", "must_go_first": true}, {"variable": "yconstraint", "part": "p0g1", "must_go_first": true}, {"variable": "resource1x", "part": "p1g0", "must_go_first": true}, {"variable": "resource1y", "part": "p1g1", "must_go_first": true}, {"variable": "totalresource1", "part": "p1g2", "must_go_first": true}, {"variable": "resource2x", "part": "p1g3", "must_go_first": true}, {"variable": "resource2y", "part": "p1g4", "must_go_first": true}, {"variable": "totalresource2", "part": "p1g5", "must_go_first": true}], "variableReplacementStrategy": "alwaysreplace", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "best_x", "maxValue": "best_x", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "xconstraint", "part": "p0g0", "must_go_first": true}, {"variable": "yconstraint", "part": "p0g1", "must_go_first": true}, {"variable": "resource1x", "part": "p1g0", "must_go_first": true}, {"variable": "resource1y", "part": "p1g1", "must_go_first": true}, {"variable": "totalresource1", "part": "p1g2", "must_go_first": true}, {"variable": "resource2x", "part": "p1g3", "must_go_first": true}, {"variable": "resource2y", "part": "p1g4", "must_go_first": true}, {"variable": "totalresource2", "part": "p1g5", "must_go_first": true}], "variableReplacementStrategy": "alwaysreplace", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "best_y", "maxValue": "best_y", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "best_x", "part": "p3g0", "must_go_first": false}, {"variable": "best_y", "part": "p3g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "best_profit", "maxValue": "best_profit", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false, "inlineCorrectAnswer": true}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "showAllParts": false, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Paul Verheyen", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3610/"}], "resources": []}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Paul Verheyen", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3610/"}]}