// Numbas version: finer_feedback_settings {"name": "21.b Find HCF of two numbers", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "21.b Find HCF of two numbers", "tags": [], "metadata": {"description": "

Find the HCF of two numbers using prime factor decomposition.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

By finding prime factors or otherwise, find the highest common factor of $\\var{x}$ and $\\var{y}$.

", "advice": "

One way to work out the highest common factor is to find all factors of both numbers and pick the largest one. A quicker and more consistent method is the following.

\n

First write each number as a product of prime powers. In this case we have 

\n

\\[\\var{x}=\\simplify[unitPower]{{DisplayXPrimePowers}}\\]

\n

\\[\\var{y}=\\simplify[unitPower]{{DisplayYPrimePowers}}.\\]

\n

The highest common factor is then found by multiplying each prime factor the least number of times it occurs in either $\\var{x}$ or $\\var{y}$. This gives us an answer of $\\text{HCF}(\\var{x},\\var{y})=\\var{HCF}$.

\n

\n

Use this link to find some resources which will help you revise this topic.

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"x": {"name": "x", "group": "Ungrouped variables", "definition": "random(2..70)", "description": "", "templateType": "anything", "can_override": false}, "y": {"name": "y", "group": "Ungrouped variables", "definition": "random(2..70)", "description": "", "templateType": "anything", "can_override": false}, "CommonFactors": {"name": "CommonFactors", "group": "Ungrouped variables", "definition": "intersection(set(divisors(x)),set(divisors(y)))", "description": "", "templateType": "anything", "can_override": false}, "Primes": {"name": "Primes", "group": "Ungrouped variables", "definition": "[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]", "description": "", "templateType": "anything", "can_override": false}, "XPrimePowersList": {"name": "XPrimePowersList", "group": "Ungrouped variables", "definition": "string(d[0])+\"^\"+string(d[1]) for: d of: filter(x[1]>0,x,zip(primes,factorise(x)))", "description": "", "templateType": "anything", "can_override": false}, "DisplayXPrimePowers": {"name": "DisplayXPrimePowers", "group": "Ungrouped variables", "definition": "expression(join(XPrimePowersList,\"*\"))", "description": "", "templateType": "anything", "can_override": false}, "HCF": {"name": "HCF", "group": "Ungrouped variables", "definition": "gcd(x,y)", "description": "", "templateType": "anything", "can_override": false}, "YPrimePowersList": {"name": "YPrimePowersList", "group": "Ungrouped variables", "definition": "string(d[0])+\"^\"+string(d[1]) for: d of: filter(x[1]>0,x,zip(primes,factorise(y)))", "description": "", "templateType": "anything", "can_override": false}, "DisplayYPrimePowers": {"name": "DisplayYPrimePowers", "group": "Ungrouped variables", "definition": "expression(join(YPrimePowersList,\"*\"))", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "len(CommonFactors)>1 && x<>y && len(CommonFactors)<4", "maxRuns": 100}, "ungrouped_variables": ["x", "y", "CommonFactors", "Primes", "XPrimePowersList", "DisplayXPrimePowers", "YPrimePowersList", "DisplayYPrimePowers", "HCF"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"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": "HCF", "maxValue": "HCF", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Andrew Neate", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21832/"}], "resources": []}]}], "contributors": [{"name": "Mash Sheffield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4679/"}, {"name": "Andrew Neate", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21832/"}]}