// Numbas version: exam_results_page_options {"questions": [], "duration": 0, "name": "Decision analysis", "showQuestionGroupNames": false, "allQuestions": true, "percentPass": 0, "feedback": {"showanswerstate": true, "advicethreshold": 0, "showactualmark": true, "allowrevealanswer": true, "showtotalmark": true}, "shuffleQuestions": false, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"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}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "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}], "functions": {"describe_domination": {"type": "string", "language": "javascript", "definition": "var descriptions = [];\nfor(var i=0;i1 ? ' and ' : '') + others[others.length-1];\n } else {\n s += 'nothing';\n }\n descriptions.push(s);\n}\nreturn descriptions.join('; ');", "parameters": [["actions", "list"], ["dominated_by", "matrix"]]}, "dominates": {"type": "number", "language": "javascript", "definition": "var strictly = false;\nfor(var i=0;iu2[i]) {\n strictly = true;\n }\n}\nreturn strictly ? 1 : 0;", "parameters": [["u1", "vector"], ["u2", "vector"]]}}, "showQuestionGroupNames": false, "parts": [{"displayType": "checkbox", "choices": ["

{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;iDetermine the maximax, maximin and minimax regret actions.

", "type": "m_n_x", "maxAnswers": 0, "shuffleChoices": false, "warningType": "none", "scripts": {}, "marks": 0, "minAnswers": 0, "maxMarks": 0, "shuffleAnswers": false, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "answers": ["{actions[0]}", "{actions[1]}", "{actions[2]}", "{actions[3]}", "{actions[4]}"]}], "statement": "

A 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.

\n

The 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": "

a)

\n

An action $a_1$ dominates $a_2$ if:

\n
    \n
  1. $U(a_1,s_j) \\geq U(a_2,s_j) \\; \\forall s_j$.
  2. \n
  3. There is strict inequality for at least one state $j$.
  4. \n
\n

Drawing the utility set can help to identify which actions dominate others.

\n

{utility_set(utility,actions)}

\n

From the plot of the utility set, we can see that {describe_domination(actions,dominated_by)}.

\n

An action is admissible if it is not dominated by any other action.

\n

b)

\n

The maximax action - the mode of transport with the largest maximum payoff - is {actions[maximax]}.

\n

The maximin action - the mode of transport with the largest minimum payoff - is {actions[maximin]}.

\n

Regret is the difference between the payoff from the best decision and all other decision payoffs, for each state of nature. 

\n

We 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'])}

\n

The mode of transport with the smallest maximum regret is therefore {actions[minimax]}.

"}, {"name": "Decision analysis: expected value criteria", "extensions": ["jsxgraph", "optimisation"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "parts": [{"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "

