// Numbas version: finer_feedback_settings {"name": "Add polynomials in Z_n", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Add polynomials in Z_n", "tags": ["bad implementation", "checked2015"], "metadata": {"description": "
Three parts, where the student has to collect together polynomials in $\\mathbb{Z}_3$, $\\mathbb{Z}_5$ and $\\mathbb{Z}_7$, respectively.
\nThe answer to part a has no $X$ term, because they cancel out.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "Compute the following sums of polynomials.
", "advice": "Adding the polynomials we obtain $3X-\\var{a1+a2+a3}$ . But $3 \\equiv 0 \\pmod 3$ and $ -\\var{a1+a2+a3} \\equiv \\var{ans1} \\pmod 3$.
\nHence the sum is $\\var{ans1}$.
\nSumming up, we obtain:
\n\\begin{align}
(\\simplify{X ^ 6 + {b4} * X ^ 4 + {b2} * X ^ 2 + {b0}})&+\\simplify{ {g}*(X ^ 6 + {c5} * X ^ 5 + {c4} * X ^ 4 + {c3} * X ^ 3 + {c2} * X ^ 2 + {c1} * X + {c0})} \\\\
&= \\simplify{{1 + g} * X ^ 6 + {g * c5} * X ^ 5 + {b4 + g * c4} * X ^ 4 + {g * c3} * X ^ 3 + {b2 + g * c2} * X ^ 2 + {g * c1} * X + {b0 + g * c0}} \\\\
&\\equiv \\simplify{{d6} * X ^ 6 + {d5} * X ^ 5 + {d4} * X ^ 4 + {d3} * X ^ 3 + {d2} * X ^ 2 + {d1} * X + {d0}} \\pmod 5
\\end{align}
Once again, on summing up we obtain:
\n\\begin{align}
\\simplify{X ^ 6 + {f5} * X ^ 5 + {f4} * X ^ 4 + {f3} * X ^ 3 + {f2} * X ^ 2 + {f1} * X + {f0} } &+ \\simplify{ {h}*(X ^ 6 + {g5} * X ^ 5 + {g4} * X ^ 4 + {g3} * X ^ 3 + {g2} * X ^ 2 + {g1} * X + {g0})} \\\\
&= \\simplify{ {1 + h} * X ^ 6 + {f5 + h * g5} * X ^ 5 + {f4 + h * g4} * X ^ 4 + {f3 + h * g3} * X ^ 3 + {f2 + h * g2} * X ^ 2 + {f1 + h * g1} * X + {f0 + h * g0}} \\\\
&\\equiv \\simplify{{k6} * X ^ 6 + {k5} * X ^ 5 + {k4} * X ^ 4 + {k3} * X ^ 3 + {k2} * X ^ 2 + {k1} * X + {k0}} \\pmod 7
\\end{align}
Constant terms in the expression given in part a
", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "Part a", "variables": ["ans1", "a1,a2,a3"]}, {"name": "Part b", "variables": ["b0", "b4", "b2", "c0", "c1", "c2", "c3", "c4", "c5", "d0", "d1", "d2", "d3", "d4", "d5", "d6"]}, {"name": "Part c", "variables": ["f0", "f1", "f2", "f3", "f4", "f5", "g", "g0", "g1", "g2", "g3", "g4", "g5", "h", "k0", "k1", "k2", "k3", "k4", "k5", "k6"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Find the following sum of polynomials over $\\mathbb{Z}_3$.
\nAll coefficients of non-zero terms in your answer should be either $1$ or $2$.
\n$(X - \\var{ a1}) + (X - \\var{ a2}) + (X - \\var{ a3}) = $ [[0]]
", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [{"variables": [{"name": "ans1", "value": "0"}, {"name": "a1", "value": "2"}, {"name": "a2", "value": "2"}, {"name": "a3", "value": "2"}, {"name": "b0", "value": "1"}, {"name": "b4", "value": "1"}, {"name": "b2", "value": "2"}, {"name": "c0", "value": "2"}, {"name": "c1", "value": "1"}, {"name": "c2", "value": "3"}, {"name": "c3", "value": "3"}, {"name": "c4", "value": "1"}, {"name": "c5", "value": "1"}, {"name": "d0", "value": "3"}, {"name": "d1", "value": "1"}, {"name": "d2", "value": "0"}, {"name": "d3", "value": "3"}, {"name": "d4", "value": "2"}, {"name": "d5", "value": "1"}, {"name": "d6", "value": "2"}, {"name": "f0", "value": "6"}, {"name": "f1", "value": "6"}, {"name": "f2", "value": "1"}, {"name": "f3", "value": "5"}, {"name": "f4", "value": "6"}, {"name": "f5", "value": "5"}, {"name": "g", "value": "1"}, {"name": "g0", "value": "3"}, {"name": "g1", "value": "1"}, {"name": "g2", "value": "1"}, {"name": "g3", "value": "1"}, {"name": "g4", "value": "6"}, {"name": "g5", "value": "0"}, {"name": "h", "value": "5"}, {"name": "k0", "value": "0"}, {"name": "k1", "value": "4"}, {"name": "k2", "value": "6"}, {"name": "k3", "value": "3"}, {"name": "k4", "value": "1"}, {"name": "k5", "value": "5"}, {"name": "k6", "value": "6"}], "name": "Correct answer", "answer": {"valid": true, "value": "0"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is numerically correct.\n\nYou were awarded 1 mark."], "warnings": [], "error": "", "valid": true, "credit": 1}}]}, {"variables": [{"name": "ans1", "value": "0"}, {"name": "a1", "value": "2"}, {"name": "a2", "value": "2"}, {"name": "a3", "value": "2"}, {"name": "b0", "value": "1"}, {"name": "b4", "value": "1"}, {"name": "b2", "value": "2"}, {"name": "c0", "value": "2"}, {"name": "c1", "value": "1"}, {"name": "c2", "value": "3"}, {"name": "c3", "value": "3"}, {"name": "c4", "value": "1"}, {"name": "c5", "value": "1"}, {"name": "d0", "value": "3"}, {"name": "d1", "value": "1"}, {"name": "d2", "value": "0"}, {"name": "d3", "value": "3"}, {"name": "d4", "value": "2"}, {"name": "d5", "value": "1"}, {"name": "d6", "value": "2"}, {"name": "f0", "value": "6"}, {"name": "f1", "value": "6"}, {"name": "f2", "value": "1"}, {"name": "f3", "value": "5"}, {"name": "f4", "value": "6"}, {"name": "f5", "value": "5"}, {"name": "g", "value": "1"}, {"name": "g0", "value": "3"}, {"name": "g1", "value": "1"}, {"name": "g2", "value": "1"}, {"name": "g3", "value": "1"}, {"name": "g4", "value": "6"}, {"name": "g5", "value": "0"}, {"name": "h", "value": "5"}, {"name": "k0", "value": "0"}, {"name": "k1", "value": "4"}, {"name": "k2", "value": "6"}, {"name": "k3", "value": "3"}, {"name": "k4", "value": "1"}, {"name": "k5", "value": "5"}, {"name": "k6", "value": "6"}], "name": "Incorrect answer", "answer": {"valid": true, "value": "1"}, "notes": [{"name": "mark", "expected": {"value": "nothing", "messages": ["Your answer is incorrect."], "warnings": [], "error": "", "valid": true, "credit": 0}}]}], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{ans1}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Find the following sum of polynomials over $\\mathbb{Z}_5$.
\nAll coefficients of non-zero terms in your answer should be $1$, $2$, $3$ or $4$.
\n$(\\simplify{X ^ 6 + {b4} * X ^ 4 + {b2} * X ^ 2 + {b0}}) +\\simplify{ {g}(X ^ 6 + {c5} * X ^ 5 + {c4} * X ^ 4 + {c3} * X ^ 3 + {c2} * X ^ 2 + {c1} * X + {c0}) } = $ [[0]]
", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "(({d6} * (X ^ 6)) + ({d5} * (X ^ 5)) + ({d4} * (X ^ 4)) + ({d3} * (X ^ 3)) + ({d2} * (X ^ 2)) + ({d1} * X) + {d0})", "answerSimplification": "all", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Find the following sum of polynomials over $\\mathbb{Z}_7$.
\nAll coefficients of non-zero terms in your answer should be $1$, $2$, $3$, $4$, $5$ or $6$.
\n$(\\simplify{X ^ 6 + {f5}*X^5+{f4} * X ^ 4 +{f3} * X ^ 3 + {f2} * X ^ 2 +{f1}*X+ {f0}}) +\\simplify{ {h}(X ^ 6 + {g5} * X ^ 5 + {g4} * X ^ 4 + {g3} * X ^ 3 + {g2} * X ^ 2 + {g1} * X + {g0}) } = $ [[0]]
\n", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "(({k6} * (X ^ 6)) + ({k5} * (X ^ 5)) + ({k4} * (X ^ 4)) + ({k3} * (X ^ 3)) + ({k2} * (X ^ 2)) + ({k1} * X) + {k0})", "answerSimplification": "all", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}