// Numbas version: exam_results_page_options {"name": "Decision analysis: determine maximin, maximax, minimax regret actions", "extensions": ["jsxgraph", "optimisation"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [{"variables": ["actions", "states", "num_states", "num_actions", "utility_ranges"], "name": "Setup"}, {"variables": ["first_state_utility", "second_state_utility", "utility"], "name": "Utility"}, {"variables": ["dominated_by", "admissible", "admissible_actions", "num_admissible"], "name": "Admissibility"}, {"variables": ["action_max_utility", "action_min_utility", "maximax", "maximin", "state_max_utility", "regret", "maximum_regret", "minimax", "maxi_marking_matrix"], "name": "Maximax/maximin"}], "variables": {"admissible": {"templateType": "anything", "group": "Admissibility", "definition": "map(\n sum(list(dominated_by[j]))=0,\n j,\n 0..num_actions-1\n)", "description": "
Is state $j$ admissible?
", "name": "admissible"}, "num_states": {"templateType": "anything", "group": "Setup", "definition": "len(states)", "description": "", "name": "num_states"}, "state_max_utility": {"templateType": "anything", "group": "Maximax/maximin", "definition": "map(max(list(transpose(utility)[j])),j,0..num_states-1)", "description": "Maximum utility for each state
", "name": "state_max_utility"}, "num_admissible": {"templateType": "anything", "group": "Admissibility", "definition": "len(admissible_actions)", "description": "Number of admissible actions
", "name": "num_admissible"}, "states": {"templateType": "list of strings", "group": "Setup", "definition": "[ \"Good weather\", \"Bad weather\" ]", "description": "", "name": "states"}, "regret": {"templateType": "anything", "group": "Maximax/maximin", "definition": "matrix(map(\n map(\n state_max_utility[k]-utility[j][k],\n k,\n 0..num_states-1\n ),\n j,\n admissible_actions\n))", "description": "Regret for admissible actions - difference between the utility for that action in that state, and the maximum utility for that state across all actions
", "name": "regret"}, "second_state_utility": {"templateType": "anything", "group": "Utility", "definition": "let(\n q,\n shuffle(list(utility_ranges[1]))[0..num_actions-1],\n q+[random(1..max(q)-1)]\n)", "description": "Payoffs in the second state. Make sure the final item is strictly smaller than the maximum.
", "name": "second_state_utility"}, "dominated_by": {"templateType": "anything", "group": "Admissibility", "definition": "matrix(map(\n map(\n if(j=k,0,\n dominates(utility[k],utility[j])\n ),\n k,\n 0..num_actions-1\n ),\n j,\n 0..num_actions-1\n))", "description": "$c_{ij} = 1$ if $a_i$ is dominated by $a_j$.
", "name": "dominated_by"}, "admissible_actions": {"templateType": "anything", "group": "Admissibility", "definition": "filter(admissible[j],j,0..num_actions-1)", "description": "Indices of the admissible actions
", "name": "admissible_actions"}, "actions": {"templateType": "list of strings", "group": "Setup", "definition": "[ \"Bus\", \"Taxi\", \"Car\", \"Train\", \"Plane\" ]", "description": "", "name": "actions"}, "maximax": {"templateType": "anything", "group": "Maximax/maximin", "definition": "admissible_actions[filter(action_max_utility[j]=max(action_max_utility),j,0..num_admissible-1)[0]]", "description": "Index of the maximax action
", "name": "maximax"}, "utility_ranges": {"templateType": "anything", "group": "Setup", "definition": "[1..20,1..8]", "description": "Ranges to select utility from for each state.
", "name": "utility_ranges"}, "first_state_utility": {"templateType": "anything", "group": "Utility", "definition": "let(\n q,\n sort(shuffle(list(utility_ranges[0]))[0..num_actions-1]),\n \n q+[random(max(q)+1..21)]\n)", "description": "Payoffs in the first state. Make sure that they're in ascending order, and the final item is strictly bigger than the others.
", "name": "first_state_utility"}, "maximum_regret": {"templateType": "anything", "group": "Maximax/maximin", "definition": "map(max(list(regret[j])),j,0..num_admissible-1)", "description": "Maximum regret for each admissible action
", "name": "maximum_regret"}, "action_min_utility": {"templateType": "anything", "group": "Maximax/maximin", "definition": "map(min(list(utility[j])),j,admissible_actions)", "description": "Minimum utility for each action
", "name": "action_min_utility"}, "minimax": {"templateType": "anything", "group": "Maximax/maximin", "definition": "admissible_actions[filter(maximum_regret[j]=min(maximum_regret),j,0..num_admissible-1)[0]]", "description": "Minimax regret action
", "name": "minimax"}, "maxi_marking_matrix": {"templateType": "anything", "group": "Maximax/maximin", "definition": "transpose(matrix(map(\n [if(j=maximax,1,0),if(j=maximin,1,0),if(j=minimax,1,0)],\n j,\n 0..num_actions-1\n)))", "description": "Marking matrix for the maximax/maximin/minimax part
", "name": "maxi_marking_matrix"}, "maximin": {"templateType": "anything", "group": "Maximax/maximin", "definition": "admissible_actions[filter(action_min_utility[j]=max(action_min_utility),j,0..num_admissible-1)[0]]", "description": "Index of the minimax action
", "name": "maximin"}, "action_max_utility": {"templateType": "anything", "group": "Maximax/maximin", "definition": "map(max(list(utility[j])),j,admissible_actions)", "description": "Maximum utility for each action
", "name": "action_max_utility"}, "utility": {"templateType": "anything", "group": "Utility", "definition": "matrix(map(\n [first_state_utility[action], second_state_utility[action]],\n action,\n 0..num_actions-1\n))", "description": "Utility for each combination of action and state.
", "name": "utility"}, "num_actions": {"templateType": "anything", "group": "Setup", "definition": "len(actions)", "description": "", "name": "num_actions"}}, "ungrouped_variables": [], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Decision analysis: determine maximin, maximax, minimax regret actions", "functions": {"describe_domination": {"type": "string", "language": "javascript", "definition": "var descriptions = [];\nfor(var i=0;i{actions[0]}
", "{actions[1]}
", "{actions[2]}
", "{actions[3]}
", "{actions[4]}
"], "showCorrectAnswer": true, "matrix": "map(if(x,1,0),x,admissible)", "prompt": "Which actions are admissible?
", "distractors": ["", "", "", "", ""], "variableReplacements": [], "type": "m_n_2", "maxAnswers": 0, "shuffleChoices": false, "warningType": "none", "scripts": {"mark": {"script": "// award a point each time the student's answer matches the dominated_by matrix\n// then scale the points down so a completely correct board is worth 100% credit\n\nthis.answered = true;\nthis.validation.numTicks = 1; // override the check for number of ticks\n\nvar max = this.numAnswers * this.numChoices;\nvar admissible = question.unwrappedVariables.admissible;\nvar correct = 0;\nfor(var i=0;iA traveller wishes to go on a city break to Edinburgh during the Christmas vacation. The traveller wants as much time in Edinburgh as possible and must decide, knowing the weather may be bad, how to get to Edinburgh.
\nThe traveller knows how long it will take to get to Edinburgh using each of the available modes of transport, but bad weather might cause delays. Estimates of the number of hours gained by using the various modes of travel are given in the payoff table below.
\n{table(map([actions[j]]+list(utility[j]),j,0..num_actions-1),['']+states)}
", "tags": [], "rulesets": {}, "preamble": {"css": "", "js": "question.onHTMLAttached(function() {\n});"}, "type": "question", "metadata": {"notes": "", "licence": "Creative Commons Attribution 4.0 International", "description": "Given a payoff table with two states and five actions, identify which actions are admissible, then the maximax, maximin, and minimax regret actions.
"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "An action $a_1$ dominates $a_2$ if:
\nDrawing the utility set can help to identify which actions dominate others.
\n{utility_set(utility,actions)}
\nFrom the plot of the utility set, we can see that {describe_domination(actions,dominated_by)}.
\nAn action is admissible if it is not dominated by any other action.
\nThe maximax action - the mode of transport with the largest maximum payoff - is {actions[maximax]}.
\nThe maximin action - the mode of transport with the largest minimum payoff - is {actions[maximin]}.
\nRegret is the difference between the payoff from the best decision and all other decision payoffs, for each state of nature.
\nWe can create a regret table for the admissible actions, as follows:
\n{table(map([actions[admissible_actions[j]]]+list(regret[j])+[maximum_regret[j]],j,0..num_admissible-1),['']+states+['Maximum regret'])}
\nThe mode of transport with the smallest maximum regret is therefore {actions[minimax]}.
", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}