// Numbas version: exam_results_page_options {"name": "Abbildungen (Goldbach-Vermutung)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Abbildungen (Goldbach-Vermutung)", "tags": [], "metadata": {"description": "

Questions around the notion of map, with underlying topic the statement of Goldbach's conjecture. The student has to write the conjecture (by filling in some gaps) as a surjectivity statement for a map, and compute some preimages of elements.

\n

(In German)

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Eine weitere Übung zum Umgang mit dem Abbildungsbegriff.

", "advice": "

b)

\n

{answer_b}

\n

c)

\n

{answer_c}

\n

d)

\n

Eine mögliche Antwort ist $\\simplify{{result_d}}$:

\n

{answer_d}

", "rulesets": {}, "extensions": [], "variables": {"a1": {"name": "a1", "group": "Ungrouped variables", "definition": "2*random(2..20)", "description": "", "templateType": "anything"}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "prime1(a1)", "description": "", "templateType": "anything"}, "p2": {"name": "p2", "group": "Ungrouped variables", "definition": "prime1(a2)", "description": "", "templateType": "anything"}, "a2": {"name": "a2", "group": "Ungrouped variables", "definition": "2*random(10..50)", "description": "", "templateType": "anything"}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(3..9)", "description": "", "templateType": "anything"}, "result_d": {"name": "result_d", "group": "Ungrouped variables", "definition": "set(sort(resultd(c)[0]))", "description": "", "templateType": "anything"}, "answer_d": {"name": "answer_d", "group": "Ungrouped variables", "definition": "resultd(c)[1]", "description": "", "templateType": "anything"}, "answer_b": {"name": "answer_b", "group": "Ungrouped variables", "definition": "all_decompositions(a1)", "description": "", "templateType": "anything"}, "answer_c": {"name": "answer_c", "group": "Ungrouped variables", "definition": "all_decompositions(a2)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a1", "p1", "p2", "a2", "c", "result_d", "answer_d", "answer_b", "answer_c"], "variable_groups": [], "functions": {"prime1": {"parameters": [["a", "number"]], "type": "number", "language": "javascript", "definition": "for(p of Numbas.math.primes) {\n if (Numbas.math.primes.includes(a-p)) return p;\n}"}, "resultd": {"parameters": [["c", "number"]], "type": "list", "language": "javascript", "definition": "var lst;\n\n// for the moment, it is easiest to hard-code one choice of possible answer in each case ...\nif (c == 1) lst = [4];\nif (c == 2) lst = [8];\nif (c == 3) lst = [10];\nif (c == 4) lst = [4,6,8];\nif (c == 5) lst = [4,8,12];\nif (c == 6) lst = [4,10,12];\nif (c == 7) lst = [8,10,12];\nif (c == 8) lst = [8,10,14];\nif (c == 9) lst = [4,8,10,14];\n\n\nvar final_result = \"\";\nvar result;\n\nfor (a of lst) {\n // Compute all decompositions of the (even) number a as a sum of two primes.\n // Compose a string listing the possible decompositions and stating the\n // number of decompositions (in German).\n // To be used in the Advice section.\n result = [];\n for(p of Numbas.math.primes) {\n if (Numbas.math.primes.includes(a-p)) result.push(`${p} + ${a-p}`);\n if (p > a) break;\n }\n var prefix = \"\";\n if (result.length == 1) {\n prefix = `Die einzige Zerlegung von ${a} als Summe von Primzahlen ist \\$ ${a} = `;\n } else {\n prefix = `Die Zerlegungen von ${a} als Summe von Primzahlen sind \\$ ${a} = `;\n }\n final_result += '

' + prefix + result.join(' = ') + '$' + ` (${result.length} Zerlegung${result.length != 1 ? 'en' : ''}).

`;\n}\nreturn [lst, final_result];"}, "all_decompositions": {"parameters": [["a", "number"]], "type": "string", "language": "javascript", "definition": "var result = [];\n\nfor(p of Numbas.math.primes) {\n if (Numbas.math.primes.includes(a-p)) result.push(`${p} + ${a-p}`);\n if (p > a) break;\n}\nvar prefix = \"\";\nif (result.length == 1) {\n prefix = `Die einzige Zerlegung von ${a} als Summe von Primzahlen ist \\$ ${a} = `;\n} else {\n prefix = `Die Zerlegungen von ${a} als Summe von Primzahlen sind \\$ ${a} = `;\n}\nreturn '

' + prefix + result.join(' = ') + '$' + ` (${result.length} Zerlegung${result.length != 1 ? 'en' : ''}).

`;\n"}}, "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": "

Die Goldbachsche Vermutung (aufgestellt 1742 von Christian Goldbach in einem Brief an Euler und bis heute offen) sagt aus, dass sich jede gerade Zahl, die größer ist als $2$, als die Summe von zwei Primzahlen schreiben lässt. Füllen Sie die Lücken in dem folgenden Text aus:

\n

Eine äquivalente Formulierung der Goldbach-Vermutung ist gegeben durch:

\n

Sei $\\mathbb P$ die Menge aller [[0]].

\n

Dann ist die Abbildung

\n

$G\\colon\\mathbb P \\times \\mathbb P \\to \\{ n\\in \\mathbb Z;\\ n$ ist [[1]] und [[2]] $2\\}$,

\n

$(x, y) \\mapsto$ [[3]],

\n

[[4]].

", "gaps": [{"type": "patternmatch", "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": "Primzahlen", "displayAnswer": "Primzahlen", "caseSensitive": true, "partialCredit": "50", "matchMode": "regex"}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "dropdownlist", "displayColumns": 0, "showCellAnswerState": true, "choices": ["ungerade", "positiv", "eine Primzahl", "durch 2 teilbar"], "matrix": [0, "0", 0, "1"], "distractors": ["", "", "", ""]}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "dropdownlist", "displayColumns": 0, "showCellAnswerState": true, "choices": ["gleich", "größer oder gleich", "größer als", "kleiner oder gleich", "kleiner als", "ungleich"], "matrix": [0, 0, "1", 0, 0, 0], "distractors": ["", "", "", "", "", ""]}, {"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": "x+y", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": ""}]}, {"type": "patternmatch", "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": "surjektiv", "displayAnswer": "surjektiv", "matchMode": "regex"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {"mark": {"script": "values = [];\nfor(var i=0; i<2; i++) {\n var v = parseInt(this.studentAnswer[i]);\n if(isNaN(v)) {\n this.setCredit(0, \"Sie haben nicht 2 ganze Zahlen eingetragen.\");\n return;\n }\n values.push(v);\n}\n\nvar message = \"\";\nvar credit = 0;\n\nif (Numbas.math.primes.includes(values[0])) {\n credit += 1;\n} else {\n message += `Die Zahl ${values[0]} ist keine Primzahl. `\n}\nif (Numbas.math.primes.includes(values[1])) {\n credit += 1;\n} else {\n message += `Die Zahl ${values[1]} ist keine Primzahl. `\n}\n\nvar a1 = Numbas.jme.unwrapValue(this.question.scope.variables.a1);\nif (values[0] + values[1] == a1) {\n credit += 1;\n} else {\n message += `Die Summe von ${values[0]} und ${values[1]} ist nicht ${a1}.`;\n}\n\nif (credit==3) {\n message = \"Prima, alles richtig!\";\n}\n\nthis.answered = true;\nthis.setCredit(credit/3, message);", "order": "instead"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Die Zahlen $\\var{a1}$ und $\\var{a2}$ liegen im Bild von $G$. Geben Sie jeweils ein Urbild an:

\n

$G($ [[0]], [[1]] $) = \\var{a1}$.

\n

(Es gibt in der Regel mehrere richtige Antworten. Wenn Sie \"Antworten aufdecken\" wählen, werden unten bei den Hinweisen alle möglichen Antworten angezeigt.)

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{p1}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "mustmatchpattern": {"pattern": "positive:$n", "partialCredit": 0, "message": "Bitte geben Sie eine natürliche Zahl ein.", "nameToCompare": ""}, "valuegenerators": []}, {"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": "{a1}-{p1}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "mustmatchpattern": {"pattern": "positive:$n", "partialCredit": 0, "message": "Bitte geben Sie eine natürliche Zahl ein.", "nameToCompare": ""}, "valuegenerators": []}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {"mark": {"script": "values = [];\nfor(var i=0; i<2; i++) {\n var v = parseInt(this.studentAnswer[i]);\n if(isNaN(v)) {\n this.setCredit(0, \"Sie haben nicht 2 ganze Zahlen eingetragen.\");\n return;\n }\n values.push(v);\n}\n\nvar message = \"\";\nvar credit = 0;\n\nif (Numbas.math.primes.includes(values[0])) {\n credit += 1;\n} else {\n message += `Die Zahl ${values[0]} ist keine Primzahl. `\n}\nif (Numbas.math.primes.includes(values[1])) {\n credit += 1;\n} else {\n message += `Die Zahl ${values[1]} ist keine Primzahl. `\n}\n\nvar a1 = Numbas.jme.unwrapValue(this.question.scope.variables.a2);\nif (values[0] + values[1] == a1) {\n credit += 1;\n} else {\n message += `Die Summe von ${values[0]} und ${values[1]} ist nicht ${a1}.`;\n}\n\nif (credit==3) {\n message = \"Prima, alles richtig!\";\n}\n\nthis.answered = true;\nthis.setCredit(credit/3, message);", "order": "instead"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$G($ [[0]], [[1]] $) = \\var{a2}$.

\n

(Es gibt in der Regel mehrere richtige Antworten. Wenn Sie \"Antworten aufdecken\" wählen, werden unten bei den Hinweisen alle möglichen Antworten angezeigt.)

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{p2}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "mustmatchpattern": {"pattern": "positive:$n", "partialCredit": 0, "message": "Bitte geben Sie eine natürliche Zahl ein.", "nameToCompare": ""}, "valuegenerators": []}, {"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": "{a2}-{p2}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "mustmatchpattern": {"pattern": "positive:$n", "partialCredit": 0, "message": "Bitte geben Sie eine natürliche Zahl ein.", "nameToCompare": ""}, "valuegenerators": []}], "sortAnswers": false}, {"type": "jme", "useCustomName": false, "customName": "", "marks": "5", "scripts": {"mark": {"script": "try {\n var answer = Numbas.jme.unwrapValue(Numbas.jme.evaluate(this.studentAnswer,this.question.scope));\n} catch(e) {\n this.setCredit(0,R('part.jme.answer invalid',e.message));\n return;\n}\n\nif (!(answer instanceof Array)) {\n // console.log(typeof(answer));\n // console.log(answer);\n this.setCredit(0, \"Sie haben keine Menge von ganzen Zahlen eingegeben.\");\n return;\n}\n\nvar num = 0;\nvar result;\n\nfor (a of answer) {\n var aa = Numbas.jme.unwrapValue(a);\n if (!Number.isInteger(aa)) {\n // console.log(aa);\n this.setCredit(0, \"Sie haben keine Menge von ganzen Zahlen eingegeben.\");\n return;\n }\n \n if (aa % 2) {\n this.setCredit(0, `Die Zahl ${aa} ist nicht gerade.`);\n return;\n }\n if (aa <= 2) {\n this.setCredit(0, `Die Zahl ${aa} ist nicht gr\u00f6\u00dfer als 2.`);\n return;\n }\n \n result = [];\n for(p of Numbas.math.primes) {\n if (Numbas.math.primes.includes(aa-p)) result.push(`${p} + ${aa-p}`);\n if (p > aa) break;\n }\n num += result.length;\n}\n\nvar target = Numbas.jme.unwrapValue(this.question.scope.variables.c);\n\nthis.answered = true;\n\nif (num == target) {\n this.setCredit(1, \"Gut, das ist eine m\u00f6gliche Antwort!\");\n} else {\n this.setCredit(0, `Das ist keine richtige L\u00f6sung. Das Urbild der Menge, die Sie angegeben haben, hat ${num} Elemente.`);\n}", "order": "instead"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Geben Sie eine Teilmenge $M$ des Wertebereichs von $G$ an, so dass $G^{-1}(M)$ genau {c} Elemente hat.

\n

Geben Sie $M$ in der Form set(10, 16, 20) an (statt mit Mengenklammern). Beachten Sie: $(3,5)$ und $(5,3)$ sind unterschiedliche Elemente des Definitionsbereichs von $G$.

", "answer": "{result_d}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": []}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Ulrich G\u00f6rtz", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7603/"}]}]}], "contributors": [{"name": "Ulrich G\u00f6rtz", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7603/"}]}