// Numbas version: exam_results_page_options {"name": "David's copy of Using compound units: price/weight of sweets", "extensions": ["random_person"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"scripts": {}, "prompt": "
How much do the sweets cost per $100$ grams?
\n£[[0]] per $100$g
", "showFeedbackIcon": true, "gaps": [{"showPrecisionHint": false, "correctAnswerStyle": "plain", "precisionMessage": "Round your answer to $2$ decimal places.
", "showFeedbackIcon": true, "minValue": "100*cost/weight", "precisionType": "dp", "scripts": {}, "type": "numberentry", "strictPrecision": false, "maxValue": "100*cost/weight", "allowFractions": false, "marks": 1, "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "mustBeReduced": false, "precisionPartialCredit": 0, "showCorrectAnswer": true, "correctAnswerFraction": false, "precision": "2", "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"]}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}, {"scripts": {}, "prompt": "How much is this in pounds per kilogram?
\n£[[0]] per kg
", "showFeedbackIcon": true, "gaps": [{"showPrecisionHint": false, "correctAnswerStyle": "plain", "precisionMessage": "Round your answer to $2$ decimal places.
", "showFeedbackIcon": true, "minValue": "1000*cost/weight", "precisionType": "dp", "scripts": {}, "type": "numberentry", "strictPrecision": false, "maxValue": "1000*cost/weight", "allowFractions": false, "marks": 1, "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "mustBeReduced": false, "precisionPartialCredit": 0, "showCorrectAnswer": true, "correctAnswerFraction": false, "precision": "2", "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"]}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}, {"maxMarks": 0, "showFeedbackIcon": true, "type": "1_n_2", "variableReplacementStrategy": "originalfirst", "displayColumns": 0, "scripts": {}, "prompt": "{name} notices that the same sweets are available from the Pick'n'Mix for {pounds(pick_n_mix_cost)} per 100g.
\nShould {pronouns['they']} buy {pronouns['their']} sweets from the Pick'n'Mix instead?
", "displayType": "radiogroup", "shuffleChoices": false, "minMarks": 0, "choices": ["Yes, the Pick'n'Mix is cheaper.
", "No, the Pick'n'Mix is more expensive.
"], "showCorrectAnswer": true, "marks": 0, "variableReplacements": [], "matrix": "if(pick_n_mix_cost<100*cost/weight,[1,0],[0,1])"}], "tags": ["compound units", "Compound units", "conversion", "measurements", "rate of pay", "speed", "taxonomy", "unit pricing", "using compound units"], "advice": "We are given the price of a bag of $\\var{weight}$ grams of sweets.
\nTo find the price per 100g of sweets we divide the price of a bag of sweets by its weight in grams and then multiply this by $100$.
\n\\[\\displaystyle\\frac{\\var{cost}}{\\var{weight}} \\times 100 = \\var{(100*cost/weight)}.\\]
\n\\begin{align}
\\displaystyle\\frac{\\var{cost}}{\\var{weight}} \\times 100 &= \\var{(100*cost/weight)}\\\\ &= \\var{dpformat(100*cost/weight,2)} \\; (\\text{rounded to $2$ decimal places}).
\\end{align}
The sweets cost {pounds(100*cost/weight)} per 100g.
\nTo convert the cost from pounds per $100$ grams to pounds per kilogram we need to use the fact that $1\\text{g} = \\displaystyle\\frac{1}{1000}\\text{kg}$.
\nThis means that $100\\text{g} = \\displaystyle\\frac{1}{10}\\text{kg}$.
\nWe know from a) that sweets cost {pounds(100*cost/weight)} per 100g, which is the same as {pounds(100*cost/weight)} per $\\frac{1}{10}$kg.
\nWe want the price per one kilogram of sweets, so we multiply by $10$.
\nNote that we use the actual value of $\\displaystyle\\frac{\\var{cost}}{\\var{weight}} \\times 100 = \\var{100*cost/weight}$ here to ensure that our final answer is accurate.
\n\\begin{align}
\\var{100*cost/{weight}} \\times 10 &= \\var{dpformat(1000*{cost}/{weight},2)} \\; (2 \\; \\text{d.p})
\\end{align}
So, the sweets cost {pounds(1000*cost/weight)} per kg.
\nWe worked out in part a) that sweets cost {pounds(100*cost/weight)} per 100g when bought in the bag, so at {pounds(pick_n_mix_cost)} per 100g the Pick'n'Mix is {if(pick_n_mix_cost<100*cost/weight,'cheaper','more expensive')} than buying the bag.
", "statement": "{name} goes to {pronouns['their']} local shop and buys a bag containing $\\var{weight}$g of sweets for £$\\var{cost}$.
", "variables": {"cost": {"templateType": "anything", "definition": "precround(cost_per_g*weight,1)-0.01", "name": "cost", "group": "Ungrouped variables", "description": "Cost of a bag of sweets - always ends in .x9 to look like a real price.
"}, "name": {"templateType": "anything", "definition": "person['name']", "name": "name", "group": "Ungrouped variables", "description": ""}, "min_kg_cost": {"templateType": "anything", "definition": "min(precround(1000*cost/weight,2), precround(100*cost/weight,2)*10)", "name": "min_kg_cost", "group": "Ungrouped variables", "description": "Minimum acceptable cost per kg - using the rounded cost per 100g can introduce an error.
"}, "person": {"templateType": "anything", "definition": "random_person()", "name": "person", "group": "Ungrouped variables", "description": ""}, "cost_per_g": {"templateType": "anything", "definition": "random(0.005..0.02#0)", "name": "cost_per_g", "group": "Ungrouped variables", "description": "Cost of the sweets per gram, in pounds.
\nBetween 50p and £2 per 100g.
"}, "weight": {"templateType": "anything", "definition": "random(150..200)", "name": "weight", "group": "Ungrouped variables", "description": "Weight of a bag of sweets, in grams
"}, "pronouns": {"templateType": "anything", "definition": "person['pronouns']", "name": "pronouns", "group": "Ungrouped variables", "description": ""}, "pick_n_mix_cost": {"templateType": "anything", "definition": "precround(100*cost/weight,2)+random(-15..15 except -2..2)*0.01", "name": "pick_n_mix_cost", "group": "Ungrouped variables", "description": "Cost of the sweets at the Pick'n'Mix, per 100g.
"}, "max_kg_cost": {"templateType": "anything", "definition": "max(precround(1000*cost/weight,2), precround(100*cost/weight,2)*10)", "name": "max_kg_cost", "group": "Ungrouped variables", "description": "Minimum acceptable cost per kg - using the rounded cost per 100g can introduce an error.
"}}, "functions": {"pounds": {"type": "string", "parameters": [["n", "number"]], "definition": "currency(n,\"\u00a3\",\"p\")", "language": "jme"}}, "variablesTest": {"condition": "", "maxRuns": "10000"}, "ungrouped_variables": ["weight", "cost_per_g", "cost", "min_kg_cost", "max_kg_cost", "person", "name", "pronouns", "pick_n_mix_cost"], "extensions": ["random_person"], "variable_groups": [], "rulesets": {}, "name": "David's copy of Using compound units: price/weight of sweets", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "This question assesses the students ability to calculate and convert between different types of compound units, including rates of pay, speed and unit pricing.
"}, "preamble": {"css": "", "js": ""}, "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "David Rickard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/451/"}, {"name": "Elliott Fletcher", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1591/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "David Rickard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/451/"}, {"name": "Elliott Fletcher", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1591/"}]}