// Numbas version: exam_results_page_options {"name": "Patrick's copy of Lovkush's copy of Matching graphs with their equation.", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variablesTest": {"maxRuns": 100, "condition": ""}, "statement": "

Match the graphs with their equations.

", "ungrouped_variables": ["b1", "b2", "c1", "c2", "d1", "d2", "d3", "e2", "e3"], "tags": [], "preamble": {"js": "", "css": ""}, "functions": {"plotgraph": {"definition": "// This functions plots a graph. The variable q selects which graph will be chosen.\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 xmin = -7;\nvar xmax = 7;\nvar ymin = -9;\nvar ymax = 9;\n\n// First, make the JSXGraph board.\nvar div = Numbas.extensions.jsxgraph.makeBoard(\n '500px',\n '600px',\n {\n boundingBox: [xmin,ymax,xmax,ymin],\n axis: false,\n showNavigation: false,\n grid: true\n }\n);\n\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar brd = div.board; \n\n// create the x-axis.\nvar xaxis = brd.create('axis',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\n\n\n// create the y-axis\nvar yaxis = brd.create('axis',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\n\n\n\n\n\n\n//Define functions depending on value of q.\nswitch(q) {\n case 1:\n var f1 = function(x) {return Math.pow(2.71,x); }\n var f2 = function(x) {return x*x;}\n var f3 = function(x) {return x*x*x;}\n break;\n \n case 2:\n var f1 = function(x) {return Math.log(x); }\n var f2 = function(x) {return Math.log(x+b);}\n var f3 = function(x) {return Math.log(x+c);}\n break;\n \n case 3:\n var f1 = function(x) {return 1/x;}\n var f2 = function(x) {return 1/x + b;}\n var f3 = function(x) {return 1/(x-c) -1;}\n break;\n \n case 4:\n var f1 = function(x) {return Math.sin(x)+a;}\n var f2 = function(x) {return b*Math.sin(x);}\n var f3 = function(x) {return c*Math.sin(x) + 2;}\n break;\n \n case 5:\n var f1 = function(x) {return Math.pow(2.71,x)*-1;}\n var f2 = function(x) {return Math.pow(2.71,x) - b;}\n var f3 = function(x) {return Math.pow(2.71,(x-c));}\n break;\n}\n\n brd.create('functiongraph', [f1], {strokeWidth:3,strokeColor:'red'});\n brd.create('functiongraph', [f2], {strokeWidth:3,strokeColor: 'green'});\n brd.create('functiongraph', [f3], {strokeWidth:3,strokeColor: 'blue'});\n\nreturn div;", "type": "html", "language": "javascript", "parameters": [["q", "number"], ["a", "number"], ["b", "number"], ["c", "number"]]}}, "extensions": ["jsxgraph"], "name": "Patrick's copy of Lovkush's copy of Matching graphs with their equation.", "advice": "

Remember that if you cannot think of anything else, just try plugging in values of $x$ into the equation, and seeing which coordinates you end up with. This always works, but it is usually quicker if you know the standard patterns.

\n

\n

a) See lecture notes and/or panapto video for Lecture 21.2 for the standard shapes of quadratics, cubics, exponentials and $\\ln$ graphs.

\n

\n

b) See lecture notes and/or panapto video for Lecture 21.2 for examples of $\\ln$ graphs. Alternatively, see Lecture 21.3 for horizontal translations.

\n

\n

c) See lecture notes and/or panapto video for Lecture 21.2 for variations of $\\frac{1}{x}$ graphs.  Alternatively, see Lecture 21.3 for horizontal and vertical translations.

\n

\n

d) This involves vertical stretching and vertical translations, so see Lecture 21.3.

\n

\n

e) This involves a mixture of transformations, so see Lecture 21.3.

\n

\n

Again, remember that plugging in $x$-value into the equations is always something you should try doing if all else fails.

\n

", "parts": [{"displayType": "checkbox", "layout": {"expression": "", "type": "all"}, "minMarks": 0, "prompt": "

{plotgraph(1,0,0,0)}

\n

", "warningType": "none", "type": "m_n_x", "showCorrectAnswer": true, "showFeedbackIcon": true, "minAnswers": 0, "shuffleChoices": true, "scripts": {}, "maxAnswers": 0, "shuffleAnswers": false, "answers": ["

Red

", "

Green

", "

Blue

"], "choices": ["

$y=e^x$

", "

$y=x^2$

", "

$y=x^3$

", "

$y=\\ln(x)$

"], "variableReplacements": [], "matrix": [["1/3", "-1/3", "-1/3"], ["-1/3", "1/3", "-1/3"], ["-1/3", "-1/3", "1/3"], ["-1/3", "-1/3", "-1/3"]], "maxMarks": "1", "marks": 0, "variableReplacementStrategy": "originalfirst"}, {"displayType": "checkbox", "layout": {"expression": "", "type": "all"}, "minMarks": 0, "prompt": "

{plotgraph(4,d1,d2,d3)}

\n

", "warningType": "none", "type": "m_n_x", "showCorrectAnswer": true, "showFeedbackIcon": true, "minAnswers": 0, "shuffleChoices": true, "scripts": {}, "maxAnswers": 0, "shuffleAnswers": false, "answers": ["

Red

", "

Green

", "

Blue

"], "choices": ["

$y=\\sin(x)+\\var{d1}$

", "

$y=\\var{d2}\\sin(x)$

", "

$y=\\var{d3}\\sin(x) + 2$

", "

$y = \\sin(x) + \\var{d1+1}$

", "

$y=\\var{d3+1}\\sin(x)+1$

"], "variableReplacements": [], "matrix": [["1/3", "-1/3", "-1/3"], ["-1/3", "1/3", "-1/3"], ["-1/3", "-1/3", "1/3"], ["-1/3", "-1/3", "-1/3"], ["-1/3", "-1/3", "-1/3"]], "maxMarks": "1", "marks": 0, "variableReplacementStrategy": "originalfirst"}], "rulesets": {}, "variables": {"c2": {"name": "c2", "group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(1..3)"}, "c1": {"name": "c1", "group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(2..4)"}, "e2": {"name": "e2", "group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(2..3)"}, "d1": {"name": "d1", "group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(4..6)"}, "b1": {"name": "b1", "group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(2..3)"}, "d2": {"name": "d2", "group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "d1+1"}, "b2": {"name": "b2", "group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(-1,1)-b1"}, "d3": {"name": "d3", "group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(2..3)"}, "e3": {"name": "e3", "group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(3..5)"}}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Graphs are given and students are required to match them with their equation.

"}, "variable_groups": [], "type": "question", "contributors": [{"name": "Patrick Joyce", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1674/"}]}]}], "contributors": [{"name": "Patrick Joyce", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1674/"}]}