// Numbas version: exam_results_page_options {"name": "Stimulus: random point on function graph", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Stimulus: random point on function graph", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "
Given below is the graph of a function $y=f(x)$.
\n{graph_cubic(a,b,c,d)}
", "advice": "The derivative at $x$ corresponds to the slope of the tangent line to the graph at the point $(x,f(x))$. In the figure below, we have drawn the line with slope $\\var{y0prime}$ through the origin in blue. We have also drawn a tangent line (in red) to the graph that is parallel to it and where the point of tangency has an $x$-value from the choices offered.
\n{graph_cubic_and_lines(a,b,c,d,x0,y0,y0prime)}
\nWe see that the correct choice is $\\var{x0}$.
", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"cubic_coefficients": {"name": "cubic_coefficients", "group": "Ungrouped variables", "definition": "[-1/16,1/16,1/16,-1/16]", "description": "", "templateType": "anything", "can_override": false}, "quadratic_coefficients": {"name": "quadratic_coefficients", "group": "Ungrouped variables", "definition": "[1/2,-1/2,-1/4,1/4]", "description": "", "templateType": "anything", "can_override": false}, "linear_coefficients": {"name": "linear_coefficients", "group": "Ungrouped variables", "definition": "[-1/4,1/4,-3/4,3/4]", "description": "", "templateType": "anything", "can_override": false}, "constants": {"name": "constants", "group": "Ungrouped variables", "definition": "[-1,6,2,3]", "description": "", "templateType": "anything", "can_override": false}, "pick_curve": {"name": "pick_curve", "group": "Ungrouped variables", "definition": "random(0..3)", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "cubic_coefficients[pick_curve]", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "quadratic_coefficients[pick_curve]", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "linear_coefficients[pick_curve]", "description": "", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "constants[pick_curve]", "description": "", "templateType": "anything", "can_override": false}, "x0": {"name": "x0", "group": "Ungrouped variables", "definition": "switch(pick_curve<2,random(-2,0,2,6),random(-2,2,4,6))", "description": "", "templateType": "anything", "can_override": false}, "y0prime": {"name": "y0prime", "group": "Ungrouped variables", "definition": "rational(3*a*x0^2+2*b*x0+c)", "description": "", "templateType": "anything", "can_override": false}, "y0": {"name": "y0", "group": "Ungrouped variables", "definition": "rational(a*x0^3+b*x0^2+c*x0+d)", "description": "", "templateType": "anything", "can_override": false}, "ch": {"name": "ch", "group": "Ungrouped variables", "definition": "switch(pick_curve<2,[-3,-2,0,1,2,6],[-2,2,3,4,6,7])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["cubic_coefficients", "quadratic_coefficients", "linear_coefficients", "constants", "pick_curve", "a", "b", "c", "d", "x0", "y0", "y0prime", "ch"], "variable_groups": [], "functions": {"graph_cubic": {"parameters": [["a", "number"], ["b", "number"], ["c", "number"], ["d", "number"]], "type": "html", "language": "javascript", "definition": "// Max and min x and y values for the axis.\nvar x_min = -4;\nvar x_max = 8;\nvar y_min = -2;\nvar y_max = 7;\n\n\n// First, make the JSXGraph board.\nvar div = Numbas.extensions.jsxgraph.makeBoard(\n '300px',\n '300px',\n {\n boundingBox: [x_min,y_max,x_max,y_min],\n axis: false,\n showNavigation: false,\n grid: false,\n axis:false,\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 and y-axis\nvar xaxis = board.create('line',[[0,0],[1,0]], \n {strokeColor: 'black',\n lastarrow: true, \n name:'X', \n withLabel:true, \n label: {position: 'rt',offset: [0, 20]}, \n fixed: true});\nvar xticks = board.create('ticks',[xaxis,5],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 3\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], \n { strokeColor: 'black', \n name:'Y', \n withLabel:true, \n label: {position: 'rt',offset: [20, 0]},\n lastarrow: true, fixed: true });\nvar xticks = board.create('ticks',[yaxis,5],{\n drawLabels: true,\n label: {offset: [-25, 0]},\n minorTicks: 3\n});\n\n// create grid\ngrid = board.create('grid', []);\n\n// Plot the function.\n\n\n//Define function\nvar f = function(x) {\n return a*x*x*x+b*x*x+c*x+d;\n}\n\n\nboard.create('functiongraph', [f], {strokeWidth:3,strokeColor:'green'});\n\nreturn div;"}, "graph_cubic_and_lines": {"parameters": [["a", "number"], ["b", "number"], ["c", "number"], ["d", "number"], ["x0", "number"], ["y0", "number"], ["m", "number"]], "type": "html", "language": "javascript", "definition": "// Max and min x and y values for the axis.\nvar x_min = -4;\nvar x_max = 8;\nvar y_min = -2;\nvar y_max = 7;\n\n\n// First, make the JSXGraph board.\nvar div = Numbas.extensions.jsxgraph.makeBoard(\n '300px',\n '300px',\n {\n boundingBox: [x_min,y_max,x_max,y_min],\n axis: false,\n showNavigation: false,\n grid: false,\n axis:false,\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 and y-axis\nvar xaxis = board.create('line',[[0,0],[1,0]], \n {strokeColor: 'black',\n lastarrow: true, \n name:'X', \n withLabel:true, \n label: {position: 'rt',offset: [0, 20]}, \n fixed: true});\nvar xticks = board.create('ticks',[xaxis,5],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 3\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], \n { strokeColor: 'black', \n name:'Y', \n withLabel:true, \n label: {position: 'rt',offset: [20, 0]},\n lastarrow: true, fixed: true });\nvar xticks = board.create('ticks',[yaxis,5],{\n drawLabels: true,\n label: {offset: [-25, 0]},\n minorTicks: 3\n});\n\n// create grid\ngrid = board.create('grid', []);\n\n// Plot the function.\n\n\n//Define cubic function\nvar f = function(x) {\n return a*x*x*x+b*x*x+c*x+d;\n}\n\n//graph cubic function\nboard.create('functiongraph', [f], {strokeWidth:3,strokeColor:'green'});\n\n//Define linear functions\nvar g = function(x) {\n return m*x;\n} \nvar h = function(x) {\n return m*x+y0-m*x0;\n}\n\n//graph linear functions\nboard.create('functiongraph', [g], {strokeWidth:3,strokeColor:'blue'});\nboard.create('functiongraph', [h], {strokeWidth:3,strokeColor:'red'});\n\nreturn div;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "For $x=$[[0]] , $f'(x)=\\var{y0prime}$.
", "gaps": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "dropdownlist", "displayColumns": 0, "showCellAnswerState": true, "choices": ["{ch[0]}", "{ch[1]}", "{ch[2]}", "{ch[3]}", "{ch[4]}", "{ch[5]}"], "matrix": ["award(0.25,x0=ch[0])", "award(0.25,x0=ch[1])", "award(0.25,x0=ch[2])", "award(0.25,x0=ch[3])", "award(0.25,x0=ch[4])", "award(0.25,x0=ch[5])"], "distractors": ["", "", "", "", "", ""]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Eric Boeckx", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3901/"}, {"name": "Alexander Holvoet", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/19859/"}]}]}], "contributors": [{"name": "Eric Boeckx", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3901/"}, {"name": "Alexander Holvoet", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/19859/"}]}