// Numbas version: exam_results_page_options {"name": "Straight lines: given the graph find the equation", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/exampleline.png", "/srv/numbas/media/question-resources/exampleline.png"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"variableReplacementStrategy": "originalfirst", "steps": [{"variableReplacementStrategy": "originalfirst", "prompt": "

Read the $y$-intercept off the graph (this is denoted $b$), find a 'nice point' with whole number coordinates, use this to determine the gradient (this is denoted $m$). Express as $y=mx+b$.

\n

Recall the gradient is $\\frac{\\text{rise}}{\\text{run}}$, determine the rise and run by looking at getting from the $y$-intercept to the next nice (whole number) point.

\n

\n
\n

\n

For example, suppose we had the following graph

\n


\n

We see that the $y$-intercept is $-3$, that is $b=-3$. We can find a 'nice point' with whole number coordinates at the point $(-2,2)$. To get from the $y$-intercept to this point requires we rise up 1 unit and run across 2 units. So our gradient is $\\frac{1}{2}$, that is $m=\\frac{1}{2}$. We now can write our equation, $y=\\frac{1}{2}x-3$.

\n

Note we could have chosen other points to be our 'nice point', for example $(-1,4)$ or $(6,0)$.

\n

\n

", "variableReplacements": [], "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "type": "information", "marks": 0}], "variableReplacements": [], "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "prompt": "

The gradient intercept form of the line shown below is $y=$ [[0]].

\n

{linea()}

", "stepsPenalty": "1", "marks": 0, "type": "gapfill", "gaps": [{"variableReplacementStrategy": "originalfirst", "vsetrange": [0, 1], "showFeedbackIcon": true, "showpreview": true, "notallowed": {"showStrings": false, "partialCredit": 0, "strings": ["="], "message": ""}, "marks": "2", "checkvariablenames": true, "checkingaccuracy": 0.001, "vsetrangepoints": 5, "checkingtype": "absdiff", "answersimplification": "all", "variableReplacements": [], "answer": "{rise}/{run}*x+{b}", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "expectedvariablenames": ["x"]}]}, {"variableReplacementStrategy": "originalfirst", "steps": [{"variableReplacementStrategy": "originalfirst", "prompt": "

Read the $y$-intercept off the graph (this is denoted $b$), find a 'nice point' with whole number coordinates, use this to determine the gradient (this is denoted $m$). Express as $y=mx+b$.

\n

Recall the gradient is $\\frac{\\text{rise}}{\\text{run}}$, determine the rise and run by looking at getting from the $y$-intercept to the next nice (whole number) point.

\n

\n
\n

\n

For example, suppose we had the following graph

\n


\n

We see that the $y$-intercept is $-3$, that is $b=-3$. We can find a 'nice point' with whole number coordinates at the point $(-2,2)$. To get from the $y$-intercept to this point requires we rise up 1 unit and run across 2 units. So our gradient is $\\frac{1}{2}$, that is $m=\\frac{1}{2}$. We now can write our equation, $y=\\frac{1}{2}x-3$.

\n

Note we could have chosen other points to be our 'nice point', for example $(-1,4)$ or $(6,0)$.

\n

\n

", "variableReplacements": [], "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "type": "information", "marks": 0}], "variableReplacements": [], "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "prompt": "

The gradient intercept form of the line shown below is $y=$ [[0]].

\n

{lineb()}

", "stepsPenalty": "1", "marks": 0, "type": "gapfill", "gaps": [{"variableReplacementStrategy": "originalfirst", "vsetrange": [0, 1], "showFeedbackIcon": true, "showpreview": true, "notallowed": {"showStrings": false, "partialCredit": 0, "strings": ["="], "message": ""}, "marks": "2", "checkvariablenames": true, "checkingaccuracy": 0.001, "vsetrangepoints": 5, "checkingtype": "absdiff", "answersimplification": "all", "variableReplacements": [], "answer": "{brise}/{brun}*x+{bb}", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "expectedvariablenames": ["x"]}]}], "variables": {"rise": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "if(run=2,random(1,3,5,7),if(run=3,random(1,2,4,5,7),if(run=5,random(1,2,3,4,6,7),if(run=7,random(1,2,3,4,5,6)))))", "name": "rise"}, "bb": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(-5..12 except 0)", "name": "bb"}, "bpoint_x": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "brun", "name": "bpoint_x"}, "run": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(2,3,5,7)", "name": "run"}, "brun": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(2,3,5,7)", "name": "brun"}, "point_y": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "b+rise", "name": "point_y"}, "brise": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "-if(brun=2,random(1,3,5,7),if(brun=3,random(1,2,4,5,7),if(brun=5,random(1,2,3,4,6,7),if(brun=7,random(1,2,3,4,5,6)))))", "name": "brise"}, "point_x": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "run", "name": "point_x"}, "b": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(-12..5 except 0)", "name": "b"}, "bpoint_y": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "bb+brise", "name": "bpoint_y"}}, "rulesets": {}, "preamble": {"css": "", "js": ""}, "variable_groups": [], "name": "Straight lines: given the graph find the equation", "variablesTest": {"condition": "", "maxRuns": 100}, "functions": {"lineb": {"parameters": [], "type": "html", "definition": "\nvar div = Numbas.extensions.jsxgraph.makeBoard('600px','600px',{boundingBox:[-13,13,13,-13],grid:true,axis:false});\nvar board = div.board;\n\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,2],{\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,2],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n});\n\n\nx0 = 0;\ny0 = Numbas.jme.unwrapValue(scope.variables.bb);\nx1 = Numbas.jme.unwrapValue(scope.variables.bpoint_x);\ny1 = Numbas.jme.unwrapValue(scope.variables.bpoint_y);\n\n//board.create('point',[x0,y0],{fixed:true});\n//board.create('point',[x1,y1],{fixed:true});\nboard.create('line',[[x0,y0],[x1,y1]],{strokeColor:'#00ff00',strokeWidth:2,fixed:true});\n\n\n\nreturn div;", "language": "javascript"}, "linea": {"parameters": [], "type": "html", "definition": "\nvar div = Numbas.extensions.jsxgraph.makeBoard('600px','600px',{boundingBox:[-13,13,13,-13],grid:true,axis:false});\nvar board = div.board;\n\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,2],{\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,2],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n});\n\n\nx0 = 0;\ny0 = Numbas.jme.unwrapValue(scope.variables.b);\nx1 = Numbas.jme.unwrapValue(scope.variables.point_x);\ny1 = Numbas.jme.unwrapValue(scope.variables.point_y);\n\n//board.create('point',[x0,y0],{fixed:true});\n//board.create('point',[x1,y1],{fixed:true});\nboard.create('line',[[x0,y0],[x1,y1]],{strokeColor:'#00ff00',strokeWidth:2,fixed:true});\n\n\n\nreturn div;", "language": "javascript"}}, "ungrouped_variables": ["b", "run", "rise", "point_y", "point_x", "bb", "brun", "brise", "bpoint_y", "bpoint_x"], "statement": "", "tags": ["graph", "Jsxgraph", "jsxgraph", "JSXgraph", "linear", "linear equation", "Straight Line", "straight line", "y=mx+b"], "metadata": {"description": "

Given the graph of the line determine the equation of the line.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "advice": "", "extensions": ["jsxgraph"], "type": "question", "contributors": [{"name": "Mark Hodds", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/510/"}]}]}], "contributors": [{"name": "Mark Hodds", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/510/"}]}