// Numbas version: exam_results_page_options {"name": "Newton-Raphson method", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "variables": {"c": {"name": "c", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(1..10#1)"}, "x4": {"name": "x4", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "x3-(a*x3^3-b*x3^2+c*x3+d)/(3*a*x3^2-2*b*x3+c)"}, "x2": {"name": "x2", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "x1-(a*x1^3-b*x1^2+c*x1+d)/(3*a*x1^2-2*b*x1+c)"}, "b": {"name": "b", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(13..36#1)"}, "x5": {"name": "x5", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "x4-(a*x4^3-b*x4^2+c*x4+d)/(3*a*x4^2-2*b*x4+c)"}, "d": {"name": "d", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(4..40#1)"}, "x3": {"name": "x3", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "x2-(a*x2^3-b*x2^2+c*x2+d)/(3*a*x2^2-2*b*x2+c)"}, "x1": {"name": "x1", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "x0-((a*x0^3-b*x0^2+c*x0+d)/(3*a*x0^2-2*b*x0+c))"}, "k": {"name": "k", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(1..4#1)"}, "a": {"name": "a", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(1..5#1)"}, "x0": {"name": "x0", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "round(-b/(3*a))+k"}}, "rulesets": {}, "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "name": "Newton-Raphson method", "parts": [{"variableReplacements": [], "showCorrectAnswer": true, "type": "gapfill", "showFeedbackIcon": true, "prompt": "

\\(x_0=\\var{x0}\\)

\n

\\(x_1=\\) [[0]]

\n

\\(x_2=\\) [[1]]

\n

\\(x_3=\\) [[2]]

\n

\\(x_4=\\) [[3]]

", "gaps": [{"variableReplacements": [], "minValue": "{x1}", "showCorrectAnswer": true, "type": "numberentry", "precisionType": "dp", "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "showFeedbackIcon": true, "precision": "3", "precisionPartialCredit": 0, "showPrecisionHint": true, "correctAnswerFraction": false, "marks": 1, "maxValue": "{x1}", "mustBeReduced": false, "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "scripts": {}, "strictPrecision": false, "correctAnswerStyle": "plain"}, {"variableReplacements": [], "minValue": "{x2}", "showCorrectAnswer": true, "type": "numberentry", "precisionType": "dp", "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "showFeedbackIcon": true, "precision": "3", "precisionPartialCredit": 0, "showPrecisionHint": true, "correctAnswerFraction": false, "marks": 1, "maxValue": "{x2}", "mustBeReduced": false, "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "scripts": {}, "strictPrecision": false, "correctAnswerStyle": "plain"}, {"variableReplacements": [], "minValue": "{x3}", "showCorrectAnswer": true, "type": "numberentry", "precisionType": "dp", "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "showFeedbackIcon": true, "precision": "3", "precisionPartialCredit": 0, "showPrecisionHint": true, "correctAnswerFraction": false, "marks": 1, "maxValue": "{x3}", "mustBeReduced": false, "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "scripts": {}, "strictPrecision": false, "correctAnswerStyle": "plain"}, {"variableReplacements": [], "minValue": "{x4}", "showCorrectAnswer": true, "type": "numberentry", "precisionType": "dp", "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "showFeedbackIcon": true, "precision": "3", "precisionPartialCredit": 0, "showPrecisionHint": true, "correctAnswerFraction": false, "marks": 1, "maxValue": "{x4}", "mustBeReduced": false, "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "scripts": {}, "strictPrecision": false, "correctAnswerStyle": "plain"}], "variableReplacementStrategy": "originalfirst", "scripts": {}, "marks": 0}], "statement": "

Perform four iterations of the Newton-Raphson method, taking  \\(x_0=\\var{x0}\\)  as your initial estimate to find a root of the function:

\n

\\(f(x)=\\var{a}x^3-\\var{b}x^2+\\var{c}x+\\var{d}\\)

\n

Give your answers correct to three decimal places.

", "variable_groups": [], "variablesTest": {"condition": "", "maxRuns": 100}, "tags": [], "extensions": [], "preamble": {"css": "", "js": ""}, "ungrouped_variables": ["k", "a", "b", "c", "x1", "d", "x2", "x3", "x4", "x5", "x0"], "advice": "

\\(x_{n+1}=x_n-\\frac{\\var{a}x_n^3-\\var{b}x_n^2+\\var{c}x+\\var{d}}{3(\\var{a})x_n^2-2(\\var{b})x+\\var{c}}\\)

\n

\\(x_0=\\var{x0}\\)

\n

\\(x_1=\\var{x0}-\\frac{(\\var{a})*(\\var{x0})^3-\\var{b}*(\\var{x0})^2+\\var{c}*(\\var{x0})+\\var{d}}{3(\\var{a})(\\var{x0})^2-2(\\var{b})(\\var{x0})+\\var{c}}=\\var{x1}\\)

\n

\\(x_2=\\var{x1}-\\frac{(\\var{a})*(\\var{x1})^3-\\var{b}*(\\var{x1})^2+\\var{c}*(\\var{x1})+\\var{d}}{3(\\var{a})(\\var{x1})^2-2(\\var{b})(\\var{x1})+\\var{c}}=\\var{x2}\\)

\n

\\(x_3=\\var{x2}-\\frac{(\\var{a})*(\\var{x2})^3-\\var{b}*(\\var{x2})^2+\\var{c}*(\\var{x2})+\\var{d}}{3(\\var{a})(\\var{x2})^2-2(\\var{b})(\\var{x2})+\\var{c}}=\\var{x3}\\)

\n

\\(x_4=\\var{x3}-\\frac{(\\var{a})*(\\var{x3})^3-\\var{b}*(\\var{x3})^2+\\var{c}*(\\var{x3})+\\var{d}}{3(\\var{a})(\\var{x3})^2-2(\\var{b})(\\var{x3})+\\var{c}}=\\var{x4}\\)

\n

\\(x_5=\\var{x4}-\\frac{(\\var{a})*(\\var{x4})^3-\\var{b}*(\\var{x4})^2+\\var{c}*(\\var{x4})+\\var{d}}{3(\\var{a})(\\var{x4})^2-2(\\var{b})(\\var{x4})+\\var{c}}=\\var{x5}\\)

", "type": "question", "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}]}], "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}