// Numbas version: exam_results_page_options {"name": "Factorise numbers into products of prime powers", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"e2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(e1>1,0,2)", "description": "", "name": "e2"}, "lgp": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[59,61,67,73,79]", "description": "", "name": "lgp"}, "e1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2,3)", "description": "", "name": "e1"}, "p1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(sgp)", "description": "", "name": "p1"}, "e3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "1", "description": "", "name": "e3"}, "p3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(mgp)", "description": "", "name": "p3"}, "e5": {"group": "Ungrouped variables", "templateType": "anything", "definition": "1", "description": "", "name": "e5"}, "p5": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(lgp)", "description": "", "name": "p5"}, "sgp": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[2,2,2,3,3,3,5,5,5,7,7,7,11,11,13]", "description": "", "name": "sgp"}, "p2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(sgp)", "description": "", "name": "p2"}, "mgp": {"group": "Ungrouped variables", "templateType": "anything", "definition": "[17,19,23,29,31,37,41,43,47]", "description": "", "name": "mgp"}, "ntbf": {"group": "Ungrouped variables", "templateType": "anything", "definition": "p1^e1 * p2^e2 * p3^e3 * p5^e5", "description": "", "name": "ntbf"}}, "ungrouped_variables": ["p2", "p3", "p1", "p5", "sgp", "ntbf", "mgp", "e5", "lgp", "e1", "e3", "e2"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Factorise numbers into products of prime powers", "showQuestionGroupNames": false, "functions": {}, "parts": [{"scripts": {}, "gaps": [{"answer": "{p1^e1*p2^e2*p3^e3*p5^e5}", "musthave": {"message": "

Split into factors, each factor a power of a prime number and include the multiplication sign * between the factors

", "showStrings": false, "partialCredit": 0, "strings": ["*", "^"]}, "vsetrange": [0, 1], "scripts": {"constructor": {"script": "question.createFactorisePart(this);", "order": "after"}, "mark": {"script": "question.markFactorisePart(this);", "order": "instead"}}, "answersimplification": "unitPower,zeroPower,unitFactor", "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "checkingaccuracy": 0.001, "minlength": {"length": 7, "message": "", "partialCredit": 0}, "type": "jme", "checkvariablenames": false, "showCorrectAnswer": true, "marks": 3, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "\n\n\n

Factorize completely $\\var{ntbf}$.

\n\n\n\n

Input your answer in the form p^r * q^s * ... where $p, q, \\dots$ are distinct primes and $r, s, \\dots$ are their powers.

\n\n\n\n

$\\var{ntbf}=\\;\\;$[[0]]

\n\n\n\n

(There is a Maple function $\\mathrm{ifactor}(n)$ which factorizes integers.)

\n\n", "showCorrectAnswer": true, "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "", "tags": ["Arithmetic", "arithmetic", "checked2015", "factorisation", "factorization", "integers", "MAS3214", "number theory", "prime factorisation", "prime factorization", "prime factors", "prime numbers", "prime powers"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": "question.createFactorisePart = function(p) {\n var n = parseInt(p.settings.correctAnswer);\n var factors = Numbas.math.factorise(n);\n\n p.settings.correctAnswer = p.display.correctAnswer = factors.map(function(pow,i){\n if(pow==1) {\n return Numbas.math.primes[i];\n } else if(pow>0){\n return Numbas.math.primes[i]+'^'+pow;\n } else {\n return '';\n }\n }).filter(function(x){return x}).join(' * ');\n\n p.display.correctAnswerLaTeX = factors.map(function(pow,i){\n if(pow==1) {\n return Numbas.math.primes[i];\n } else if(pow>0){\n return Numbas.math.primes[i]+'^{'+pow+'}';\n } else {\n return '';\n }\n }).filter(function(x){return x}).join(' \\\\times ');\n}\n\nquestion.markFactorisePart = function(p) {\n var m = Numbas.jme.display.matchExpression('m_all(m_any(m_number,m_number^m_number));factors*??',p.studentAnswer,true);\n\n function onlyPrimes(tree) {\n var number;\n if(tree.tok.type=='op' && tree.tok.name=='*') {\n return onlyPrimes(tree.args[0]) && onlyPrimes(tree.args[1]);\n } else if(tree.tok.type=='op' && tree.tok.name=='^') {\n number = tree.args[0].tok.value;\n } else {\n number = tree.tok.value;\n }\n return Numbas.math.primes.contains(number);\n }\n\n if(!onlyPrimes(m.factors)) {\n p.setCredit(0,'Your answer is not completely factorised.');\n return ;\n }\n JMEPart.prototype.mark.apply(p);\n}"}, "type": "question", "metadata": {"notes": "

16/08/2012:

\n

Added tags.

\n

Added description.

\n

No advice given.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Factorising 5 to 7 digit numbers into a product of prime powers.

\n

Uses the marking algorithms from question 1 of this CBA

"}, "advice": "\n\n\n\n\n", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}