// Numbas version: exam_results_page_options {"name": "Decision analysis: expected value criteria", "extensions": ["jsxgraph", "optimisation"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"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": [], "name": "Decision analysis: expected value criteria", "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", "extensions": ["jsxgraph", "optimisation"], "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)}

", "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/"}]}]}], "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/"}]}