// Numbas version: exam_results_page_options {"name": "Nick's copy of Differentiation, graphs: 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": [{"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}$.

", "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"}, "extensions": ["geogebra", "jsxgraph"], "tags": [], "name": "Nick's copy of Differentiation, graphs: Number of roots and stationary points of a graph", "rulesets": {}, "functions": {"plotgraph": {"parameters": [["num_stat", "number"], ["num_roots", "number"], ["a", "number"], ["h", "number"], ["v", "number"]], "type": "html", "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;", "language": "javascript"}}, "statement": "

Finding the number of roots and turning points based on a graph.

", "parts": [{"showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "prompt": "

{plotgraph(num_stat,num_roots, a, hshift, vshift)}

\n

Above is the graph of some function $f$.

\n

How many roots does $f$ have? [[0]]

\n

How many stationary points does $f$ have? [[1]]

", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "gaps": [{"showCorrectAnswer": true, "variableReplacements": [], "correctAnswerStyle": "plain", "notationStyles": ["plain"], "maxValue": "num_roots", "minValue": "num_roots", "marks": "1", "extendBaseMarkingAlgorithm": true, "mustBeReducedPC": 0, "allowFractions": false, "correctAnswerFraction": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "scripts": {}}, {"showCorrectAnswer": true, "variableReplacements": [], "correctAnswerStyle": "plain", "notationStyles": ["plain", "en", "si-en"], "maxValue": "num_stat", "minValue": "num_stat", "marks": 1, "extendBaseMarkingAlgorithm": true, "mustBeReducedPC": 0, "allowFractions": false, "correctAnswerFraction": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "unitTests": [], "showFeedbackIcon": true, "scripts": {}}], "type": "gapfill", "unitTests": [], "showFeedbackIcon": true, "scripts": {}}], "variables": {"num_roots": {"name": "num_roots", "description": "

The number of roots.

", "definition": "if(num_stat = 2, random(1..3), 1)", "group": "Ungrouped variables", "templateType": "anything"}, "vshift": {"name": "vshift", "description": "

Random amount of vertifical shift for sake of variability.

", "definition": "random(-2..2)", "group": "Ungrouped variables", "templateType": "anything"}, "a": {"name": "a", "description": "

Coefficient of x^3

", "definition": "random(-1..1 except 0)", "group": "Ungrouped variables", "templateType": "anything"}, "hshift": {"name": "hshift", "description": "

Random amount of horizontal shift to create variability.

", "definition": "random(-2..2)", "group": "Ungrouped variables", "templateType": "anything"}, "num_stat": {"name": "num_stat", "description": "

Number of stationary points

", "definition": "random(0..2)", "group": "Ungrouped variables", "templateType": "anything"}}, "variable_groups": [], "ungrouped_variables": ["num_roots", "num_stat", "a", "hshift", "vshift"], "variablesTest": {"condition": "", "maxRuns": 100}, "preamble": {"css": "", "js": ""}, "type": "question", "contributors": [{"name": "Nick Walker", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2416/"}]}]}], "contributors": [{"name": "Nick Walker", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2416/"}]}