// Numbas version: exam_results_page_options {"name": "Algebra: functions, determining function values from graph", "extensions": ["geogebra", "jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Algebra: functions, determining function values from graph", "tags": [], "metadata": {"description": "

A graph of an (invertible) cubic is given. The question is to determine values of \$f\$ from graph.

See ??

", "rulesets": {}, "extensions": ["geogebra", "jsxgraph"], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-1..1 except 0)", "description": "

Coefficient of x^3

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

Random amount of vertifical shift for sake of variability.

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

Random amount of horizontal shift to create variability.

", "templateType": "anything"}, "x": {"name": "x", "group": "Ungrouped variables", "definition": "shuffle(map(j-hshift,j,-2..2))", "description": "", "templateType": "anything"}, "y": {"name": "y", "group": "Ungrouped variables", "definition": "map(a*((x[j]+hshift)^3+(x[j]+hshift)+vshift),j,0..3)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "hshift", "vshift", "x", "y"], "variable_groups": [], "functions": {"eqnline": {"parameters": [["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 = -13;\nvar y_max = 13;\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 board.create('functiongraph',\n [function(x){ return a*(Math.pow(x+h,3)+(x+h)+v);},x_min,x_max]);\n\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": "

{eqnline(a, hshift, vshift)}

\n

Above is the graph of some function \$f\$.

\n

What is \$f(\\var{x[0]})\$? [[0]]

\n

What is \$f(\\var{x[1]})\$? [[1]]

\n

\n

\n

What value of \$x\$ do you need to get \$f(x) = \\var{y[2]}\$?

\n

\$x=\$ [[2]]

\n

\n

\n

Solve the equation \$f(x) = \\var{y[3]}\$.

\n

\$x=\$ [[3]]