// Numbas version: finer_feedback_settings {"name": "Subtracting fractions", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["denom1", "num1", "denom2", "num2", "lcm", "num1b", "num2b", "denom3", "num3", "num1simp", "denom1simp", "num2simp", "denom2simp", "prompts", "prompt"], "name": "Subtracting fractions", "tags": [], "preamble": {"css": ".fractiontable table {\n width: 10%; \n padding: 0px; \n border-width: 0px; \n layout: fixed;\n}\n\n.fractiontable .tddenom \n{\n text-align: center;\n}\n\n.fractiontable .tdnum \n{\n width: 15%; \n border-bottom: 1px solid black; \n text-align: center;\n}\n\n.fractiontable .tdeq \n{\n width: 5%; \n border-bottom: 0px;\n font-size:x-large;\n}\n\n\n.fractiontable th {\n background-color:#aaa;\n}\n/*Fix the height of all cells EXCEPT table-headers to 40px*/\n.fractiontable td {\n height:40px;\n}\n", "js": ""}, "advice": "

See step  for part b.

", "rulesets": {"std": ["all"]}, "parts": [{"prompt": "

We want to find:

\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n
{num1simp}-{num2simp}
{denom1simp}{denom2simp}
\n
\n

We need to write the fractions with the same \"denominator\" (the number on the bottom).

\n

What's the smallest number that divides by {denom1simp} and {denom2simp}  (the \"lowest common multiple\")? 

\n

Answer: the lowest common multiple of  {denom1simp} and {denom2simp} = [[0]]

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "lcm", "minValue": "lcm", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}, {"stepsPenalty": 0, "prompt": "

So we can write both fractions as something over the lowest comon multiple.

\n

Then we can subtract the second numerator from the first numerator. 

\n

$\\var{prompt} $

\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
{num1simp}-{num2simp}=[[0]]-[[1]]=[[4]]
{denom1simp}{denom2simp}[[2]][[3]][[5]]
\n
\n
", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "num1b", "minValue": "num1b", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "num2b", "minValue": "num2b", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "lcm", "minValue": "lcm", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "lcm", "minValue": "lcm", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "num3", "minValue": "num3", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "denom3", "minValue": "denom3", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "steps": [{"prompt": "

The lowest common multiple of $\\var{denom1simp}$  and $\\var{denom2simp}$  is  $\\var{lcm}$

\n

So you need to write $\\frac {\\var{num1simp}} {\\var{denom1simp}}$ as $\\frac {something} {\\var{lcm}}$ = $\\frac {?} {\\var{lcm}}$ 

\n

and write $\\frac {\\var{num2simp}} {\\var{denom2simp}}$ as $\\frac {something} {\\var{lcm}}$ = $\\frac {?} {\\var{lcm}}$ 

\n

Then you can subtract the second numerator from the first numerator (and cancel, if you need to).

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "type": "gapfill"}], "extensions": [], "statement": "

Subtracting fractions.

", "variable_groups": [], "variablesTest": {"maxRuns": "180", "condition": " ((num1simp/denom1simp)> (num2simp/denom2simp)) "}, "variables": {"denom1": {"definition": "random(2..12)\n", "templateType": "anything", "group": "Ungrouped variables", "name": "denom1", "description": ""}, "num2b": {"definition": "num2simp*lcm/denom2simp", "templateType": "anything", "group": "Ungrouped variables", "name": "num2b", "description": ""}, "denom3": {"definition": "lcm/gcd(num1b-num2b, lcm)", "templateType": "anything", "group": "Ungrouped variables", "name": "denom3", "description": ""}, "denom2": {"definition": "random(2..12 except denom1)", "templateType": "anything", "group": "Ungrouped variables", "name": "denom2", "description": ""}, "num1b": {"definition": "num1simp*lcm/denom1simp", "templateType": "anything", "group": "Ungrouped variables", "name": "num1b", "description": ""}, "num1": {"definition": "denom1-random(1..denom1-2) //make sure the numerator's bigger than denom\n", "templateType": "anything", "group": "Ungrouped variables", "name": "num1", "description": ""}, "num2": {"definition": "denom2-random(1..denom2-1) //make sure the numerator's bigger than denom", "templateType": "anything", "group": "Ungrouped variables", "name": "num2", "description": ""}, "num3": {"definition": "(num1b-num2b)/gcd(num1b-num2b, lcm)", "templateType": "anything", "group": "Ungrouped variables", "name": "num3", "description": ""}, "num1simp": {"definition": "num1/gcd(num1, denom1)", "templateType": "anything", "group": "Ungrouped variables", "name": "num1simp", "description": ""}, "prompts": {"definition": "[ \"Make sure you show the result in its simplest form: you\\'ll have to cancel ...\", \" \" ]", "templateType": "list of strings", "group": "Ungrouped variables", "name": "prompts", "description": ""}, "denom1simp": {"definition": "denom1/gcd(num1,denom1)", "templateType": "anything", "group": "Ungrouped variables", "name": "denom1simp", "description": ""}, "denom2simp": {"definition": "denom2/gcd(num2,denom2)", "templateType": "anything", "group": "Ungrouped variables", "name": "denom2simp", "description": ""}, "num2simp": {"definition": "num2/gcd(num2, denom2)", "templateType": "anything", "group": "Ungrouped variables", "name": "num2simp", "description": ""}, "prompt": {"definition": "switch(gcd(num1b-num2b, lcm)>1, prompts[0],prompts[1])", "templateType": "anything", "group": "Ungrouped variables", "name": "prompt", "description": ""}, "lcm": {"definition": "lcm(denom1simp,denom2simp)\n", "templateType": "anything", "group": "Ungrouped variables", "name": "lcm", "description": ""}}, "metadata": {"description": "

Subtracting fractions.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Rob Cade", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/70/"}]}]}], "contributors": [{"name": "Rob Cade", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/70/"}]}