// Numbas version: exam_results_page_options {"name": "LCM and HCF", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "LCM and HCF", "tags": [], "metadata": {"description": "Calculating the LCM and HCF of numbers by using prime factorisation.", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

$x = \\var{x}$

\n

$y = \\var{y}$

\n

$z = \\var{z}$

\n

\n

By considering the prime factorisation of $x, y $ and $z$, or otherwise, find:

", "advice": "

We can write $x,y,z$ as a product of prime factors as follows:

\n

$x=\\var{x}=\\var{show_factors(x)}$

\n

$y=\\var{y}=\\var{show_factors(y)}$

\n

$z=\\var{z}=\\var{show_factors(z)}$

\n

\n

For HCF of $\\var{x}$ and $\\var{y}$ we need to multiply each factor the least number of times it occurs in either $\\var{x}$ or $\\var{y}$

\n

i.e. HCF$(x,y) = \\var{show_factors(hcf_xy)}=\\var{hcf_xy}$

\n

\n

For LCM of $\\var{x}$ and $\\var{y}$ we need to multiply each factor the greatest number of times it occurs in either $\\var{x}$ or $\\var{y}$

\n

i.e. LCM$(x,y) = \\var{show_factors(lcm_xy)}=\\var{lcm_xy}$

\n

\n

For HCF of $\\var{x}$ and $\\var{z}$ we need to multiply each factor the least number of times it occurs in either $\\var{x}$ or $\\var{z}$

\n

i.e. HCF$(x,z) = \\var{show_factors(hcf_xz)}=\\var{hcf_xz}$

\n

\n

For LCM of $\\var{x}$ and $\\var{z}$ we need to multiply each factor the greatest number of times it occurs in either $\\var{x}$ or $\\var{z}$

\n

i.e. LCM$(x,z) = \\var{show_factors(lcm_xz)}=\\var{lcm_xz}$

\n

\n

For HCF of $\\var{x},\\var{y}$ and $\\var{z}$ we need to multiply each factor the least number of times it occurs in either $\\var{x}$ or $\\var{y}$ or $\\var{z}$

\n

i.e. HCF$(x,y,z) = \\var{show_factors(hcf_xyz)}=\\var{hcf_xyz}$

\n

\n

For LCM of $\\var{x},\\var{y}$ and $\\var{z}$ we need to multiply each factor the greatest number of times it occurs in either $\\var{x}$ or $\\var{y}$ or $\\var{z}$

\n

i.e. LCM$(x,y,z) = \\var{show_factors(lcm_xyz)}=\\var{lcm_xyz}$

\n

