// Numbas version: exam_results_page_options {"name": "Luis's copy of Transportation problem - apply minimum cost algorithm", "extensions": ["optimisation"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"showQuestionGroupNames": false, "variablesTest": {"maxRuns": "3000", "condition": ""}, "tags": [], "metadata": {"notes": "", "description": "", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"numRows": "num_sources", "marks": 1, "correctAnswer": "assignment", "correctAnswerFractions": false, "markPerCell": false, "tolerance": 0, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "allowResize": false, "type": "matrix", "numColumns": "num_destinations", "showCorrectAnswer": true, "scripts": {}, "prompt": "

Apply the minimum cost algorithm to find an assignment of units of coal to be transported between pits and power stations.

\n

When there's more than one choice of cell, choose the cell with the maximum available allocation.

", "allowFractions": false}, {"maxValue": "assignment_cost", "allowFractions": false, "showPrecisionHint": false, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "variableReplacements": [{"variable": "assignment", "part": "p0", "must_go_first": false}], "minValue": "assignment_cost", "marks": 1, "type": "numberentry", "showCorrectAnswer": true, "scripts": {}, "prompt": "

What is the total cost of this solution?

"}], "variables": {"assignment_cost": {"name": "assignment_cost", "definition": "assignment_cost(assignment,costs)", "group": "Minimum costs", "description": "", "templateType": "anything"}, "total": {"name": "total", "definition": "random(50..500)", "group": "Setup", "description": "", "templateType": "anything"}, "num_destinations": {"name": "num_destinations", "definition": "7-num_sources+random(0,1)", "group": "Setup", "description": "", "templateType": "anything"}, "assignment": {"name": "assignment", "definition": "minimum_cost(supply,demand,costs)", "group": "Minimum costs", "description": "", "templateType": "anything"}, "demand": {"name": "demand", "definition": "random_partition(total,num_destinations)", "group": "Initial data", "description": "", "templateType": "anything"}, "costs": {"name": "costs", "definition": "matrix(repeat(\n repeat(\n random(1..9),\n num_destinations\n ),\n num_sources\n))", "group": "Initial data", "description": "", "templateType": "anything"}, "supply": {"name": "supply", "definition": "random_partition(total,num_sources)", "group": "Initial data", "description": "", "templateType": "anything"}, "num_sources": {"name": "num_sources", "definition": "random(3..5)", "group": "Setup", "description": "", "templateType": "anything"}}, "name": "Luis's copy of Transportation problem - apply minimum cost algorithm", "advice": "

a)

\n

The following tables show each step of the minimum cost algorithm:

\n

{minimum_cost_display(supply,demand,costs)}

\n

b)

\n

The total cost of this solution is $\\var{show_cost_calculation(assignment,costs)}$.

", "preamble": {"js": "", "css": ""}, "statement": "

Four power stations labelled $j = 1,2,3,4$ require {show_variable_list(demand,'b')} units of coal, respectively. These are to be provided by three pits labelled $i=1,2,3$, which have supplies of {show_variable_list(supply,'a')} units of coal, respectively.

\n

The cost $c_{ij}$ of transporting one unit of coal from pit $i$ to power station $j$ is in the following table (with supplies and demand shown in the margin).

\n

{cost_table(supply,demand,costs)}

", "type": "question", "ungrouped_variables": [], "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "functions": {"show_variable_list": {"language": "javascript", "definition": "return data.map(function(n,i) {\n return '$'+name+'_{'+(i+1)+'} = '+Numbas.math.niceNumber(n)+'$';\n}).join(', ');", "parameters": [["data", "list"], ["name", "string"]], "type": "string"}}, "rulesets": {}, "variable_groups": [{"name": "Setup", "variables": ["num_sources", "num_destinations", "total"]}, {"name": "Initial data", "variables": ["supply", "demand", "costs"]}, {"name": "Minimum costs", "variables": ["assignment", "assignment_cost"]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Luis Hernandez", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2870/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Luis Hernandez", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2870/"}]}