// Numbas version: exam_results_page_options {"name": "Adelle's copy of Create an algebraic expression from a word problem, simplify, and evaluate", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"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.

", "name": "Adelle's copy of Create an algebraic expression from a word problem, simplify, and evaluate", "preamble": {"js": "", "css": ""}, "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/", "name": "Christian Lawson-Perfect"}, {"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1521/", "name": "Bradley Bush"}, {"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2083/", "name": "Adelle Colbourn"}], "tags": [], "extensions": ["stats"], "variables": {"total": {"description": "

The total spent.

", "name": "total", "group": "Ungrouped variables", "templateType": "anything", "definition": "(a1+b1+c1/2)*2 + b1+c1/2"}, "name": {"description": "", "name": "name", "group": "Ungrouped variables", "templateType": "anything", "definition": "random('Jerry','Jessica')"}, "a1": {"description": "

Number of packets of lollipops eaten

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

Number of packets of jelly sweets eaten.

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

Number of packets of toffee eaten

", "name": "b1", "group": "Number of packets eaten", "templateType": "anything", "definition": "random(2..10 except a1)"}}, "functions": {}, "variable_groups": [{"name": "Number of packets eaten", "variables": ["a1", "b1", "c1"]}], "variablesTest": {"maxRuns": 100, "condition": "gcd(a1,b1+c1/2)=1"}, "parts": [{"showCorrectAnswer": true, "gaps": [{"showCorrectAnswer": true, "valuegenerators": [{"name": "x", "value": ""}], "failureRate": 1, "checkVariableNames": false, "unitTests": [], "checkingType": "absdiff", "showPreview": true, "variableReplacements": [], "marks": 1, "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "answer": "x", "customName": "", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "scripts": {}, "checkingAccuracy": 0.001, "vsetRange": [0, 1], "useCustomName": false, "type": "jme"}, {"showCorrectAnswer": true, "valuegenerators": [{"name": "x", "value": ""}], "failureRate": 1, "checkVariableNames": false, "unitTests": [], "checkingType": "absdiff", "showPreview": true, "variableReplacements": [], "marks": 1, "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "answer": "x+1", "customName": "", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "scripts": {}, "checkingAccuracy": 0.001, "vsetRange": [0, 1], "useCustomName": false, "type": "jme"}, {"showCorrectAnswer": true, "valuegenerators": [{"name": "x", "value": ""}], "failureRate": 1, "checkVariableNames": false, "unitTests": [], "checkingType": "absdiff", "showPreview": true, "variableReplacements": [], "marks": 1, "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "answer": "1/2(x+1)", "customName": "", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "scripts": {}, "checkingAccuracy": 0.001, "vsetRange": [0, 1], "useCustomName": false, "type": "jme"}], "variableReplacementStrategy": "originalfirst", "unitTests": [], "variableReplacements": [], "sortAnswers": false, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "customName": "", "marks": 0, "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]]

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

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

\n

£[[0]]

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

Now simplify your expression for the total cost.

\n

£[[0]]

", "customMarkingAlgorithm": "", "scripts": {}, "useCustomName": false, "type": "gapfill"}, {"showCorrectAnswer": true, "gaps": [{"valuegenerators": [], "notallowed": {"showStrings": true, "strings": ["(", ")"], "partialCredit": 0, "message": "

Don't use brackets

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

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

\n

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

\n

£[[0]]

", "customMarkingAlgorithm": "", "scripts": {}, "useCustomName": false, "type": "gapfill"}], "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.

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

", "rulesets": {}, "ungrouped_variables": ["name", "total"]}]}], "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/", "name": "Christian Lawson-Perfect"}, {"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1521/", "name": "Bradley Bush"}, {"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2083/", "name": "Adelle Colbourn"}]}