// Numbas version: exam_results_page_options {"name": "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": "Number of roots and stationary points of a graph", "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}\$.

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"}, "functions": {"plotgraph": {"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;", "parameters": [["num_stat", "number"], ["num_roots", "number"], ["a", "number"], ["h", "number"], ["v", "number"]], "type": "html", "language": "javascript"}}, "ungrouped_variables": ["num_roots", "num_stat", "a", "hshift", "vshift"], "variable_groups": [], "extensions": ["geogebra", "jsxgraph"], "type": "question", "statement": "

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

", "variablesTest": {"condition": "", "maxRuns": 100}, "rulesets": {}, "parts": [{"marks": 0, "variableReplacementStrategy": "originalfirst", "gaps": [{"maxValue": "num_roots", "correctAnswerFraction": false, "marks": "1", "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "variableReplacements": [], "notationStyles": ["plain"], "mustBeReduced": false, "mustBeReducedPC": 0, "type": "numberentry", "correctAnswerStyle": "plain", "unitTests": [], "showCorrectAnswer": true, "allowFractions": false, "minValue": "num_roots", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true}, {"maxValue": "num_stat", "correctAnswerFraction": false, "marks": 1, "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "mustBeReducedPC": 0, "type": "numberentry", "correctAnswerStyle": "plain", "unitTests": [], "showCorrectAnswer": true, "allowFractions": false, "minValue": "num_stat", "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true}], "variableReplacements": [], "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]]

", "customMarkingAlgorithm": "", "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "extendBaseMarkingAlgorithm": true}], "variables": {"num_roots": {"description": "

The number of roots.

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

Random amount of vertifical shift for sake of variability.

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

Number of stationary points

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

Random amount of horizontal shift to create variability.

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

Coefficient of x^3

", "name": "a", "definition": "random(-1..1 except 0)", "templateType": "anything", "group": "Ungrouped variables"}}, "preamble": {"css": "", "js": ""}, "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/"}]}]}], "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/"}]}