// Numbas version: exam_results_page_options {"name": "NA Create an algebraic expression from a word problem and simplify (sweets)", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"tags": [], "ungrouped_variables": ["name", "total"], "preamble": {"js": "", "css": ""}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "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.

\n\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\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 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 \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 ", "variable_groups": [{"name": "Number of packets eaten", "variables": ["a1", "b1", "c1"]}], "parts": [{"showCorrectAnswer": true, "choices": ["\\simplify[]{ {a1+b1+c1/2}x + {b1+c1/2} }$", "$\\simplify[]{ {a1+b1+c1}x  }$", "$\\simplify[]{ 5x/2 + 1.5 }$", "$\\simplify[]{ {a1+b1+c1/2}x + 2 }$"], "marks": 0, "customMarkingAlgorithm": "", "displayType": "radiogroup", "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "matrix": ["1", 0, 0, 0], "showCellAnswerState": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": " \n Let the cost of a packet of lollipops be$\\$x$.

\n

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

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

", "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
\n

The total spent.

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

Number 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
\n

Number of packets of toffee eaten

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

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