// Numbas version: exam_results_page_options {"name": "Vicky's copy of Functions: Reading a graph of a function", "extensions": ["geogebra", "jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": "max(abs(y1),abs(y2))<10"}, "extensions": ["geogebra", "jsxgraph"], "advice": "

(i) To find $f(\\var{x1})$, you start at $\\var{x1}$ on the $x$-axis, go up or down until you reach the blue line, and then look at the $y$-coordinate. This $y$-coordinate is the answer.  In this question, after going up/down from $\\var{x1}$, we reach the $y$-coordinate $\\var{y1}$, so the answer is $f(\\var{x1})=\\var{y1}$.

\n

(ii) There are two options. The first option (which is not efficient) is trial-and-error: pick some random value of $x$ and determine $f(x)$. If $f(x) = \\var{y2}$, then your pick is the answer.  If not, then try a different value of $x$, hopefully getting closer and closer each time.   The second (and better) option is to 'work backwards' - we know what $f(x)$ should be, which means we know what the $y$-coordinate should be.  So start at $\\var{y2}$ on the $y$-axis, go left or right until you reach the blue line, and look at the $x$-coordinate. In this question, after going left/right from $\\var{y2}$, we reach the $x$-coordinate $\\var{x2}$, so this is the answer.  You can check this is correct: what is $f(\\var{x2})$? It is $\\var{y2}$, as we wanted!

", "tags": [], "variables": {"x2": {"description": "", "templateType": "anything", "name": "x2", "definition": "random(-1..1 except x1)", "group": "Ungrouped variables"}, "x1": {"description": "", "templateType": "anything", "name": "x1", "definition": "random(0..1)", "group": "Ungrouped variables"}, "vshift": {"description": "

Random amount of vertifical shift for sake of variability.

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

Coefficient of x^3

", "templateType": "anything", "name": "a", "definition": "random(-1..1 except 0)", "group": "Ungrouped variables"}, "y2": {"description": "", "templateType": "anything", "name": "y2", "definition": "a*((x2+hshift)^3+(x2+hshift)+vshift)", "group": "Ungrouped variables"}, "y1": {"description": "", "templateType": "anything", "name": "y1", "definition": "a*((x1+hshift)^3+(x1+hshift)+vshift)", "group": "Ungrouped variables"}, "hshift": {"description": "

Random amount of horizontal shift to create variability.

", "templateType": "anything", "name": "hshift", "definition": "random(-2..2)", "group": "Ungrouped variables"}}, "name": "Vicky's copy of Functions: Reading a graph of a function", "parts": [{"marks": 0, "customMarkingAlgorithm": "", "sortAnswers": false, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "unitTests": [], "gaps": [{"marks": "1", "customMarkingAlgorithm": "", "notationStyles": ["plain"], "mustBeReduced": false, "maxValue": "y1", "correctAnswerStyle": "plain", "minValue": "y1", "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "unitTests": [], "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "type": "numberentry", "allowFractions": false}, {"marks": 1, "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "maxValue": "x2", "correctAnswerStyle": "plain", "minValue": "x2", "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "unitTests": [], "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "type": "numberentry", "allowFractions": false}], "prompt": "

{eqnline(a, hshift, vshift)}

\n

Above is the graph of some function $f$.

\n

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

\n

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

", "showCorrectAnswer": true, "scripts": {}, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "type": "gapfill"}], "statement": "

Reading a graph.

", "preamble": {"js": "", "css": ""}, "rulesets": {}, "metadata": {"description": "

A graph of an (invertible) cubic is given. The question is to determine values of $f$. Non-calculator. Advice is provided.

", "licence": "Creative Commons Attribution 4.0 International"}, "functions": {"eqnline": {"language": "javascript", "parameters": [["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 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;"}}, "ungrouped_variables": ["a", "hshift", "vshift", "x1", "x2", "y1", "y2"], "type": "question", "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"name": "Vicky Mason", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2687/"}]}]}], "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"name": "Vicky Mason", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2687/"}]}