// Numbas version: exam_results_page_options {"name": "Create an algebraic expression from a word problem, simplify, and evaluate in dollars version", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"description": "

Given a description in words of the costs of some items in terms of an unknown cost, write down an expression for the total cost of a selection of items. Then simplify the expression, and finally evaluate it at a given point.

\n

The word problem is about the costs of sweets in a sweet shop.

", "licence": "Creative Commons Attribution 4.0 International"}, "variable_groups": [{"variables": ["a1", "b1", "c1"], "name": "Number of packets eaten"}], "tags": [], "variablesTest": {"condition": "gcd(a1,b1+c1/2)=1", "maxRuns": 100}, "name": "Create an algebraic expression from a word problem, simplify, and evaluate in dollars version", "ungrouped_variables": ["name", "total"], "preamble": {"css": "", "js": ""}, "advice": "

a)

\n

We are told that the price of a packet of lollipops is represented by the letter $x$.

\n

A packet of toffee costs $£1$ more than a packet of lollipops, i.e. $x+1$.

\n

A packet of jelly sweets costs half as much as a packet of toffee, so $\\frac{1}{2}(x+1)$.

\n

b)

\n

To find the total cost, multiply the expressions above for the cost of each kind of sweet by the number of packets eaten, and add them together.

\n

Without simplifying, we obtain:

\n

\\begin{align}
\\text{Cost} &= \\simplify[]{{a1}x+{b1}(x+1) + {c1}*(1/2)*(x+1)} \\\\
&= \\simplify[]{{a1}x+{b1}(x+1) + {c1/2}*(x+1)}
\\text{.}
\\end{align}

\n

c)

\n

The first step in simplifying this expression is to expand both sets of brackets:

\n

\\begin{align}
\\simplify[]{ {a1}x + {b1}(x+1) + {c1/2}*(x+1)} &= \\simplify[]{ {a1}x + {b1}x + {b1}*1 + {c1/2}x + {c1/2}*1} \\\\
&= \\simplify[] { {a1}x + {b1}x + {b1} + {c1/2}x + {c1/2} } \\text{.}
\\end{align}

\n

Finally, collect like terms:

\n

\\begin{align}
\\simplify[] { {a1}x + {b1}x + {b1} + {c1/2}x + {c1/2} } &= \\simplify[]{ {a1+b1+c1/2}x + {b1+c1/2} } \\text{.}
\\end{align}

\n

\n

d)

\n

Once we know that the price of a packet of lollipops is $£2$, we can substitute this for $x$ in the equation above.

\n

\\begin{align}
\\text{Cost}&=\\simplify{ {a1+b1+c1/2}x+{b1+c1/2} }\\\\
&=\\var{a1+b1+c1/2} \\times 2+\\var{b1+c1/2} \\\\
&=\\var{(a1+b1+c1/2)*2+b1+c1/2} \\text{.}
\\end{align}

\n

So {name} spent $£\\var{total}$ on sweets last week.

", "statement": "

{name} eats a lot of sweets. You are trying to work out the cost of the sweets that {name} ate last week.

\n

{name} ate $\\var{a1}$ packets of lollipops, $\\var{b1}$ packets of toffee and $\\simplify{{c1}}$ packets of jelly sweets.

\n

You know that a packet of toffee costs $1 more than a packet of lollipops, and a packet of jelly sweets costs half as much as a packet of toffees.

", "extensions": ["stats"], "parts": [{"scripts": {}, "unitTests": [], "marks": 0, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "gaps": [{"scripts": {}, "unitTests": [], "marks": 1, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "valuegenerators": [{"value": "", "name": "x"}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "vsetRangePoints": 5, "checkingAccuracy": 0.001, "answer": "x", "type": "jme", "checkingType": "absdiff", "useCustomName": false, "failureRate": 1, "customName": "", "showFeedbackIcon": true, "checkVariableNames": false, "vsetRange": [0, 1], "showPreview": true, "showCorrectAnswer": true}, {"scripts": {}, "unitTests": [], "marks": 1, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "valuegenerators": [{"value": "", "name": "x"}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "vsetRangePoints": 5, "checkingAccuracy": 0.001, "answer": "x+1", "type": "jme", "checkingType": "absdiff", "useCustomName": false, "failureRate": 1, "customName": "", "showFeedbackIcon": true, "checkVariableNames": false, "vsetRange": [0, 1], "showPreview": true, "showCorrectAnswer": true}, {"scripts": {}, "unitTests": [], "marks": 1, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "valuegenerators": [{"value": "", "name": "x"}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "vsetRangePoints": 5, "checkingAccuracy": 0.001, "answer": "1/2(x+1)", "type": "jme", "checkingType": "absdiff", "useCustomName": false, "failureRate": 1, "customName": "", "showFeedbackIcon": true, "checkVariableNames": false, "vsetRange": [0, 1], "showPreview": true, "showCorrectAnswer": true}], "type": "gapfill", "useCustomName": false, "customName": "", "showFeedbackIcon": true, "showCorrectAnswer": true, "prompt": "

