// Numbas version: finer_feedback_settings {"name": "Factorial: x!/y!", "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=end;i>=start;i--) {\n out.push(i);\n}\nvar s = new Numbas.jme.types.TString(out.join(' \\\\times '));\ns.latex = true;\nreturn s;", "type": "number", "parameters": [["start", "number"], ["end", "number"]], "language": "javascript"}}, "ungrouped_variables": ["a1", "a2", "b1", "b2"], "name": "Factorial: x!/y!", "tags": [], "advice": "

a)

\n

\\[ \\frac{\\var{a1}!}{\\var{a2}!} = \\frac{\\var{show_factorial(1,a1)}}{\\var{show_factorial(1,a2)}} = \\var{show_factorial(a2+1,a1)} = \\var{fact(a1)/fact(a2)} \\]

\n

b)

\n

\\[ \\frac{\\var{b1}!}{\\var{b2}!} = \\frac{\\var{show_factorial(1,b1)}}{\\var{show_factorial(1,b2)}} = \\frac{1}{\\var{show_factorial(b1+1,b2)}} = \\frac{1}{\\var{fact(b2)/fact(b1)}} \\]

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

$\\dfrac{\\var{a1}!}{\\var{a2}!} = $ [[0]]

\n

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

$\\dfrac{\\var{b1}!}{\\var{b2}!} = $ [[0]]

\n

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

Simplify the following fractions.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"a1": {"definition": "a2+random(2..4)", "templateType": "anything", "group": "Ungrouped variables", "name": "a1", "description": ""}, "a2": {"definition": "random(3..10)", "templateType": "anything", "group": "Ungrouped variables", "name": "a2", "description": ""}, "b1": {"definition": "random(1..15 except a2)", "templateType": "anything", "group": "Ungrouped variables", "name": "b1", "description": ""}, "b2": {"definition": "b1+random(2..4)", "templateType": "anything", "group": "Ungrouped variables", "name": "b2", "description": ""}}, "metadata": {"notes": "", "description": "

Cancel fractions where the numerator and denominator are both factorials.

", "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/"}]}