// Numbas version: finer_feedback_settings {"name": "John's copy of 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": [{"variablesTest": {"maxRuns": 100, "condition": ""}, "ungrouped_variables": ["a1", "g5", "ans3", "g3", "ans1", "ans2", "t5", "ans4", "ans5", "s5", "h5", "b4", "b5", "a3", "a2", "a5", "b1", "b2", "b3", "a4"], "name": "John's copy of Perform arithmetic in Z_n", "variables": {"a2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..5)", "name": "a2", "description": ""}, "a1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "name": "a1", "description": ""}, "b1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..4)", "name": "b1", "description": ""}, "t5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mod(g5+h5,9)", "name": "t5", "description": ""}, "a4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(6..9)", "name": "a4", "description": ""}, "g5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..9)", "name": "g5", "description": ""}, "ans5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(a5+b5)*(g5+h5)", "name": "ans5", "description": ""}, "ans2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a2*b2", "name": "ans2", "description": ""}, "ans1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a1+b1", "name": "ans1", "description": ""}, "b5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..9)", "name": "b5", "description": ""}, "b3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(3..6)", "name": "b3", "description": ""}, "b2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..5)", "name": "b2", "description": ""}, "a3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(3..6)", "name": "a3", "description": ""}, "g3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(3..6)", "name": "g3", "description": ""}, "h5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..9)", "name": "h5", "description": ""}, "b4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(6..9)", "name": "b4", "description": ""}, "ans3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a3*(b3+g3)", "name": "ans3", "description": ""}, "ans4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a4*b4", "name": "ans4", "description": ""}, "a5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..9)", "name": "a5", "description": ""}, "s5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mod(a5+b5,9)", "name": "s5", "description": ""}}, "variable_groups": [], "parts": [{"showCorrectAnswer": true, "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
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}
Calculations in $\\mathbb{Z_n}$ for three values of $n$.
", "notes": "16/08/2012:
\n
Added tags.
Added description.
", "licence": "Creative Commons Attribution 4.0 International"}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "John Moss", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3481/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "John Moss", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3481/"}]}