// Numbas version: exam_results_page_options {"name": "Prime Factorisation", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Prime Factorisation", "tags": [], "metadata": {"description": "Writing numbers as a product of prime factors", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

In each of these questions, write the given number as a product of powers of primes in ascending order.

\n

\n

Give your answer in list form, where

\n

the 1st element represents the power of 2

\n

the 2nd element represents the power of 3

\n

the 3rd element represents the power of 5

\n

the 4th element represents the power of 7

\n

\n

For example

\n

$210=2\\times3\\times5\\times7$ we would give our answer as $[1,1,1,1]$

\n

$63=3^2\\times7$ we would give our answer as $[0,2,0,1]$

\n

$750=2\\times3\\times5^3$ we would give our answer as $[1,1,3,0]$

\n

", "advice": "

To find the prime factorisation of a number, keep breaking that number down into pairs of factors until all number written down are primes.

\n

e.g. To find the prime factorisation of $2450$ we could note that

\n

$2450 = 245 \\times 10$

\n

$2450=245 \\times \\underline{5} \\times \\underline{2}$

\n

$2450=\\underline{5} \\times 49 \\times \\underline{5}\\times \\underline{2}$

\n

$2450=\\underline{5} \\times \\underline{7} \\times \\underline{7} \\times \\underline{5} \\times \\underline{2}$

\n

where we have underlined the primes as we go along.

\n

Rewriting this in ascending order of primes, we obtain $2450 = 2 \\times 5 \\times 5 \\times 7 \\times 7$

\n

which we can also write as $2450 = 2 \\times 5^2 \\times 7^2$

\n

\n

\n

(a) Applying a similar method to the given questions, we can obtain:

\n

\n

We can write the given numbers as products of prime factors as follows:

\n

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

\n

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

\n

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

\n

\n

", "rulesets": {}, "extensions": [], "variables": {"x_powers": {"name": "x_powers", "group": "Ungrouped variables", "definition": "[random(1..4),random(0..4),random(0..3),random(1..3)]", "description": "", "templateType": "anything"}, "y_powers": {"name": "y_powers", "group": "Ungrouped variables", "definition": "[random(0..4),random(1..4),random(0..3),random(1..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"}, "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\n", "maxRuns": "500"}, "ungrouped_variables": ["x_powers", "y_powers", "z_powers", "x", "y", "z", "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": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

$\\var{x}=$

", "answer": "{factorise(x)}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

$\\var{y}=$

", "answer": "{factorise(y)}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

$\\var{z}=$

", "answer": "{factorise(z)}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "valuegenerators": []}], "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/"}]}