// Numbas version: finer_feedback_settings {"name": "Perform arithmetic in Z_n", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"a5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..9)", "description": "", "name": "a5"}, "ans2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a2*b2", "description": "", "name": "ans2"}, "ans3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a3*(b3+g3)", "description": "", "name": "ans3"}, "b4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(6..9)", "description": "", "name": "b4"}, "b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..4)", "description": "", "name": "b1"}, "b2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "name": "b2"}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "a1"}, "g5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..9)", "description": "", "name": "g5"}, "h5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..9)", "description": "", "name": "h5"}, "ans4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a4*b4", "description": "", "name": "ans4"}, "g3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(3..6)", "description": "", "name": "g3"}, "b5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..9)", "description": "", "name": "b5"}, "s5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mod(a5+b5,9)", "description": "", "name": "s5"}, "a3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(3..6)", "description": "", "name": "a3"}, "ans1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a1+b1", "description": "", "name": "ans1"}, "a4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(6..9)", "description": "", "name": "a4"}, "b3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(3..6)", "description": "", "name": "b3"}, "ans5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(a5+b5)*(g5+h5)", "description": "", "name": "ans5"}, "a2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "name": "a2"}, "t5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mod(g5+h5,9)", "description": "", "name": "t5"}}, "ungrouped_variables": ["a1", "g5", "ans3", "g3", "ans1", "ans2", "t5", "ans4", "ans5", "s5", "h5", "b4", "b5", "a3", "a2", "a5", "b1", "b2", "b3", "a4"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Perform arithmetic in Z_n", "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans1,2)}", "minValue": "{mod(ans1,2)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans1,9)}", "minValue": "{mod(ans1,9)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans1,10)}", "minValue": "{mod(ans1,10)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans2,2)}", "minValue": "{mod(ans2,2)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans2,9)}", "minValue": "{mod(ans2,9)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans2,10)}", "minValue": "{mod(ans2,10)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans3,2)}", "minValue": "{mod(ans3,2)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans3,9)}", "minValue": "{mod(ans3,9)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans3,10)}", "minValue": "{mod(ans3,10)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans4,2)}", "minValue": "{mod(ans4,2)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans4,9)}", "minValue": "{mod(ans4,9)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans4,10)}", "minValue": "{mod(ans4,10)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans5,2)}", "minValue": "{mod(ans5,2)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans5,9)}", "minValue": "{mod(ans5,9)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{mod(ans5,10)}", "minValue": "{mod(ans5,10)}", "correctAnswerFraction": false, "marks": 0.2, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n \n \n
Perform the following calculations in $\\mathbb{Z}_{2},\\;\\;\\mathbb{Z}_{9},\\;\\;\\mathbb{Z}_{10}$.
\n \n \n \n\n \n | $\\mathbb{Z}_{2}$ | \n \n$\\mathbb{Z}_{9}$ | \n \n$\\mathbb{Z}_{10}$ | \n \n
---|---|---|---|
$\\var{a1}+\\var{b1}$ | \n \n[[0]] | \n \n[[1]] | \n \n[[2]] | \n \n
$\\var{a2}\\times\\var{b2}$ | \n \n[[3]] | \n \n[[4]] | \n \n[[5]] | \n \n
$\\var{a3}\\times(\\var{b3}+\\var{g3})$ | \n \n[[6]] | \n \n[[7]] | \n \n[[8]] | \n \n
$\\var{a4}\\times\\var{b4}$ | \n \n[[9]] | \n \n[[10]] | \n \n[[11]] | \n \n
$(\\var{a5}+\\var{b5})\\times (\\var{g5}+\\var{h5})$ | \n \n[[12]] | \n \n[[13]] | \n \n[[14]] | \n \n
16/08/2012:
\n
Added tags.
Added description.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Calculations in $\\mathbb{Z_n}$ for three values of $n$.
"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "In the the last part, working out $(\\var{a5}+\\var{b5})\\times (\\var{g5}+\\var{h5}) \\bmod{X}$, it is sometimes easier to work out $(\\var{a5}+\\var{b5}) \\bmod{X}$ and $(\\var{g5}+\\var{h5}) \\bmod{X}$ separately, giving two numbers in the range $[0 \\dots X-1]$, and then to multiply them together.
\nFor example, working $\\bmod{9}$ we have:
\n\\begin{align}
\\var{a5}+\\var{b5}&\\equiv \\var{mod(a5+b5,9)} \\bmod{9}, \\\\
\\var{g5}+\\var{h5}&\\equiv \\var{mod(g5+h5,9)} \\bmod{9}. \\\\ \\\\
(\\var{a5}+\\var{b5})\\times (\\var{g5}+\\var{h5}) &\\equiv \\var{s5} \\times \\var{t5} \\bmod{9} \\\\
&\\equiv \\var{mod(ans5,9)} \\bmod{9}
\\end{align}