Let the cost of a packet of lollipops be $x.

\n

Write an expression in terms of $x$ for the cost of each kind of sweet:

\n

Lollipops: $[[0]]

\n

Toffees: $[[1]]

\n

Jelly sweets: $[[2]]

"}, {"scripts": {}, "unitTests": [], "marks": 0, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "gaps": [{"scripts": {}, "unitTests": [], "marks": 1, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "valuegenerators": [{"value": "", "name": "x"}], "variableReplacementStrategy": "originalfirst", "vsetRange": [0, 1], "checkingType": "absdiff", "useCustomName": false, "failureRate": 1, "showFeedbackIcon": true, "showPreview": true, "showCorrectAnswer": true, "answerSimplification": "all", "vsetRangePoints": 5, "type": "jme", "variableReplacements": [], "checkingAccuracy": 0.001, "answer": "({a1}+{b1}+{c1}/2)x+({b1}+{c1}/2)", "customName": "", "checkVariableNames": true}], "type": "gapfill", "useCustomName": false, "customName": "", "showFeedbackIcon": true, "showCorrectAnswer": true, "prompt": "

Write an algebraic expression for the overall cost of the sweets {name} ate, in terms of $x$.

\n

$[[0]]

"}, {"scripts": {}, "unitTests": [], "marks": 0, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "gaps": [{"scripts": {}, "unitTests": [], "marks": 1, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "valuegenerators": [{"value": "", "name": "x"}], "variableReplacementStrategy": "originalfirst", "vsetRange": [0, 1], "checkingType": "absdiff", "useCustomName": false, "failureRate": 1, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "partialCredit": 0, "pattern": "$n*x + $n", "message": "Your answer is not fully simplified."}, "showPreview": true, "showCorrectAnswer": true, "answerSimplification": "all", "vsetRangePoints": 5, "type": "jme", "variableReplacements": [], "checkingAccuracy": 0.001, "answer": "({a1}+{b1}+{c1}/2)x+({b1}+{c1}/2)", "customName": "", "checkVariableNames": true}], "type": "gapfill", "useCustomName": false, "customName": "", "showFeedbackIcon": true, "showCorrectAnswer": true, "prompt": "

Now simplify your expression for the total cost.

\n

$[[0]]

"}, {"scripts": {}, "unitTests": [], "marks": 0, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "gaps": [{"scripts": {}, "unitTests": [], "marks": 1, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "valuegenerators": [], "variableReplacementStrategy": "originalfirst", "vsetRange": [0, 1], "checkingType": "absdiff", "useCustomName": false, "failureRate": 1, "showFeedbackIcon": true, "showPreview": true, "showCorrectAnswer": true, "answerSimplification": "all", "vsetRangePoints": 5, "type": "jme", "variableReplacements": [], "checkingAccuracy": 0.001, "answer": "({a1}+{b1}+{c1}/2)2+{b1}+{c1}/2", "customName": "", "notallowed": {"showStrings": true, "partialCredit": 0, "strings": ["(", ")"], "message": "

Don't use brackets

"}, "checkVariableNames": true}], "type": "gapfill", "useCustomName": false, "customName": "", "showFeedbackIcon": true, "showCorrectAnswer": true, "prompt": "

You find out that a packet of lollipops costs $2.

\n

Calculate {name}'s total expenditure on sweets last week.

\n

$[[0]]

"}], "rulesets": {}, "functions": {}, "variables": {"total": {"templateType": "anything", "definition": "(a1+b1+c1/2)*2 + b1+c1/2", "description": "

The total spent.

", "group": "Ungrouped variables", "name": "total"}, "c1": {"templateType": "anything", "definition": "random(2..5)*2", "description": "

Number of packets of jelly sweets eaten.

", "group": "Number of packets eaten", "name": "c1"}, "a1": {"templateType": "anything", "definition": "random(5..10)", "description": "

Number of packets of lollipops eaten

", "group": "Number of packets eaten", "name": "a1"}, "b1": {"templateType": "anything", "definition": "random(2..10 except a1)", "description": "

Number of packets of toffee eaten

", "group": "Number of packets eaten", "name": "b1"}, "name": {"templateType": "anything", "definition": "random('Jerry','Jessica')", "description": "", "group": "Ungrouped variables", "name": "name"}}, "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Bradley Bush", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1521/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Bradley Bush", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1521/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}