Compute the expected value of each mode of transport.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Mode of transportExpected value
{actions[0]}[[0]]
{actions[1]}[[1]]
{actions[2]}[[2]]
{actions[3]}[[3]]
{actions[4]}[[4]]
", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": true, "customMarkingAlgorithm": "", "mustBeReduced": false, "correctAnswerFraction": true, "minValue": "expected_value[0]", "maxValue": "expected_value[0]", "unitTests": [], "correctAnswerStyle": "plain", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "mustBeReducedPC": 0}, {"showCorrectAnswer": true, "allowFractions": true, "customMarkingAlgorithm": "", "mustBeReduced": false, "correctAnswerFraction": true, "minValue": "expected_value[1]", "maxValue": "expected_value[1]", "unitTests": [], "correctAnswerStyle": "plain", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "mustBeReducedPC": 0}, {"showCorrectAnswer": true, "allowFractions": true, "customMarkingAlgorithm": "", "mustBeReduced": false, "correctAnswerFraction": true, "minValue": "expected_value[2]", "maxValue": "expected_value[2]", "unitTests": [], "correctAnswerStyle": "plain", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "mustBeReducedPC": 0}, {"showCorrectAnswer": true, "allowFractions": true, "customMarkingAlgorithm": "", "mustBeReduced": false, "correctAnswerFraction": true, "minValue": "expected_value[3]", "maxValue": "expected_value[3]", "unitTests": [], "correctAnswerStyle": "plain", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "mustBeReducedPC": 0}, {"showCorrectAnswer": true, "allowFractions": true, "customMarkingAlgorithm": "", "mustBeReduced": false, "correctAnswerFraction": true, "minValue": "expected_value[4]", "maxValue": "expected_value[4]", "unitTests": [], "correctAnswerStyle": "plain", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "mustBeReducedPC": 0}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}, {"displayType": "radiogroup", "customMarkingAlgorithm": "", "showCorrectAnswer": true, "displayColumns": 0, "choices": ["

{actions[0]}

", "

{actions[1]}

", "

{actions[2]}

", "

{actions[3]}

", "

{actions[4]}

"], "prompt": "

Which mode of transport should the traveller use?

", "unitTests": [], "matrix": "part_b_marks", "shuffleChoices": false, "showFeedbackIcon": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}], "variables": {"best_action": {"templateType": "anything", "group": "Expected value", "definition": "filter(expected_value[j]=max(expected_value),j,0..num_actions-1)[0]", "name": "best_action", "description": ""}, "prob_state_2": {"templateType": "anything", "group": "Setup", "definition": "num_state_2/prob_denom", "name": "prob_state_2", "description": ""}, "states": {"templateType": "list of strings", "group": "Setup", "definition": "[ \"Good weather\", \"Bad weather\" ]", "name": "states", "description": ""}, "prob_denom": {"templateType": "anything", "group": "Setup", "definition": "random(3..9)", "name": "prob_denom", "description": ""}, "num_states": {"templateType": "anything", "group": "Setup", "definition": "len(states)", "name": "num_states", "description": ""}, "actions": {"templateType": "list of strings", "group": "Setup", "definition": "[ \"Bus\", \"Taxi\", \"Car\", \"Train\", \"Plane\" ]", "name": "actions", "description": ""}, "expected_value": {"templateType": "anything", "group": "Expected value", "definition": "map((num_state_1*utility[j][0] + num_state_2*utility[j][1])/prob_denom, j, 0..num_actions-1)", "name": "expected_value", "description": ""}, "num_state_1": {"templateType": "anything", "group": "Setup", "definition": "random(1..prob_denom-1)", "name": "num_state_1", "description": ""}, "utility_ranges": {"templateType": "anything", "group": "Setup", "definition": "[1..20,1..8]", "name": "utility_ranges", "description": "

Ranges to select utility from for each state.

"}, "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)", "name": "first_state_utility", "description": "

Payoffs in the first state. Make sure that they're in ascending order, and the final item is strictly bigger than the others.

"}, "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))", "name": "utility", "description": "

Utility for each combination of action and state.

"}, "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)", "name": "second_state_utility", "description": "

Payoffs in the second state. Make sure the final item is strictly smaller than the maximum.

"}, "num_state_2": {"templateType": "anything", "group": "Setup", "definition": "prob_denom-num_state_1", "name": "num_state_2", "description": ""}, "num_actions": {"templateType": "anything", "group": "Setup", "definition": "len(actions)", "name": "num_actions", "description": ""}, "part_b_marks": {"templateType": "anything", "group": "Expected value", "definition": "map(if(expected_value[j]=max(expected_value),1,0), j, 0..num_actions-1)", "name": "part_b_marks", "description": ""}, "prob_state_1": {"templateType": "anything", "group": "Setup", "definition": "num_state_1/prob_denom", "name": "prob_state_1", "description": ""}}, "ungrouped_variables": [], "functions": {"expected_value_calculation": {"type": "string", "language": "javascript", "definition": "var lines = [];\nfor(var j=0;jA 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.

\n

The 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)}

\n

The traveller looks at historic weather data, and sees that the probability of there being bad weather is $\\simplify[fractionnumbers]{{prob_state_2}}$.

", "tags": [], "rulesets": {}, "preamble": {"css": "", "js": "question.onHTMLAttached(function() {\n});"}, "type": "question", "metadata": {"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.

\n

Should state that input is by integers or fractions. Also  the maximax, maximin and minimax regret actions are not asked for.

"}, "advice": "

We have two states of nature, $s_1$ representing good weather and $s_2$ representing bad weather. The traveller knows that $\\pi(s_1) = \\simplify[fractionnumbers]{{prob_state_1}}$ and $\\pi(s_2) = \\simplify[fractionnumbers]{{prob_state_2}}$.

\n

The expected value $V_\\pi(a_i)$ of each action $a_i$ is then

\n

\\[ V_\\pi(a_i) \\sum_{j=1}^2 \\pi(s_j) \\cdot U(a_i,s_j) \\]

\n

