// Numbas version: finer_feedback_settings {"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": [{"metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "
Graphs are given and students are required to match them with their equation.
"}, "extensions": ["jsxgraph"], "tags": [], "rulesets": {}, "variable_groups": [], "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\na) See lecture notes and/or panapto video for Lecture 21.2 for the standard shapes of quadratics, cubics, exponentials and $\\ln$ graphs.
\n\nb) 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\nc) 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\nd) This involves vertical stretching and vertical translations, so see Lecture 21.3.
\n\ne) This involves a mixture of transformations, so see Lecture 21.3.
\n\nAgain, remember that plugging in $x$-value into the equations is always something you should try doing if all else fails.
\n", "variablesTest": {"condition": "", "maxRuns": 100}, "functions": {"plotgraph": {"parameters": [["q", "number"], ["a", "number"], ["b", "number"], ["c", "number"]], "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;", "language": "javascript", "type": "html"}}, "statement": "Match the graphs with their equations.
", "ungrouped_variables": ["b1", "b2", "c1", "c2", "d1", "d2", "d3", "e2", "e3"], "variables": {"d1": {"description": "", "name": "d1", "group": "Ungrouped variables", "definition": "random(4..6)", "templateType": "anything"}, "d3": {"description": "", "name": "d3", "group": "Ungrouped variables", "definition": "random(2..3)", "templateType": "anything"}, "b1": {"description": "", "name": "b1", "group": "Ungrouped variables", "definition": "random(2..3)", "templateType": "anything"}, "c2": {"description": "", "name": "c2", "group": "Ungrouped variables", "definition": "random(1..3)", "templateType": "anything"}, "c1": {"description": "", "name": "c1", "group": "Ungrouped variables", "definition": "random(2..4)", "templateType": "anything"}, "e3": {"description": "", "name": "e3", "group": "Ungrouped variables", "definition": "random(3..5)", "templateType": "anything"}, "d2": {"description": "", "name": "d2", "group": "Ungrouped variables", "definition": "d1+1", "templateType": "anything"}, "b2": {"description": "", "name": "b2", "group": "Ungrouped variables", "definition": "random(-1,1)-b1", "templateType": "anything"}, "e2": {"description": "", "name": "e2", "group": "Ungrouped variables", "definition": "random(2..3)", "templateType": "anything"}}, "preamble": {"js": "", "css": ""}, "parts": [{"showCorrectAnswer": true, "maxMarks": "1", "minAnswers": 0, "type": "m_n_x", "maxAnswers": 0, "variableReplacements": [], "answers": ["Red
", "Green
", "Blue
"], "scripts": {}, "displayType": "checkbox", "prompt": "{plotgraph(1,0,0,0)}
\n", "variableReplacementStrategy": "originalfirst", "choices": ["$y=e^x$
", "$y=x^2$
", "$y=x^3$
", "$y=\\ln(x)$
"], "minMarks": 0, "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"]], "marks": 0, "layout": {"type": "all", "expression": ""}, "shuffleAnswers": false, "shuffleChoices": true, "showFeedbackIcon": true, "warningType": "none"}, {"showCorrectAnswer": true, "maxMarks": "1", "minAnswers": 0, "type": "m_n_x", "maxAnswers": 0, "variableReplacements": [], "answers": ["Red
", "Green
", "Blue
"], "scripts": {}, "displayType": "checkbox", "prompt": "{plotgraph(4,d1,d2,d3)}
\n", "variableReplacementStrategy": "originalfirst", "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$
"], "minMarks": 0, "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"]], "marks": 0, "layout": {"type": "all", "expression": ""}, "shuffleAnswers": false, "shuffleChoices": true, "showFeedbackIcon": true, "warningType": "none"}], "name": "Patrick's copy of Lovkush's copy of Matching graphs with their equation.", "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/"}]}