", "rulesets": {}, "extensions": [], "variables": {"x_powers": {"name": "x_powers", "group": "Ungrouped variables", "definition": "[random(1..4),random(0..4),random(0..3),random(0..3)]", "description": "", "templateType": "anything"}, "y_powers": {"name": "y_powers", "group": "Ungrouped variables", "definition": "[random(0..4),random(1..4),random(0..3),random(0..2)]", "description": "", "templateType": "anything"}, "z_powers": {"name": "z_powers", "group": "Ungrouped variables", "definition": "[random(1..4),random(1..4),random(0..3),random(1..2)]", "description": "", "templateType": "anything"}, "x": {"name": "x", "group": "Ungrouped variables", "definition": "2^x_powers[0]*3^x_powers[1]*5^x_powers[2]*7^x_powers[3]", "description": "", "templateType": "anything"}, "y": {"name": "y", "group": "Ungrouped variables", "definition": "2^y_powers[0]*3^y_powers[1]*5^y_powers[2]*7^y_powers[3]", "description": "", "templateType": "anything"}, "z": {"name": "z", "group": "Ungrouped variables", "definition": "2^z_powers[0]*3^z_powers[1]*5^z_powers[2]*7^z_powers[3]", "description": "", "templateType": "anything"}, "hcf_xy": {"name": "hcf_xy", "group": "Ungrouped variables", "definition": "2^min(x_powers[0],y_powers[0])*3^min(x_powers[1],y_powers[1])*5^min(x_powers[2],y_powers[2])*7^min(x_powers[3],y_powers[3])", "description": "", "templateType": "anything"}, "hcf_xz": {"name": "hcf_xz", "group": "Ungrouped variables", "definition": "2^min(x_powers[0],z_powers[0])*3^min(x_powers[1],z_powers[1])*5^min(x_powers[2],z_powers[2])*7^min(x_powers[3],z_powers[3])", "description": "", "templateType": "anything"}, "lcm_xy": {"name": "lcm_xy", "group": "Ungrouped variables", "definition": "2^max(x_powers[0],y_powers[0])*3^max(x_powers[1],y_powers[1])*5^max(x_powers[2],y_powers[2])*7^max(x_powers[3],y_powers[3])", "description": "", "templateType": "anything"}, "lcm_xz": {"name": "lcm_xz", "group": "Ungrouped variables", "definition": "2^max(x_powers[0],z_powers[0])*3^max(x_powers[1],z_powers[1])*5^max(x_powers[2],z_powers[2])*7^max(x_powers[3],z_powers[3])", "description": "", "templateType": "anything"}, "hcf_xyz": {"name": "hcf_xyz", "group": "Ungrouped variables", "definition": "2^min([x_powers[0],y_powers[0],z_powers[0]])*3^min([x_powers[1],y_powers[1],z_powers[1]])*5^min([x_powers[2],y_powers[2],z_powers[2]])*7^min([x_powers[3],y_powers[3],z_powers[3]])", "description": "", "templateType": "anything"}, "lcm_xyz": {"name": "lcm_xyz", "group": "Ungrouped variables", "definition": "2^max([x_powers[0],y_powers[0],z_powers[0]])*3^max([x_powers[1],y_powers[1],z_powers[1]])*5^max([x_powers[2],y_powers[2],z_powers[2]])*7^max([x_powers[3],y_powers[3],z_powers[3]])", "description": "", "templateType": "anything"}, "primes": {"name": "primes", "group": "Ungrouped variables", "definition": "[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "x_powers[0]+x_powers[1]+x_powers[2]+x_powers[3]<8\nand\nx_powers[0]+x_powers[1]+x_powers[2]+x_powers[3]>1\nand\ny_powers[0]+y_powers[1]+y_powers[2]+y_powers[3]<8\nand\ny_powers[0]+y_powers[1]+y_powers[2]+y_powers[3]>1\nand\nz_powers[0]+z_powers[1]+z_powers[2]+z_powers[3]<8\nand\nz_powers[0]+z_powers[1]+z_powers[2]+z_powers[3]>1\nand (x-y)(y-z)(x-z)<>0\nand hcf_xyz>1", "maxRuns": "500"}, "ungrouped_variables": ["x_powers", "y_powers", "z_powers", "x", "y", "z", "hcf_xy", "hcf_xz", "lcm_xy", "lcm_xz", "hcf_xyz", "lcm_xyz", "primes"], "variable_groups": [], "functions": {"show_factors": {"parameters": [["n", "number"]], "type": "string", "language": "jme", "definition": "latex( // mark the output as a string of raw LaTeX\n join(\n map(\n if(a=1,p,p+'^{'+a+'}'), // when the exponent is 1, return p, otherwise return p^{exponent}\n [p,a],\n filter(x[1]>0,x,zip(primes,factorise(n))) // for all the primes p which are factors of n, return p and its exponent\n ),\n ' \\\\times ' // join all the prime powers up with \\times symbols\n )\n)"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

The highest common factor (HCF) of $x$ and $y$

", "minValue": "hcf_xy", "maxValue": "hcf_xy", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

The lowest common multiple (LCM) of $x$ and $y$

", "minValue": "lcm_xy", "maxValue": "lcm_xy", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

The HCF of $x$ and $z$

", "minValue": "hcf_xz", "maxValue": "hcf_xz", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

The LCM of $x$ and $z$

", "minValue": "lcm_xz", "maxValue": "lcm_xz", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

The HCF of $x,y$ and $z$

", "minValue": "hcf_xyz", "maxValue": "hcf_xyz", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

The LCM of $x,y$ and $z$

", "minValue": "lcm_xyz", "maxValue": "lcm_xyz", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "contributors": [{"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}