So the expected values of each mode of transport are as follows:

\n

\\[ \\var{expected_value_calculation(utility,[prob_state_1,prob_state_2],actions)} \\]

\n

The mode of transport with the highest expected value is {actions[best_action]}.

\n

You can also show this graphically. Plot the utility set, and then add a line with equation $\\pi(s_2)y + \\pi(s_1)x = c$. We want to find the maximum value of $c$ which passes through one of the points of the utility set.

\n

{show_expected_value_criteria(utility,actions,prob_state_1,prob_state_2)}

"}, {"name": "Decision analysis: expected value of perfect information", "extensions": ["jsxgraph", "optimisation"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [{"variables": ["num_states", "num_actions", "utility_range", "prob_denom", "probs"], "name": "Setup"}, {"variables": ["utility"], "name": "Utility"}, {"variables": ["expected_value", "best_action", "evpi"], "name": "Expected value"}], "variables": {"best_action": {"templateType": "anything", "group": "Expected value", "definition": "filter(expected_value[j]=max(expected_value),j,0..num_actions-1)[0]", "description": "", "name": "best_action"}, "probs": {"templateType": "anything", "group": "Setup", "definition": "vector(random_partition(prob_denom,num_states,1))/prob_denom", "description": "", "name": "probs"}, "num_states": {"templateType": "anything", "group": "Setup", "definition": "random(2..4)", "description": "", "name": "num_states"}, "prob_denom": {"templateType": "anything", "group": "Setup", "definition": "random(num_states..9)", "description": "", "name": "prob_denom"}, "evpi": {"templateType": "anything", "group": "Expected value", "definition": "evpi(utility,probs)", "description": "", "name": "evpi"}, "utility_range": {"templateType": "anything", "group": "Setup", "definition": "1..20", "description": "

Ranges to select utility from for each state.

", "name": "utility_range"}, "expected_value": {"templateType": "anything", "group": "Expected value", "definition": "map(\n sum(map(utility[j][k]*probs[k],k,0..num_states-1)),\nj, 0..num_actions-1)", "description": "", "name": "expected_value"}, "utility": {"templateType": "anything", "group": "Utility", "definition": "matrix(repeat(repeat(random(utility_range),num_states),num_actions))", "description": "

Utility for each combination of action and state.

", "name": "utility"}, "num_actions": {"templateType": "anything", "group": "Setup", "definition": "random(round(8/num_states)..round(15/num_states))", "description": "

Pick a number of actions based on the number of states so that the utility matrix should have between 8 and 15 elements (roughly).

", "name": "num_actions"}}, "ungrouped_variables": [], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "functions": {"evpi_calculation": {"type": "string", "language": "javascript", "definition": "var num_states = utility.columns;\nvar num_actions = utility.rows;\nvar total_over_states = 0;\nvar sum = [];\n\nfor(var j=0;jWhich action gives the highest expected value?

", "showPrecisionHint": false, "scripts": {}, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "variableReplacements": [], "marks": 1, "maxValue": "best_action+1"}, {"allowFractions": true, "showCorrectAnswer": true, "minValue": "evpi", "prompt": "

What is the expected value of perfect information (EVPI) for this decision?

", "showPrecisionHint": false, "scripts": {}, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": true, "variableReplacements": [], "marks": 1, "maxValue": "evpi"}], "statement": "

You must decide between {num_actions} actions, in a decision based on {num_states} states of nature. The following table gives the utility for each action in each state of nature.

\n

{table(map(['\\$a_'+(j+1)+'\\$']+list(utility[j]),j,0..num_actions-1),['']+map('\\$s_'+(j+1)+'\\$',j,0..num_states-1))}

\n

