// 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.

\n

This 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,'
')", "group": "Debug", "name": "show_constants", "templateType": "anything"}, "num_add_constant": {"description": "", "definition": "random(1..num_statements-2)", "group": "Random numbers", "name": "num_add_constant", "templateType": "anything"}, "afs": {"description": "

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,'
')", "group": "Debug", "name": "show_correct", "templateType": "anything"}, "others": {"description": "", "definition": "map(set(0..a[j]-1)-residues[j],j,0..num_statements-1)", "group": "a and f", "name": "others", "templateType": "anything"}, "show_terms": {"description": "", "definition": "join(terms,'
')", "group": "Debug", "name": "show_terms", "templateType": "anything"}, "show_f": {"description": "", "definition": "join(f,',')", "group": "Debug", "name": "show_f", "templateType": "anything"}, "num_fs": {"description": "", "definition": "random(2..num_statements-2)", "group": "Random numbers", "name": "num_fs", "templateType": "anything"}, "num_statements": {"description": "", "definition": "5", "group": "Random numbers", "name": "num_statements", "templateType": "anything"}, "correct": {"description": "", "definition": "shuffle(repeat(true,num_correct)+repeat(false,num_statements-num_correct))", "group": "Facts about the statements", "name": "correct", "templateType": "anything"}, "add_constant": {"description": "", "definition": "shuffle(repeat(true,num_add_constant)+repeat(false,num_statements-num_add_constant))", "group": "Facts about the statements", "name": "add_constant", "templateType": "anything"}, "used_afs": {"description": "

Pick num_statements unique pairs of a and f, of which num_fs have a value of f greater than 1.

", "definition": "shuffle(\n shuffle(map([j,1],j,a_range))[0..num_statements-num_fs]+shuffle(afs)[0..num_fs]\n)", "group": "a and f", "name": "used_afs", "templateType": "anything"}, "f": {"description": "

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,'
')", "group": "Debug", "name": "show_others", "templateType": "anything"}, "num_correct": {"description": "", "definition": "random(1..num_statements-1)", "group": "Random numbers", "name": "num_correct", "templateType": "anything"}}, "preamble": {"css": "", "js": ""}, "variable_groups": [{"variables": ["num_statements", "num_correct", "num_add_constant", "a_range", "num_fs"], "name": "Random numbers"}, {"variables": ["afs", "used_afs", "a", "f", "residues", "others"], "name": "a and f"}, {"variables": ["correct", "add_constant"], "name": "Facts about the statements"}, {"variables": ["constants_a", "constants", "missing_constant"], "name": "Constants"}, {"variables": ["terms", "mod_terms"], "name": "Shown to student"}, {"variables": ["show_a", "show_f", "show_constants", "show_correct", "show_terms", "show_others"], "name": "Debug"}], "type": "question", "statement": "

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": "

(i)

\n
\n

$\\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
\n

$[\\simplify{{f[0]}*n}]_{\\var{a[0]}}$ can take the following values:

\n

\\[ \\var{set(sort(list(residues[0])))} \\]

\n

so 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]))),', \\\\; '))} \\]

\n
\n

The 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]}$.

\n
\n
\n

All of the required terms are present, so the statement is true.

\n
\n\n

(ii)

\n
\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
\n

$[\\simplify{{f[1]}*n}]_{\\var{a[1]}}$ can take the following values:

\n

\\[ \\var{set(sort(list(residues[1])))} \\]

\n

so 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]))),', \\\\; '))} \\]

\n
\n

The 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]}$.

\n
\n
\n

All of the required terms are present, so the statement is true.

\n
\n\n

(iii)

\n
\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
\n

$[\\simplify{{f[2]}*n}]_{\\var{a[2]}}$ can take the following values:

\n

\\[ \\var{set(sort(list(residues[2])))} \\]

\n

so 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]))),', \\\\; '))} \\]

\n
\n

The 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]}$.

\n
\n
\n

All of the required terms are present, so the statement is true.

\n
\n\n

(iv)

\n
\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
\n

$[\\simplify{{f[3]}*n}]_{\\var{a[3]}}$ can take the following values:

\n

\\[ \\var{set(sort(list(residues[3])))} \\]

\n

so 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]))),', \\\\; '))} \\]

\n
\n

The 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]}$.

\n
\n
\n

All of the required terms are present, so the statement is true.

\n
\n\n

(v)

\n
\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
\n

$[\\simplify{{f[4]}*n}]_{\\var{a[4]}}$ can take the following values:

\n

\\[ \\var{set(sort(list(residues[4])))} \\]

\n

so 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]))),', \\\\; '))} \\]

\n
\n

The 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]}$.

\n
\n
\n

All of the required terms are present, so the statement is true.

\n
\n"}]}], "allowPrinting": true, "navigation": {"allowregen": false, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": true, "showresultspage": "review", "navigatemode": "sequence", "onleave": {"action": "warnifunattempted", "message": "You haven't submitted all your answers on this page."}, "preventleave": true, "typeendtoleave": false, "startpassword": "", "allowAttemptDownload": false, "downloadEncryptionKey": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": false, "showtotalmark": true, "showanswerstate": false, "allowrevealanswer": false, "advicethreshold": 0, "intro": "", "end_message": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "results_options": {"printquestions": true, "printadvice": true}, "feedbackmessages": []}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "James Waldron", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1175/"}, {"name": "Dimitris Chiotis", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21199/"}, {"name": "Shweta Sharma", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21418/"}], "extensions": [], "custom_part_types": [], "resources": []}