// Numbas version: exam_results_page_options {"name": "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}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Differentiation, graphs: Number of roots and stationary points of a graph", "rulesets": {}, "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"}, "parts": [{"type": "gapfill", "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]]

", "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "customMarkingAlgorithm": "", "variableReplacements": [], "unitTests": [], "gaps": [{"correctAnswerStyle": "plain", "type": "numberentry", "showFeedbackIcon": true, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "customMarkingAlgorithm": "", "variableReplacements": [], "unitTests": [], "allowFractions": false, "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain"], "minValue": "num_roots", "showCorrectAnswer": true, "maxValue": "num_roots", "marks": "1"}, {"correctAnswerStyle": "plain", "type": "numberentry", "showFeedbackIcon": true, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "scripts": {}, "customMarkingAlgorithm": "", "variableReplacements": [], "unitTests": [], "allowFractions": false, "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "minValue": "num_stat", "showCorrectAnswer": true, "maxValue": "num_stat", "marks": 1}], "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "marks": 0}], "preamble": {"css": "", "js": ""}, "functions": {"plotgraph": {"type": "html", "language": "javascript", "parameters": [["num_stat", "number"], ["num_roots", "number"], ["a", "number"], ["h", "number"], ["v", "number"]], "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;"}}, "variable_groups": [], "extensions": ["geogebra", "jsxgraph"], "variables": {"vshift": {"description": "

Random amount of vertifical shift for sake of variability.

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

Coefficient of x^3

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

Random amount of horizontal shift to create variability.

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

The number of roots.

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

Number of stationary points

", "name": "num_stat", "group": "Ungrouped variables", "templateType": "anything", "definition": "random(0..2)"}}, "tags": [], "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}\$.

", "statement": "

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

", "ungrouped_variables": ["num_roots", "num_stat", "a", "hshift", "vshift"], "variablesTest": {"maxRuns": 100, "condition": ""}, "type": "question", "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}]}]}], "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}]}