// Numbas version: exam_results_page_options {"name": "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": [{"name": "Using compound units: price/weight of sweets", "tags": ["Compound units", "compound units", "conversion", "measurements", "rate of pay", "speed", "taxonomy", "unit pricing", "using compound units"], "metadata": {"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.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

{pname} goes to {pronouns['their']} local shop and buys a bag containing $\\var{weight}$g of sweets for £$\\var{cost}$.

", "advice": "

a)

\n

We are given the price of a bag of $\\var{weight}$ grams of sweets.

\n

To 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}

\n

The sweets cost {pounds(100*cost/weight)} per 100g.

\n

b)

\n

To 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}$.

\n

This means that $100\\text{g} = \\displaystyle\\frac{1}{10}\\text{kg}$.

\n

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

\n

We want the price per one kilogram of sweets, so we multiply by $10$.

\n

Note 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}

\n

So, the sweets cost {pounds(1000*cost/weight)} per kg.

\n

c)

\n

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

", "rulesets": {}, "extensions": ["random_person"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"pronouns": {"name": "pronouns", "group": "Ungrouped variables", "definition": "person['pronouns']", "description": "", "templateType": "anything", "can_override": false}, "cost": {"name": "cost", "group": "Ungrouped variables", "definition": "precround(cost_per_g*weight,1)-0.01", "description": "

Cost of a bag of sweets - always ends in .x9 to look like a real price.

", "templateType": "anything", "can_override": false}, "max_kg_cost": {"name": "max_kg_cost", "group": "Ungrouped variables", "definition": "max(precround(1000*cost/weight,2), precround(100*cost/weight,2)*10)", "description": "

Minimum acceptable cost per kg - using the rounded cost per 100g can introduce an error.

", "templateType": "anything", "can_override": false}, "pname": {"name": "pname", "group": "Ungrouped variables", "definition": "person['name']", "description": "", "templateType": "anything", "can_override": false}, "pick_n_mix_cost": {"name": "pick_n_mix_cost", "group": "Ungrouped variables", "definition": "precround(100*cost/weight,2)+random(-15..15 except -2..2)*0.01", "description": "

Cost of the sweets at the Pick'n'Mix, per 100g.

", "templateType": "anything", "can_override": false}, "min_kg_cost": {"name": "min_kg_cost", "group": "Ungrouped variables", "definition": "min(precround(1000*cost/weight,2), precround(100*cost/weight,2)*10)", "description": "

Minimum acceptable cost per kg - using the rounded cost per 100g can introduce an error.

", "templateType": "anything", "can_override": false}, "weight": {"name": "weight", "group": "Ungrouped variables", "definition": "random(150..200)", "description": "

Weight of a bag of sweets, in grams

", "templateType": "anything", "can_override": false}, "person": {"name": "person", "group": "Ungrouped variables", "definition": "random_person()", "description": "", "templateType": "anything", "can_override": false}, "cost_per_g": {"name": "cost_per_g", "group": "Ungrouped variables", "definition": "random(0.005..0.02#0)", "description": "

Cost of the sweets per gram, in pounds.

\n

Between 50p and £2 per 100g.

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": "10000"}, "ungrouped_variables": ["weight", "cost_per_g", "cost", "min_kg_cost", "max_kg_cost", "person", "pname", "pronouns", "pick_n_mix_cost"], "variable_groups": [], "functions": {"pounds": {"parameters": [["n", "number"]], "type": "string", "language": "jme", "definition": "currency(n,\"\u00a3\",\"p\")"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

How much do the sweets cost per $100$ grams?

\n

£[[0]] per $100$g

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "100*cost/weight", "maxValue": "100*cost/weight", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "

Round your answer to $2$ decimal places.

", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

How much is this in pounds per kilogram?

\n

£[[0]]  per kg

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "1000*cost/weight", "maxValue": "1000*cost/weight", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "

Round your answer to $2$ decimal places.

", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

{pname} notices that the same sweets are available from the Pick'n'Mix for {pounds(pick_n_mix_cost)} per 100g.

\n

Should {pronouns['they']} buy {pronouns['their']} sweets from the Pick'n'Mix instead?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["

Yes, the Pick'n'Mix is cheaper.

", "

No, the Pick'n'Mix is more expensive.

"], "matrix": "if(pick_n_mix_cost<100*cost/weight,[1,0],[0,1])"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"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": "Elliott Fletcher", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1591/"}]}