{table([['\\$\\\\pi(s_i)\\$']+map(fraction(probs[j]*prob_denom,prob_denom),j,0..num_states-1)],['\\$i\\$']+map('\\$'+j+'\\$',j,1..num_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": "len(filter(precround(expected_value[j],2)=precround(max(expected_value),2),j,0..num_actions-1))=1 // there's exactly one best action", "maxRuns": "100"}, "advice": "

a)

\n

The expected values of each action are as follows:

\n

\\[ \\var{expected_value_calculation(utility,probs)} \\]

\n

The action with the highest expected value is $a_{\\var{best_action+1}}$, with an expected value of $\\simplify[fractionnumbers]{{expected_value[best_action]}}$.

\n

b)

\n

The expected value of perfect information is given by the following formula:

\n

\\[ \\mathrm{EVPI} = \\sum_j \\pi(s_j) \\left\\{ \\max_i \\; U(a_i,s_j) \\right \\} - \\max_i \\left\\{ \\sum_j \\pi(s_j) U(a_i,s_j) \\right\\} \\]

\n

For this decision, we have

\n

\\[ \\mathrm{EVPI} = \\var{evpi_calculation(utility,probs)} \\]

"}, {"name": "Decision analysis: identify admissible actions", "extensions": ["jsxgraph", "optimisation"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "variable_groups": [{"variables": ["actions", "states", "num_actions", "num_states", "utility_ranges"], "name": "Setup"}, {"variables": ["first_state_utility", "second_state_utility", "utility"], "name": "Utility"}, {"variables": ["dominated_by", "admissible"], "name": "Admissibility"}], "variables": {"admissible": {"templateType": "anything", "group": "Admissibility", "definition": "map(\n sum(list(dominated_by[j]))=0,\n j,\n 0..num_actions-1\n)", "description": "", "name": "admissible"}, "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": "", "name": "first_state_utility"}, "states": {"templateType": "list of strings", "group": "Setup", "definition": "[ \"Good weather\", \"Bad weather\" ]", "description": "", "name": "states"}, "num_states": {"templateType": "anything", "group": "Setup", "definition": "len(states)", "description": "", "name": "num_states"}, "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": "", "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": "", "name": "dominated_by"}, "actions": {"templateType": "list of strings", "group": "Setup", "definition": "[ \"Bus\", \"Taxi\", \"Car\", \"Train\", \"Plane\" ]", "description": "", "name": "actions"}, "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}], "functions": {"describe_domination": {"type": "string", "language": "javascript", "definition": "var descriptions = [];\nfor(var i=0;i1 ? ' and ' : '') + others[others.length-1];\n } else {\n s += 'nothing';\n }\n descriptions.push(s);\n}\nreturn descriptions.join('; ');", "parameters": [["actions", "list"], ["dominated_by", "matrix"]]}, "dominates": {"type": "number", "language": "javascript", "definition": "var strictly = false;\nfor(var i=0;iu2[i]) {\n strictly = true;\n }\n}\nreturn strictly ? 1 : 0;", "parameters": [["u1", "vector"], ["u2", "vector"]]}}, "showQuestionGroupNames": false, "parts": [{"displayType": "checkbox", "minMarks": 0, "layout": {"type": "expression", "expression": "map(map(j<>k,k,1..num_actions),j,1..num_actions)"}, "choices": ["{actions[0]} dominated by", "{actions[1]} dominated by", "{actions[2]} dominated by", "{actions[3]} dominated by", "{actions[4]} dominated by"], "showCorrectAnswer": true, "matrix": "dominated_by", "prompt": "

Identify which actions dominate other actions.

", "type": "m_n_x", "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 dominated_by = question.unwrappedVariables.dominated_by;\nvar correct = 0;\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.

\n

The 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 dominate others, and identify admissible actions.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a)

\n

An action $a_1$ dominates $a_2$ if:

\n
    \n
  1. $U(a_1,s_j) \\geq U(a_2,s_j) \\; \\forall s_j$.
  2. \n
  3. There is strict inequality for at least one state $j$.
  4. \n
\n

Drawing the utility set can help to identify which actions dominate others.

\n

{utility_set(utility,actions)}

\n

From the plot of the utility set, we can see that {describe_domination(actions,dominated_by)}.

\n

b)

\n

An action is admissible if it is not dominated by any other action.

"}], "name": "", "pickQuestions": 0}], "metadata": {"notes": "", "licence": "Creative Commons Attribution 4.0 International", "description": "

For given optimisation problems, determine maximin, maximax, and minimax regret actions, expected value criteria, expected value of perfect information.

"}, "type": "exam", "navigation": {"onleave": {"action": "none", "message": ""}, "reverse": true, "browse": true, "showresultspage": "oncompletion", "preventleave": true, "allowregen": true, "showfrontpage": true}, "timing": {"timedwarning": {"action": "none", "message": ""}, "timeout": {"action": "none", "message": ""}, "allowPause": true}, "pickQuestions": 0, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "extensions": ["jsxgraph", "optimisation"], "custom_part_types": [], "resources": []}