// Numbas version: finer_feedback_settings {"name": "Musa's copy of 3 Number of roots and stationary points of a graph", "extensions": ["geogebra", "jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Musa's copy of 3 Number of roots and stationary points of a graph", "tags": [], "metadata": {"description": "
A graph (of a cubic) is given. The question is to determine the number of roots and number of stationary points the graph has. Non-calculator. Advice is given.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "Finding the number of roots and turning points based on a graph.
", "advice": "(i) Definition: A 'root' of a function $f(x)$ is a value of $x$ which makes $f(x)=0$. Visually a root can be found be seeing when the $y$-coordinate of the graph is $0$, i.e., when the graph crosses the $x$-axis. Therefore, to count the roots, you need to count how many times the graph crosses the $x$-axis. In this question, the graph crosses the $x$-axis $\\var{num_roots}$ time(s), so there are $\\var{num_roots}$ roots.
\n(ii) Definition: A 'stationary point' of a function is a point on the graph where $f'(x)=0$. Remember that $f'$ tells us the gradient of $f$, so visually a stationary point is where the gradient of the curve is 0. In this question, there is/are $\\var{num_stat}$ place(s) where the gradient of the graph is $0$, so the answer is $\\var{num_stat}$.
\n(iii) There are 3 types of stationary points: maximum points, minimum points and points of inflection.
\nConsider what happens to the gradient at a maximum point. It is positive just before the maximum point, zero at the maximum point, then negative just after the maximum point.
\nJust before a minimum point the gradient is negative, at the minimum the gradient is zero and just after the minimum point it is positive.
\n", "rulesets": {}, "extensions": ["geogebra", "jsxgraph"], "variables": {"num_roots": {"name": "num_roots", "group": "Ungrouped variables", "definition": "if(num_stat = 2, random(1..3), 1)", "description": "The number of roots.
", "templateType": "anything"}, "vshift": {"name": "vshift", "group": "Ungrouped variables", "definition": "random(-2..2)", "description": "Random amount of vertifical shift for sake of variability.
", "templateType": "anything"}, "num_stat": {"name": "num_stat", "group": "Ungrouped variables", "definition": "random(0..2)", "description": "Number of stationary points
", "templateType": "anything"}, "hshift": {"name": "hshift", "group": "Ungrouped variables", "definition": "random(-2..2)", "description": "Random amount of horizontal shift to create variability.
", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-1..1 except 0)", "description": "Coefficient of x^3
", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["num_roots", "num_stat", "a", "hshift", "vshift"], "variable_groups": [], "functions": {"plotgraph": {"parameters": [["num_stat", "number"], ["num_roots", "number"], ["a", "number"], ["h", "number"], ["v", "number"]], "type": "html", "language": "javascript", "definition": "// This functions plots a cubic with a certain number of\n// stationary points and roots.\n// It creates the board, sets it up, then returns an\n// HTML div tag containing the board.\n\n\n// Max and min x and y values for the axis.\nvar x_min = -6;\nvar x_max = 6;\nvar y_min = -10;\nvar y_max = 10;\n\n\n// First, make the JSXGraph board.\nvar div = Numbas.extensions.jsxgraph.makeBoard(\n '500px',\n '600px',\n {\n boundingBox: [x_min,y_max,x_max,y_min],\n axis: false,\n showNavigation: true,\n grid: true\n }\n);\n\n\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = board.create('ticks',[xaxis,1],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 0\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,1],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n});\n\n\n\n\n// Plot the function.\n\nswitch (num_stat) {\n case 0:\n board.create('functiongraph',\n [function(x){ return a*(Math.pow(x+h,3)+2*(x+h)+v);},x_min,x_max]);\n break;\n \n case 1:\n board.create('functiongraph',\n [function(x){ return a*(Math.pow(x+h,3)+v);},x_min,x_max]);\n break;\n \n case 2:\n switch (num_roots) {\n case 1:\n board.create('functiongraph',\n [function(x){ return a*((x+2+h)*(x+h)*(x-2+h)+5);},x_min,x_max]);\n break;\n \n case 2:\n board.create('functiongraph',\n [function(x){ return a*((x+1+h)*(x+1+h)*(x-2+h));},x_min,x_max]);\n break;\n break;\n \n case 3:\n board.create('functiongraph',\n [function(x){ return a*((x+2+h)*(x+h)*(x-2+h));},x_min,x_max]);\n break;\n }\n \n \n break;\n}\n\n\n// num_stat\n\n\n\n\n\nreturn div;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "{plotgraph(num_stat,num_roots, a, hshift, vshift)}
\nAbove is the graph of some function $f$.
\nHow many roots does $~~f(x)=0~~$ have? [[0]]
\nHow many stationary points does $f(x)$ have? [[1]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "num_roots", "maxValue": "num_roots", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "num_stat", "maxValue": "num_stat", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "type": "question", "contributors": [{"name": "Nick Walker", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2416/"}, {"name": "Thomas Waters", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3649/"}, {"name": "Musa Mammadov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4417/"}]}]}], "contributors": [{"name": "Nick Walker", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2416/"}, {"name": "Thomas Waters", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3649/"}, {"name": "Musa Mammadov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4417/"}]}