// Numbas version: finer_feedback_settings {"name": "Maria's copy of Newton-Raphson method #2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"scripts": {}, "variableReplacements": [], "prompt": "
The first iteration, correct to three decimal places, gives:
\n\\(x_1=\\) [[0]]
", "type": "gapfill", "gaps": [{"marks": 1, "showCorrectAnswer": true, "precisionPartialCredit": 0, "strictPrecision": false, "mustBeReducedPC": 0, "precision": "3", "minValue": "{x1}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "showPrecisionHint": false, "allowFractions": false, "variableReplacements": [], "correctAnswerStyle": "plain", "scripts": {}, "type": "numberentry", "precisionMessage": "You have not given your answer to the correct precision.", "precisionType": "dp", "correctAnswerFraction": false, "mustBeReduced": false, "maxValue": "{x1}"}], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": 0, "showFeedbackIcon": true}, {"scripts": {}, "variableReplacements": [], "prompt": "The second iteration, correct to three decimal places, gives:
\n\\(x_2=\\) [[0]]
", "type": "gapfill", "gaps": [{"marks": 1, "showCorrectAnswer": true, "precisionPartialCredit": 0, "strictPrecision": false, "mustBeReducedPC": 0, "precision": "3", "minValue": "{x2}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "showPrecisionHint": false, "allowFractions": false, "variableReplacements": [], "correctAnswerStyle": "plain", "scripts": {}, "type": "numberentry", "precisionMessage": "You have not given your answer to the correct precision.", "precisionType": "dp", "correctAnswerFraction": false, "mustBeReduced": false, "maxValue": "{x2}"}], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": 0, "showFeedbackIcon": true}, {"scripts": {}, "variableReplacements": [], "prompt": "The third iteration, correct to three decimal places, gives:
\n\\(x_3=\\) [[0]]
", "type": "gapfill", "gaps": [{"marks": 1, "showCorrectAnswer": true, "precisionPartialCredit": 0, "strictPrecision": false, "mustBeReducedPC": 0, "precision": "3", "minValue": "{x3}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "showPrecisionHint": false, "allowFractions": false, "variableReplacements": [], "correctAnswerStyle": "plain", "scripts": {}, "type": "numberentry", "precisionMessage": "You have not given your answer to the correct precision.", "precisionType": "dp", "correctAnswerFraction": false, "mustBeReduced": false, "maxValue": "{x3}"}], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": 0, "showFeedbackIcon": true}, {"scripts": {}, "variableReplacements": [], "prompt": "The fourth iteration, correct to three decimal places, gives:
\n\\(x_4=\\) [[0]]
", "type": "gapfill", "gaps": [{"marks": 1, "showCorrectAnswer": true, "precisionPartialCredit": 0, "strictPrecision": false, "mustBeReducedPC": 0, "precision": "3", "minValue": "{x4}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "showPrecisionHint": false, "allowFractions": false, "variableReplacements": [], "correctAnswerStyle": "plain", "scripts": {}, "type": "numberentry", "precisionMessage": "You have not given your answer to the correct precision.", "precisionType": "dp", "correctAnswerFraction": false, "mustBeReduced": false, "maxValue": "{x4}"}], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": 0, "showFeedbackIcon": true}], "advice": "\\(f(x)= x^3-\\simplify{{a}+{b}+{c}}x^2+\\simplify{{a}*{b}+{a}*{c}+{b}*{c}}x+\\simplify{-{a}*{b}*{c}}\\)
\nThe Newton-Raphson formula states: \\(x_{n+1}=x_n-\\frac{f(x_n)}{f'(x_n)}\\)
\nFor this example tht gives: \\(x_{n+1}=x_n-\\frac{x_n^3-\\simplify{{a}+{b}+{c}}x_n^2+\\simplify{{a}*{b}+{a}*{c}+{b}*{c}}x_n+\\simplify{-{a}*{b}*{c}}}{3x_n^2-\\simplify{2*({a}+{b}+{c})}x_n+\\simplify{{a}*{b}+{a}*{c}+{b}*{c}}}\\)
\nTake \\(x_0=\\var{x0}\\)
\n\\(x_1=\\var{x0}-\\frac{(\\var{x0})^3-\\simplify{{a}+{b}+{c}}(\\var{x0})^2+\\simplify{{a}*{b}+{a}*{c}+{b}*{c}}(\\var{x0})+\\simplify{-{a}*{b}*{c}}}{3(\\var{x0})^2-\\simplify{2*({a}+{b}+{c})}(\\var{x0})+\\simplify{{a}*{b}+{a}*{c}+{b}*{c}}}\\)
\n\\(x_1=\\var{x0}-\\frac{\\simplify{{x0}^3-({a}+{b}+{c})*{x0}^2+({a}*{b}+{a}*{c}+{b}*{c})*{x0}-{a}*{b}*{c}}}{\\simplify{(3)*{x0}^2-(2*({a}+{b}+{c}))*{x0}+({a}*{b}+{a}*{c}+{b}*{c})}}\\)
\n\\(x_1=\\var{x1}\\)
\nThe second iteration:
\n\\(x_2=\\var{x1}-\\frac{(\\var{x1})^3-\\simplify{{a}+{b}+{c}}(\\var{x1})^2+\\simplify{{a}*{b}+{a}*{c}+{b}*{c}}(\\var{x1})+\\simplify{-{a}*{b}*{c}}}{3(\\var{x1})^2-\\simplify{2*({a}+{b}+{c})}(\\var{x1})+\\simplify{{a}*{b}+{a}*{c}+{b}*{c}}}\\)
\n\\(x_2=\\var{x1}-\\frac{\\simplify{{x1}^3-({a}+{b}+{c})*{x1}^2+({a}*{b}+{a}*{c}+{b}*{c})*{x1}-{a}*{b}*{c}}}{\\simplify{(3)*{x1}^2-(2*({a}+{b}+{c}))*{x1}+({a}*{b}+{a}*{c}+{b}*{c})}}\\)
\n\\(x_2=\\var{x2}\\)
\nThe third iteration:
\n\\(x_3=\\var{x2}-\\frac{(\\var{x2})^3-\\simplify{{a}+{b}+{c}}(\\var{x2})^2+\\simplify{{a}*{b}+{a}*{c}+{b}*{c}}(\\var{x2})+\\simplify{-{a}*{b}*{c}}}{3(\\var{x2})^2-\\simplify{2*({a}+{b}+{c})}(\\var{x2})+\\simplify{{a}*{b}+{a}*{c}+{b}*{c}}}\\)
\n\\(x_3=\\var{x2}-\\frac{\\simplify{{x2}^3-({a}+{b}+{c})*{x2}^2+({a}*{b}+{a}*{c}+{b}*{c})*{x2}-{a}*{b}*{c}}}{\\simplify{(3)*{x2}^2-(2*({a}+{b}+{c}))*{x2}+({a}*{b}+{a}*{c}+{b}*{c})}}\\)
\n\\(x_3=\\var{x3}\\)
\nThe fourth iteration:
\n\\(x_4=\\var{x3}-\\frac{(\\var{x3})^3-\\simplify{{a}+{b}+{c}}(\\var{x3})^2+\\simplify{{a}*{b}+{a}*{c}+{b}*{c}}(\\var{x3})+\\simplify{-{a}*{b}*{c}}}{3(\\var{x3})^2-\\simplify{2*({a}+{b}+{c})}(\\var{x3})+\\simplify{{a}*{b}+{a}*{c}+{b}*{c}}}\\)
\n\\(x_4=\\var{x3}-\\frac{\\simplify{{x3}^3-({a}+{b}+{c})*{x3}^2+({a}*{b}+{a}*{c}+{b}*{c})*{x3}-{a}*{b}*{c}}}{\\simplify{(3)*{x3}^2-(2*({a}+{b}+{c}))*{x3}+({a}*{b}+{a}*{c}+{b}*{c})}}\\)
\n\\(x_4=\\var{x4}\\)
", "ungrouped_variables": ["a", "b", "x0", "x1", "x2", "x3", "x4", "c"], "tags": [], "metadata": {"licence": "Creative Commons Attribution-NonCommercial 4.0 International", "description": ""}, "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "Perform four iterations of the Newton-Raphson method on the function:
\n\\(f(x)= x^3-\\simplify{{a}+{b}+{c}}x^2+\\simplify{{a}*{b}+{a}*{c}+{b}*{c}}x+\\simplify{-{a}*{b}*{c}}\\)
\ntaking \\(x_0=\\var{x0}\\) as your approximation.
", "name": "Maria's copy of Newton-Raphson method #2", "functions": {}, "preamble": {"js": "", "css": ""}, "variables": {"c": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "definition": "random(-3..-1#1)", "name": "c"}, "x4": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "x3-(x3^3-(a+b+c)*x3^2+(a*b+a*c+b*c)*x3-a*b*c)/(3*x3^2-2*(a+b+c)*x3+a*b+a*c+b*c)", "name": "x4"}, "x0": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "(a+b)/2-1", "name": "x0"}, "x3": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "x2-(x2^3-(a+b+c)*x2^2+(a*b+a*c+b*c)*x2-a*b*c)/(3*x2^2-2*(a+b+c)*x2+a*b+a*c+b*c)", "name": "x3"}, "x2": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "x1-(x1^3-(a+b+c)*x1^2+(a*b+a*c+b*c)*x1-a*b*c)/(3*x1^2-2*(a+b+c)*x1+a*b+a*c+b*c)", "name": "x2"}, "x1": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "x0-(x0^3-(a+b+c)*x0^2+(a*b+a*c+b*c)*x0-a*b*c)/(3*x0^2-2*(a+b+c)*x0+a*b+a*c+b*c)", "name": "x1"}, "a": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "definition": "random(5..10#1)", "name": "a"}, "b": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "definition": "random(10..20#1)", "name": "b"}}, "variable_groups": [], "extensions": [], "rulesets": {}, "type": "question", "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}]}], "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}