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.

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

"}, "advice": "\n\nWe are told that the price of a packet of lollipops is represented by the letter $x$.

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

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

\n\nTo 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.

\nWithout 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}

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}

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}

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

\nWhich is the correct algebraic expression for the overall cost of the sweets {name} ate, in terms of $x$?

", "distractors": ["Well done!", "Have you considered the differing costs of the three different types of sweets?", "Have you considered the different quantities of each type of sweet?", "Check your expansion of brackets - have you multiplied both terms inside the bracket by the factor outside the bracket?"], "maxMarks": 0, "variableReplacements": [], "scripts": {}, "type": "1_n_2", "shuffleChoices": true, "adaptiveMarkingPenalty": 0, "minMarks": 0, "useCustomName": false, "displayColumns": 0}], "name": "NA Create an algebraic expression from a word problem and simplify (sweets)", "statement": "\n\n\n\n\n\n\n{name} eats a lot of sweets. You are trying to work out the cost of the sweets that {name} ate last month.

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

\nYou 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.

", "functions": {}, "rulesets": {}, "extensions": ["stats"], "variablesTest": {"condition": "gcd(a1,b1+c1/2)=1", "maxRuns": 100}, "variables": {"total": {"templateType": "anything", "name": "total", "group": "Ungrouped variables", "definition": "(a1+b1+c1/2)*2 + b1+c1/2", "description": "\n\n\nThe total spent.

"}, "c1": {"templateType": "anything", "name": "c1", "group": "Number of packets eaten", "definition": "random(2..5)*2", "description": "\n\n\n\nNumber of packets of jelly sweets eaten.

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

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

"}, "name": {"templateType": "anything", "name": "name", "group": "Ungrouped variables", "definition": "random('Jerry','Jessica','Luke','Lisa','Sam','Tom','Tina','MArk','Maria')", "description": "\n\n\n\n"}}, "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": "Adelle Colbourn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2083/"}]}]}], "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": "Adelle Colbourn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2083/"}]}