// Numbas version: exam_results_page_options {"name": "Proof 1: the Goldbach conjecture", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"showfrontpage": false, "preventleave": false, "allowregen": true}, "question_groups": [{"questions": [{"type": "question", "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
", "name": "Proof 1: the Goldbach conjecture", "tags": [], "ungrouped_variables": ["a", "answers", "A0", "A1", "A2", "A3"], "variable_groups": [], "extensions": [], "preamble": {"js": "", "css": ""}, "metadata": {"description": "

Intorduction to proof and existence statements.

", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "parts": [{"sortAnswers": false, "marks": 0, "scripts": {}, "useCustomName": false, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "prompt": "

Prove the following weakened version of the Goldbach conjecture:

\n

Every even integer between $\\var{2a}$ and $\\var{2(a+3) + 1}$ is the sum of two primes.

\n

Prove 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
", "showFeedbackIcon": true, "variableReplacements": [], "gaps": [{"checkVariableNames": false, "marks": 1, "showPreview": true, "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": "instead"}}, "type": "jme", "useCustomName": false, "showFeedbackIcon": true, "vsetRangePoints": 5, "failureRate": 1, "vsetRange": [0, 1], "variableReplacements": [], "checkingType": "absdiff", "showCorrectAnswer": true, "checkingAccuracy": 0.001, "customMarkingAlgorithm": "", "customName": "", "variableReplacementStrategy": "originalfirst", "answer": "{A0}", "valuegenerators": [], "extendBaseMarkingAlgorithm": true, "unitTests": []}, {"checkVariableNames": false, "marks": 1, "showPreview": true, "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"}}, "type": "jme", "useCustomName": false, "showFeedbackIcon": true, "vsetRangePoints": 5, "failureRate": 1, "vsetRange": [0, 1], "variableReplacements": [], "checkingType": "absdiff", "showCorrectAnswer": true, "checkingAccuracy": 0.001, "customMarkingAlgorithm": "", "customName": "", "variableReplacementStrategy": "originalfirst", "answer": "{A1}", "valuegenerators": [], "extendBaseMarkingAlgorithm": true, "unitTests": []}, {"checkVariableNames": false, "marks": 1, "showPreview": true, "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"}}, "type": "jme", "useCustomName": false, "showFeedbackIcon": true, "vsetRangePoints": 5, "failureRate": 1, "vsetRange": [0, 1], "variableReplacements": [], "checkingType": "absdiff", "showCorrectAnswer": true, "checkingAccuracy": 0.001, "customMarkingAlgorithm": "", "customName": "", "variableReplacementStrategy": "originalfirst", "answer": "{A2}", "valuegenerators": [], "extendBaseMarkingAlgorithm": true, "unitTests": []}, {"checkVariableNames": false, "marks": 1, "showPreview": true, "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"}}, "type": "jme", "useCustomName": false, "showFeedbackIcon": true, "vsetRangePoints": 5, "failureRate": 1, "vsetRange": [0, 1], "variableReplacements": [], "checkingType": "absdiff", "showCorrectAnswer": true, "checkingAccuracy": 0.001, "customMarkingAlgorithm": "", "customName": "", "variableReplacementStrategy": "originalfirst", "answer": "{A3}", "valuegenerators": [], "extendBaseMarkingAlgorithm": true, "unitTests": []}], "showCorrectAnswer": true, "unitTests": [], "customMarkingAlgorithm": "", "customName": "", "extendBaseMarkingAlgorithm": true}], "variablesTest": {"maxRuns": 100, "condition": ""}, "functions": {}, "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/", "name": "Daniel Mansfield"}, {"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/", "name": "Sean Gardiner"}], "rulesets": {}, "variables": {"A0": {"definition": "answers[\"\" + 2(a+0)]", "group": "Ungrouped variables", "name": "A0", "description": "", "templateType": "anything"}, "A3": {"definition": "answers[\"\" + 2(a+3)]", "group": "Ungrouped variables", "name": "A3", "description": "", "templateType": "anything"}, "A2": {"definition": "answers[\"\" + 2(a+2)]", "group": "Ungrouped variables", "name": "A2", "description": "", "templateType": "anything"}, "a": {"definition": "random(2..12)", "group": "Ungrouped variables", "name": "a", "description": "", "templateType": "anything"}, "A1": {"definition": "answers[\"\" + 2(a+1)]", "group": "Ungrouped variables", "name": "A1", "description": "", "templateType": "anything"}, "answers": {"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\"]", "group": "Ungrouped variables", "name": "answers", "description": "", "templateType": "anything"}}, "statement": "

In 1742, Christian Goldbach wrote in a letter to Leonhard Euler claiming that

\n

Every even integer greater than 2 can be written as the sum of two primes.

\n

This 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}$.

"}], "pickingStrategy": "all-ordered"}], "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/", "name": "Daniel Mansfield"}, {"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/", "name": "Sean Gardiner"}]}