// Numbas version: exam_results_page_options {"name": "Numerical reasoning - prices in ratios", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"describefraction": {"definition": "//put fraction into words\n \n numbers = ['zero','one','two','three','four','five','six','seven','eight','nine','ten'];\n denominators = ['','','half','third','quarter','fifth','sixth','seventh','eighth','ninth','tenth'];\n \n var gcd = Numbas.math.gcf(n,d);\n n /= gcd;\n d /= gcd;\n \n if(n%d==0) {\n var t = n/d;\n switch(t) {\n case 1:\n return 'the same as';\n case 2:\n return 'twice as much as';\n default:\n return numbers[t]+' times as much as';\n }\n }\n else if(n>d) {\n var t = (n-(n%d))/d;\n var m = n%d;\n if(m==1)\n return numbers[t]+'-and-a-'+denominators[d]+' times as much as';\n else\n return numbers[t]+'-and-'+numbers[m]+'-'+denominators[d]+(m>1?'s':'')+' times as much as';\n }\n else if(d==2) {\n return 'half as much as';\n }\n else {\n return numbers[n]+'-'+denominators[d]+(n>1?'s':'')+' as much as';\n }", "type": "string", "language": "javascript", "parameters": [["n", "number"], ["d", "number"]]}, "pluralise": {"definition": "return Numbas.util.pluralise(n,singular,plural);", "type": "string", "language": "javascript", "parameters": [["n", "number"], ["singular", "string"], ["plural", "string"]]}, "capitalise": {"definition": "return Numbas.util.capitalise(s);", "type": "string", "language": "javascript", "parameters": [["s", "string"]]}}, "name": "Numerical reasoning - prices in ratios", "tags": ["constraints", "numerical reasoning", "ratio", "simultaneous equations"], "advice": "

Here are two solutions. The first uses the idea of shares and the second uses algebra.

\n

Solution 1 (shares)

\n

We are given that the cost of \\[ \\var{ratio[dirs[1]]/gcd(ratio[dirs[0]],ratio[dirs[1]])} \\times \\var{ops[dirs[0]]} = \\var{ratio[dirs[0]]/gcd(ratio[dirs[0]],ratio[dirs[1]])} \\times \\var{ops[dirs[1]]} \\] and \\[ \\var{ratio[dirs[2]]/gcd(ratio[dirs[1]],ratio[dirs[2]])} \\times \\var{ops[dirs[1]]} = \\var{ratio[dirs[1]]/gcd(ratio[dirs[1]],ratio[dirs[2]])} \\times \\var{ops[dirs[2]]}. \\]

\n

We can represent the ratios of the costs for {ops[dirs[0]]}, {ops[dirs[1]]} and {ops[dirs[2]]} by giving cost shares to each of the repairs in the ratios {ratio[dirs[0]]}:{ratio[dirs[1]]}:{ratio[dirs[2]]}.

\n

That is, give {ops[dirs[0]]} {ratio[dirs[0]]} {pluralise(ratio[dirs[0]],'share','shares')}, {ops[dirs[1]]} {ratio[dirs[1]]} {pluralise(ratio[dirs[1]],'share','shares')} and {ops[dirs[2]]} {ratio[dirs[2]]} {pluralise(ratio[dirs[2]],'share','shares')}. Then the relative costs are preserved.

\n

Hence there are $\\var{ratio[dirs[0]]}+\\var{ratio[dirs[1]]}+\\var{ratio[dirs[2]]} = \\var{ratiototal}$ shares to add up to £{total}.

\n

So each share is worth $\\var{total} \\div \\var{ratiototal} = £\\var{factor}$ and {ops[wanted]} gets {ratio[wanted]} {pluralise(ratio[wanted],'share','shares')} i.e. costs £{prices[wanted]}.

\n

Solution 2 (algebra)

\n

Let $\\var{letters[0]}$ = {ops[0]}, $\\var{letters[1]}$ = {ops[1]}, $\\var{letters[2]}$ = {ops[2]}.

\n

We are given that $\\var{letters[dirs[0]]} = \\simplify{{ratio[dirs[0]]}/{ratio[dirs[1]]}} \\var{letters[dirs[1]]}$, and $\\var{letters[dirs[1]]} = \\simplify{{ratio[dirs[1]]}/{ratio[dirs[2]]}} \\var{letters[dirs[2]]}$.

\n

Rearrange the second equation to give $\\var{letters[dirs[2]]}$ in terms of $\\var{letters[dirs[1]]}$:

\n

\\[ \\var{letters[dirs[2]]} = \\simplify{{ratio[dirs[2]]}/{ratio[dirs[1]]}} \\var{letters[dirs[1]]} \\]

