// Numbas version: finer_feedback_settings
{"name": "Proof 1: the Goldbach conjecture", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Proof 1: the Goldbach conjecture", "tags": [], "metadata": {"description": "
Intorduction to proof and existence statements.
", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "statement": "In 1742, Christian Goldbach wrote in a letter to Leonhard Euler claiming that
\nEvery even integer greater than 2 can be written as the sum of two primes.
\nThis is now called Goldbach's conjecture, and is the oldest and best-known unsolved problem in number theory. While the proof has remained elusive, the conjecture has been computer verified for numbers up to $4\\times 10^{18}$.
", "advice": "This is a question about proof. You must show that each of the given numbers can be written as the sum of two prime numbers. The best way to do this is to exhibit the numbers as a sum of primes:
\n\n- $\\var{2a} = \\var{answers[keys(answers)[a]]}$
\n- $\\var{2(a+1)} = \\var{answers[keys(answers)[a+1]]}$
\n- $\\var{2(a+2)} = \\var{answers[keys(answers)[a+2]]}$
\n- $\\var{2(a+3)} = \\var{answers[keys(answers)[a+3]]}$.
\n
", "rulesets": {}, "extensions": [], "variables": {"A1": {"name": "A1", "group": "Ungrouped variables", "definition": "answers[\"\" + 2(a+1)]", "description": "", "templateType": "anything"}, "A3": {"name": "A3", "group": "Ungrouped variables", "definition": "answers[\"\" + 2(a+3)]", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(2..12)", "description": "", "templateType": "anything"}, "A2": {"name": "A2", "group": "Ungrouped variables", "definition": "answers[\"\" + 2(a+2)]", "description": "", "templateType": "anything"}, "answers": {"name": "answers", "group": "Ungrouped variables", "definition": "[\"0\":\"0+0\",\"2\":\"1+1\",\"4\":\"2+2\",\"6\":\"3+3\",\"8\":\"3+5\",\"10\":\"5+5\",\"12\":\"5+7\",\"14\":\"7+7\",\"16\":\"11+5\",\"18\":\"11+7\",\"20\":\"13+7\",\"22\":\"5+17\",\"24\":\"5+19\",\"26\":\"19+7\",\"28\":\"17+11\",\"30\":\"17+13\"]", "description": "", "templateType": "anything"}, "A0": {"name": "A0", "group": "Ungrouped variables", "definition": "answers[\"\" + 2(a+0)]", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "answers", "A0", "A1", "A2", "A3"], "variable_groups": [], "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": "Consider the following weakened version of the Goldbach conjecture:
\nEvery even integer between $\\var{2a}$ and $\\var{2(a+3) + 1}$ is the sum of two primes.
\nProve that it is possible to write these numbers as a sum of two primes, by actually writing them as sum of two primes:
\n\n- $\\var{2a} = $ [[0]]
\n- $\\var{2(a+1)} = $ [[1]]
\n- $\\var{2(a+2)} = $ [[2]]
\n- $\\var{2(a+3)} = $ [[3]].
\n
", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {"mark": {"script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar a = unwrap(variables.a);\n\ntry {\n var numbers = this.studentAnswer.split(\"+\");\n \n if (numbers.length != 2) {\n // check this is a sum of two numbers\n this.setCredit(0,\"Enter a sum of two numbers\");\n } else {\n this.answered = true;\n // check the numbers are prime\n for (var j=0; j<2; j++) {\n var p = Numbas.util.parseNumber(numbers[j]);\n if (1 == p) {\n this.setCredit(0,\"The number $1$ is not prime.\");\n return;\n }\n for (var i = 2; i < p; i++) {\n if (0 == p % i) {\n this.setCredit(0,\"The number $\" + p + \"$ is not prime.\");\n return;\n }\n }\n }\n // check the numbers add up properly\n if (2*a == Numbas.util.parseNumber(numbers[0]) + Numbas.util.parseNumber(numbers[1])) {\n this.setCredit(1,\"Good, $\" + 2*a + \" = \" + this.studentAnswer + \"$.\");\n } else {\n this.setCredit(0,\"$\" + 2*a + \" \\\\neq \" + this.studentAnswer + \"$.\");\n }\n }\n}\ncatch(e) {\n this.markingComment(e);\n}", "order": "after"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{A0}", "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 + positive:$n", "partialCredit": 0, "message": "Give your response as the sum of two positive integers, such as \"2+2\".", "nameToCompare": ""}, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {"mark": {"script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar a = unwrap(variables.a);\n\ntry {\n var numbers = this.studentAnswer.split(\"+\");\n \n if (numbers.length != 2) {\n // check this is a sum of two numbers\n this.setCredit(0,\"Enter a sum of two numbers\");\n } else {\n this.answered = true;\n // check the numbers are prime\n for (var j=0; j<2; j++) {\n var p = Numbas.util.parseNumber(numbers[j]);\n if (1 == p) {\n this.setCredit(0,\"The number $1$ is not prime.\");\n return;\n }\n for (var i = 2; i < p; i++) {\n if (0 == p % i) {\n this.setCredit(0,\"The number $\" + p + \"$ is not prime.\");\n return;\n }\n }\n }\n // check the numbers add up properly\n if (2*(a+1) == Numbas.util.parseNumber(numbers[0]) + Numbas.util.parseNumber(numbers[1])) {\n this.setCredit(1,\"Good, $\" + 2*(a+1) + \" = \" + this.studentAnswer + \"$.\");\n } else {\n this.setCredit(0,\"$\" + 2*(a+1) + \" \\\\neq \" + this.studentAnswer + \"$.\");\n }\n }\n}\ncatch(e) {\n this.markingComment(e);\n}", "order": "instead"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{A1}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {"mark": {"script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar a = unwrap(variables.a);\n\ntry {\n var numbers = this.studentAnswer.split(\"+\");\n \n if (numbers.length != 2) {\n // check this is a sum of two numbers\n this.setCredit(0,\"Enter a sum of two numbers\");\n } else {\n this.answered = true;\n // check the numbers are prime\n for (var j=0; j<2; j++) {\n var p = Numbas.util.parseNumber(numbers[j]);\n if (1 == p) {\n this.setCredit(0,\"The number $1$ is not prime.\");\n return;\n }\n for (var i = 2; i < p; i++) {\n if (0 == p % i) {\n this.setCredit(0,\"The number $\" + p + \"$ is not prime.\");\n return;\n }\n }\n }\n // check the numbers add up properly\n if (2*(a+2) == Numbas.util.parseNumber(numbers[0]) + Numbas.util.parseNumber(numbers[1])) {\n this.setCredit(1,\"Good, $\" + 2*(a+2) + \" = \" + this.studentAnswer + \"$.\");\n } else {\n this.setCredit(0,\"$\" + 2*(a+2) + \" \\\\neq \" + this.studentAnswer + \"$.\");\n }\n }\n}\ncatch(e) {\n this.markingComment(e);\n}", "order": "instead"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{A2}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {"mark": {"script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar a = unwrap(variables.a);\n\ntry {\n var numbers = this.studentAnswer.split(\"+\");\n \n if (numbers.length != 2) {\n // check this is a sum of two numbers\n this.setCredit(0,\"Enter a sum of two numbers\");\n } else {\n this.answered = true;\n // check the numbers are prime\n for (var j=0; j<2; j++) {\n var p = Numbas.util.parseNumber(numbers[j]);\n if (1 == p) {\n this.setCredit(0,\"The number $1$ is not prime.\");\n return;\n }\n for (var i = 2; i < p; i++) {\n if (0 == p % i) {\n this.setCredit(0,\"The number $\" + p + \"$ is not prime.\");\n return;\n }\n }\n }\n // check the numbers add up properly\n if (2*(a+3) == Numbas.util.parseNumber(numbers[0]) + Numbas.util.parseNumber(numbers[1])) {\n this.setCredit(1,\"Good, $\" + 2*(a+3) + \" = \" + this.studentAnswer + \"$.\");\n } else {\n this.setCredit(0,\"$\" + 2*(a+3) + \" \\\\neq \" + this.studentAnswer + \"$.\");\n }\n }\n}\ncatch(e) {\n this.markingComment(e);\n}", "order": "instead"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{A3}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}]}]}], "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}]}