// Numbas version: finer_feedback_settings {"name": "Factorial: x!", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"show_factorial": {"definition": "var out = [];\nfor(var i=n;i>0;i--) {\n out.push(i);\n}\nvar s = new Numbas.jme.types.TString(out.join(' \\\\times '));\ns.latex = true;\nreturn s;", "type": "string", "parameters": [["n", "number"]], "language": "javascript"}}, "ungrouped_variables": ["numbers", "a", "b", "c"], "name": "Factorial: x!", "tags": [], "advice": "

$n!$ is the product of the numbers $1, \\dots, n$. You can work that out by hand, or most calculators have a factorial function, normally labelled n!.

\n

a)

\n

\\[ \\var{a}! = \\var{show_factorial(a)} = \\var{fact(a)} \\]

\n

b)

\n

\\[ \\var{b}! = \\var{show_factorial(b)} = \\var{fact(b)} \\]

\n

c)

\n

\\[ \\var{c}! = \\var{show_factorial(c)} = \\var{fact(c)} \\]

", "rulesets": {}, "parts": [{"prompt": "

$\\var{a}! = $ [[0]]

\n

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

$\\var{b}! = $ [[0]]

\n

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

$\\var{c}! = $ [[0]]

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "fact(c)", "minValue": "fact(c)", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "statement": "

Calculate the following factorials.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"a": {"definition": "numbers[0]", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "numbers[2]", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "numbers[1]", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "numbers": {"definition": "sort(shuffle(1..10)[0..3])", "templateType": "anything", "group": "Ungrouped variables", "name": "numbers", "description": ""}}, "metadata": {"notes": "", "description": "

Compute the factorials of some small numbers.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Hayley Moore", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/495/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Hayley Moore", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/495/"}]}