\n

So \\[ \\begin{eqnarray} \\textrm{total cost of repair work} &=& \\var{letters[dirs[0]]} + \\var{letters[dirs[1]]} + \\var{letters[dirs[2]]} \\\\ &=& \\simplify{{ratio[dirs[0]]}/{ratio[dirs[1]]}} \\var{letters[dirs[1]]} + \\var{letters[dirs[1]]} + \\simplify{{ratio[dirs[2]]}/{ratio[dirs[1]]}} \\var{letters[dirs[1]]} \\\\ &=& \\left( \\simplify{{ratio[dirs[0]]}/{ratio[dirs[1]]}} + 1 + \\simplify{{ratio[dirs[2]]}/{ratio[dirs[1]]}} \\right) \\var{letters[dirs[1]]} \\\\ &=& \\simplify{{ratiototal}/{ratio[dirs[1]]}} \\var{letters[dirs[1]]}. \\end{eqnarray} \\]

\n

Hence $\\simplify{{ratiototal}/{ratio[dirs[1]]}} \\var{letters[dirs[1]]} = £\\var{total}$ gives us $\\var{letters[dirs[1]]} = \\simplify{{ratio[dirs[1]]}/{ratiototal}} \\times £\\var{total} = £\\var{prices[dirs[1]]}$.

\n

So the cost of {ops[wanted]} was £{prices[wanted]}.

", "rulesets": {}, "parts": [{"prompt": "

What did {ops[wanted]} cost?

\n

£ [[0]]

", "gaps": [{"minvalue": "{prices[wanted]}", "type": "numberentry", "maxvalue": "{prices[wanted]}", "marks": 1.0, "showPrecisionHint": false}], "type": "gapfill", "marks": 0.0}], "extensions": ["stats"], "statement": "

The total cost for three items of work on a {car} was £{total}.

\n

These items were: {ops[0]}, {ops[1]} and {ops[2]}.

\n

{capitalise(ops[dir1[0]])} costs {describefraction(ratio[dir1[0]],ratio[dir1[1]])} {ops[dir1[1]]}.

\n

{capitalise(ops[dir2[0]])} costs {describefraction(ratio[dir2[0]],ratio[dir2[1]])} {ops[dir2[1]]}.

", "variable_groups": [], "progress": "ready", "type": "question", "variables": {"dirs": {"definition": "shuffle([0,1,2])", "name": "dirs"}, "dir2": {"definition": "[dirs[1],dirs[2]]", "name": "dir2"}, "dir1": {"definition": "[dirs[0],dirs[1]]", "name": "dir1"}, "wanted": {"definition": "dirs[1]", "name": "wanted"}, "letters": {"definition": "map(allops[j][1],j,0..2)", "name": "letters"}, "r1": {"definition": "random(possibleratios)", "name": "r1"}, "r2": {"definition": "random(possibleratios except r1)", "name": "r2"}, "ops": {"definition": "map(allops[j][0],j,0..2)", "name": "ops"}, "allops": {"definition": "shuffle([['overhauling the carburettor','C'],['replacing the brake pads','B'],['refilling the air-con','A'],['replacing the gearbox','G'],['balancing the wheels','W']])[0..3]", "name": "allops"}, "r3": {"definition": "random(possibleratios except [r1,r2])", "name": "r3"}, "f2": {"definition": "lcm(ratio[dirs[0]],ratio[dirs[2]])/ratio[dirs[2]]", "name": "f2"}, "f1": {"definition": "lcm(ratio[dirs[0]],ratio[dirs[2]])/ratio[dirs[0]]", "name": "f1"}, "total": {"definition": "ratiototal*factor", "name": "total"}, "possibleratios": {"definition": "[1,2,3,4,5,6,7,8]", "name": "possibleratios"}, "prices": {"definition": "map(ratio[j]*factor,j,[0,1,2])", "name": "prices"}, "gcdr": {"definition": "//gcd of r1,r2,r3\n gcd(gcd(r1,r2),r3)", "name": "gcdr"}, "ratiototal": {"definition": "sum(ratio)", "name": "ratiototal"}, "factor": {"definition": "random(12..20)", "name": "factor"}, "ratio": {"definition": "[r1/gcdr,r2/gcdr,r3/gcdr]", "name": "ratio"}}, "metadata": {"notes": "", "description": "

Three items of work done on a car. Given total price, and a couple of ratios of prices between pairs of items, work out the cost of one of the items.

\n

Based on question 4 from section 3 of the Maths-Aid workbook on numerical reasoning.

", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}