// Numbas version: exam_results_page_options {"name": "mas1702 cba3 2023/2024", "metadata": {"description": "", "licence": "None specified"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": false, "shuffleQuestionGroups": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": [""], "variable_overrides": [[]], "questions": [{"name": "Does $k$ divide one of $fn+c_1,...,fn+c_m$? - MAS1702", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "showQuestionGroupNames": false, "metadata": {"description": "
Decide if each of five statements is true or false.
\nThis version has a mix of statements where $n$ is multiplied by a constant, and where the $c_i$ have multiples of $k$ added.
", "licence": "Creative Commons Attribution 4.0 International", "notes": ""}, "question_groups": [{"pickQuestions": 0, "pickingStrategy": "all-ordered", "name": "", "questions": []}], "functions": {"term": {"type": "string", "parameters": [["f", "number"], ["c", "number"]], "definition": "var s = new Numbas.jme.types.TString(Numbas.jme.display.exprToLaTeX(f+'n + '+c,'all',scope));\ns.latex = true;\nreturn s;\n", "language": "javascript"}, "listsum": {"type": "number", "parameters": [["ls", "list"]], "definition": "switch(len(ls)=0,\n [],\n len(ls)=1,\n ls[0],\n ls[0]+listsum(ls[1..len(ls)])\n)", "language": "jme"}, "invert": {"type": "number", "parameters": [["f", "number"], ["t", "number"], ["a", "number"]], "definition": "// find n such that a*n = b (mod m)\nfilter(mod(f*n,a)=mod(-t,a),n,0..a)[0]", "language": "jme"}}, "variables": {"residues": {"description": "", "definition": "map(set(map(mod(f[j]*k,a[j]),k,0..a[j])),j,0..num_statements-1)", "group": "a and f", "name": "residues", "templateType": "anything"}, "terms": {"description": "", "definition": "map(\n map(term(f[j],c),c,constants[j]),\n j,\n 0..num_statements-1\n)", "group": "Shown to student", "name": "terms", "templateType": "anything"}, "show_constants": {"description": "", "definition": "join(constants,'Possible pairs of a and f.
", "definition": "listsum(map(map([j,k],k,2..j-1), j, a_range))", "group": "a and f", "name": "afs", "templateType": "anything"}, "missing_constant": {"description": "", "definition": "map(\n if(correct[j],\n -1,\n random(list(residues[j]-set(map(mod(c,a[j]),c,constants[j]))))\n ),\n j,\n 0..num_statements-1\n)", "group": "Constants", "name": "missing_constant", "templateType": "anything"}, "a": {"description": "The k in \"k divides one of ...\"
", "definition": "map(x[0],x,used_afs)", "group": "a and f", "name": "a", "templateType": "anything"}, "show_a": {"description": "", "definition": "join(a,',')", "group": "Debug", "name": "show_a", "templateType": "anything"}, "a_range": {"description": "", "definition": "3..8#1", "group": "Random numbers", "name": "a_range", "templateType": "range"}, "constants": {"description": "", "definition": "map(\n sort(if(add_constant[j],\n map(x+random(-1..2)*a[j],x,constants_a[j]),\n constants_a[j]\n )),\n j,\n 0..num_statements-1\n)", "group": "Constants", "name": "constants", "templateType": "anything"}, "mod_terms": {"description": "", "definition": "map(\n map(term(f[j],mod(c,a[j])),c,constants[j]),\n j,\n 0..num_statements-1\n)", "group": "Shown to student", "name": "mod_terms", "templateType": "anything"}, "show_correct": {"description": "", "definition": "join(correct,'Pick num_statements
unique pairs of a and f, of which num_fs
have a value of f greater than 1.
The f in \"k divides one of f*n+c1, f*n+c2, ...\"
", "definition": "map(x[1],x,used_afs)", "group": "a and f", "name": "f", "templateType": "anything"}, "constants_a": {"description": "", "definition": "map(\n if(correct[j],\n // correct - all residues present\n list(residues[j]), \n \n // incorrect - not all residues present\n let(\n num_residues,\n len(residues[j])-random(1..min(3,len(residues[j])-1)),\n let(\n min_others,\n if(num_residues=1,1,0),\n shuffle(list(residues[j]))[0..num_residues]+shuffle(list(others[j]))[min_others..random(min_others..len(others[j]))]\n ))\n ),\n j,\n 0..num_statements-1\n)", "group": "Constants", "name": "constants_a", "templateType": "anything"}, "show_others": {"description": "", "definition": "join(others,'For each of the following statements, decide whether it is true or false.
", "rulesets": {}, "variablesTest": {"condition": "// there exists a statement with only one term\nmin(map(len(c),c,constants))=2", "maxRuns": 100}, "parts": [{"shuffleAnswers": false, "showCorrectAnswer": true, "answers": ["True
", "False
"], "minMarks": 0, "maxMarks": 0, "variableReplacements": [], "minAnswers": 0, "matrix": "map(if(x,[2,0],[0,2]),x,correct)", "marks": 0, "layout": {"type": "all", "expression": ""}, "type": "m_n_x", "choices": ["(i) If $n \\in \\mathbb{Z}$ then $\\var{a[0]}$ divides one of the following: $\\var{latex(join(terms[0],', \\\\; '))}$.
", "(ii) If $n \\in \\mathbb{Z}$ then $\\var{a[1]}$ divides one of the following: $\\var{latex(join(terms[1],', \\\\; '))}$.
", "(iii) If $n \\in \\mathbb{Z}$ then $\\var{a[2]}$ divides one of the following: $\\var{latex(join(terms[2],', \\\\; '))}$.
", "(iv) If $n \\in \\mathbb{Z}$ then $\\var{a[3]}$ divides one of the following: $\\var{latex(join(terms[3],', \\\\; '))}$.
", "(v) If $n \\in \\mathbb{Z}$ then $\\var{a[4]}$ divides one of the following: $\\var{latex(join(terms[4],', \\\\; '))}$.
"], "displayType": "radiogroup", "warningType": "none", "scripts": {}, "shuffleChoices": false, "variableReplacementStrategy": "originalfirst", "maxAnswers": 0}], "ungrouped_variables": [], "tags": ["divisibility", "MAS1702"], "advice": "$\\var{a[0]}$ divides $\\simplify{{f[0]}*n+b}$ if and only if it divides $\\simplify{{f[0]}*n} + \\left[ b \\right]_{\\var{a[0]}}$, so we first find the remainder on dividing each of the given terms by $\\var{a[0]}$, giving:
\n\\[ \\var{latex(join(mod_terms[0],', \\\\; '))} \\]
\n$[\\simplify{{f[0]}*n}]_{\\var{a[0]}}$ can take the following values:
\n\\[ \\var{set(sort(list(residues[0])))} \\]
\nso we should have each of the following terms:
\n\\[ \\var{latex(join(map(term(f[0],mod(a[0]-r,a[0])),r,sort(list(residues[0]))),', \\\\; '))} \\]
\nThe list of given terms does not include a term equivalent to $\\simplify{{f[0]}*n} + [\\var{missing_constant[0]}]_{\\var{a[0]}}$, so the statement is false: if $n = \\var{invert(f[0],missing_constant[0],a[0])}$, for example, none of the given terms is a multiple of $\\var{a[0]}$.
\nAll of the required terms are present, so the statement is true.
\n$\\var{a[1]}$ divides $\\simplify{{f[1]}*n+b}$ if and only if it divides $\\simplify{{f[1]}*n} + \\left[ b \\right]_{\\var{a[1]}}$, so we first find the remainder on dividing each of the given terms by $\\var{a[1]}$, giving:
\n\\[ \\var{latex(join(mod_terms[1],', \\\\; '))} \\]
\n$[\\simplify{{f[1]}*n}]_{\\var{a[1]}}$ can take the following values:
\n\\[ \\var{set(sort(list(residues[1])))} \\]
\nso we should have each of the following terms:
\n\\[ \\var{latex(join(map(term(f[1],mod(a[1]-r,a[1])),r,sort(list(residues[1]))),', \\\\; '))} \\]
\nThe list of given terms does not include a term equivalent to $\\simplify{{f[1]}*n} + [\\var{missing_constant[1]}]_{\\var{a[1]}}$, so the statement is false: if $n = \\var{invert(f[1],missing_constant[1],a[1])}$, for example, none of the given terms is a multiple of $\\var{a[1]}$.
\nAll of the required terms are present, so the statement is true.
\n$\\var{a[2]}$ divides $\\simplify{{f[2]}*n+b}$ if and only if it divides $\\simplify{{f[2]}*n} + \\left[ b \\right]_{\\var{a[2]}}$, so we first find the remainder on dividing each of the given terms by $\\var{a[2]}$, giving:
\n\\[ \\var{latex(join(mod_terms[2],', \\\\; '))} \\]
\n$[\\simplify{{f[2]}*n}]_{\\var{a[2]}}$ can take the following values:
\n\\[ \\var{set(sort(list(residues[2])))} \\]
\nso we should have each of the following terms:
\n\\[ \\var{latex(join(map(term(f[2],mod(a[2]-r,a[2])),r,sort(list(residues[2]))),', \\\\; '))} \\]
\nThe list of given terms does not include a term equivalent to $\\simplify{{f[2]}*n} + [\\var{missing_constant[2]}]_{\\var{a[2]}}$, so the statement is false: if $n = \\var{invert(f[2],missing_constant[2],a[2])}$, for example, none of the given terms is a multiple of $\\var{a[2]}$.
\nAll of the required terms are present, so the statement is true.
\n$\\var{a[3]}$ divides $\\simplify{{f[3]}*n+b}$ if and only if it divides $\\simplify{{f[3]}*n} + \\left[ b \\right]_{\\var{a[3]}}$, so we first find the remainder on dividing each of the given terms by $\\var{a[3]}$, giving:
\n\\[ \\var{latex(join(mod_terms[3],', \\\\; '))} \\]
\n$[\\simplify{{f[3]}*n}]_{\\var{a[3]}}$ can take the following values:
\n\\[ \\var{set(sort(list(residues[3])))} \\]
\nso we should have each of the following terms:
\n\\[ \\var{latex(join(map(term(f[3],mod(a[3]-r,a[3])),r,sort(list(residues[3]))),', \\\\; '))} \\]
\nThe list of given terms does not include a term equivalent to $\\simplify{{f[3]}*n} + [\\var{missing_constant[3]}]_{\\var{a[3]}}$, so the statement is false: if $n = \\var{invert(f[3],missing_constant[3],a[3])}$, for example, none of the given terms is a multiple of $\\var{a[3]}$.
\nAll of the required terms are present, so the statement is true.
\n$\\var{a[4]}$ divides $\\simplify{{f[4]}*n+b}$ if and only if it divides $\\simplify{{f[4]}*n} + \\left[ b \\right]_{\\var{a[4]}}$, so we first find the remainder on dividing each of the given terms by $\\var{a[4]}$, giving:
\n\\[ \\var{latex(join(mod_terms[4],', \\\\; '))} \\]
\n$[\\simplify{{f[4]}*n}]_{\\var{a[4]}}$ can take the following values:
\n\\[ \\var{set(sort(list(residues[4])))} \\]
\nso we should have each of the following terms:
\n\\[ \\var{latex(join(map(term(f[4],mod(a[4]-r,a[4])),r,sort(list(residues[4]))),', \\\\; '))} \\]
\nThe list of given terms does not include a term equivalent to $\\simplify{{f[4]}*n} + [\\var{missing_constant[4]}]_{\\var{a[4]}}$, so the statement is false: if $n = \\var{invert(f[4],missing_constant[4],a[4])}$, for example, none of the given terms is a multiple of $\\var{a[4]}$.
\nAll of the required terms are present, so the statement is true.
\n