// Numbas version: exam_results_page_options {"name": "Quadratic graph - student finds equation", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variables": {"b": {"templateType": "anything", "name": "b", "description": "", "definition": "random(-5..5 except [0,a,-a])", "group": "Ungrouped variables"}, "c": {"templateType": "anything", "name": "c", "description": "", "definition": "a*b", "group": "Ungrouped variables"}, "a": {"templateType": "anything", "name": "a", "description": "", "definition": "random(-4..4 except 0)", "group": "Ungrouped variables"}, "y2": {"templateType": "anything", "name": "y2", "description": "", "definition": "x2*a+b", "group": "Ungrouped variables"}, "x2": {"templateType": "anything", "name": "x2", "description": "", "definition": "random(-3..3 except -1..1)", "group": "Ungrouped variables"}}, "statement": "

{eqnline(a,b,x2,y2)}

\n

The above graph shows a graph of a quadratic equation, it is your task to find this equation.

\n

You are given the two points of the curve with the x axis, $(\\var{b},0)$ and $(\\var{a},0)$, and the $y$-intercept at $(0,\\var{c})$ as indicated on the diagram.

", "name": "Quadratic graph - student finds equation", "parts": [{"marks": 0, "customMarkingAlgorithm": "", "scripts": {}, "extendBaseMarkingAlgorithm": true, "customName": "", "sortAnswers": false, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill", "prompt": "

Write the equation of the line in the diagram.

\n

$y=\\;$[[0]]

", "gaps": [{"vsetRangePoints": 5, "customMarkingAlgorithm": "", "showPreview": true, "extendBaseMarkingAlgorithm": true, "customName": "", "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "checkingAccuracy": 0.001, "valuegenerators": [{"name": "x", "value": ""}], "showFeedbackIcon": true, "marks": 1, "checkVariableNames": false, "answerSimplification": "all", "vsetRange": [0, 1], "failureRate": 1, "answer": "x^2-({a}+{b})x+{a}{b}", "showCorrectAnswer": true, "scripts": {}, "type": "jme", "unitTests": [], "useCustomName": false, "variableReplacements": []}], "unitTests": [], "useCustomName": false, "variableReplacements": []}, {"marks": 0, "customMarkingAlgorithm": "", "scripts": {}, "extendBaseMarkingAlgorithm": true, "customName": "", "sortAnswers": false, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill", "prompt": "

Find the coordinates of the turning point of this quadratic

\n

$x=$[[0]]

\n

$y=$[[1]]

", "gaps": [{"marks": 1, "vsetRangePoints": 5, "customMarkingAlgorithm": "", "checkingAccuracy": 0.001, "scripts": {}, "extendBaseMarkingAlgorithm": true, "customName": "", "showPreview": true, "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "answer": "({a}+{b})/2", "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "jme", "failureRate": 1, "valuegenerators": [], "vsetRange": [0, 1], "unitTests": [], "useCustomName": false, "checkVariableNames": false, "variableReplacements": []}, {"marks": 1, "vsetRangePoints": 5, "customMarkingAlgorithm": "", "checkingAccuracy": 0.001, "scripts": {}, "extendBaseMarkingAlgorithm": true, "customName": "", "showPreview": true, "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "answer": "(-{b}^2-{a}^2+2{a}{b})/4", "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "jme", "failureRate": 1, "valuegenerators": [], "vsetRange": [0, 1], "unitTests": [], "useCustomName": false, "checkVariableNames": false, "variableReplacements": []}], "unitTests": [], "useCustomName": false, "variableReplacements": []}], "functions": {"eqnline": {"language": "javascript", "parameters": [["a", "number"], ["b", "number"], ["x2", "number"], ["y2", "number"]], "type": "html", "definition": "// This function creates the board and sets it up, then returns an\n// HTML div tag containing the board.\n \n// The line is described by the equation \n// y = a*x + b\n\n// This function takes as its parameters the coefficients a and b,\n// and the coordinates (x2,y2) of a point on the line.\n\n// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n{boundingBox: [-13,22,13,-22],\n axis: false,\n showNavigation: false,\n grid: true\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,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// mark the two given points - one on the y-axis, and one at (x2,y2)\n\n\n\n\nboard.create('functiongraph',[function(x){ return (x-a)*(x-b);},-13,13]);\n\nreturn div;"}}, "rulesets": {}, "variable_groups": [], "preamble": {"css": "", "js": ""}, "tags": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "extensions": ["jsxgraph"], "ungrouped_variables": ["a", "x2", "b", "y2", "c"], "advice": "

We know that the graph crosses the $x$-axis at both $(\\var{a},0)$ and $(\\var{b},0)$. Since this is a quadratic, we know our equations has two roots, and by the previous observation, they are at $\\var{a}$ and $\\var{b}$. Hence we can write our equation as $\\simplify{y=(x-{a})(x-{b})}$ which simplifies to $\\simplify{y=x^2-({a}+{b})x+({a}*{b})}$.

\n

\n

To find the coefficients of the turning point of the quadratic, we know the x-coordinate of the turning point will correspond to the solution to $dy/dx=0$. So we get $\\simplify{2x-({a}+{b})}=0$ hence $\\simplify{x=({a}+{b})/2}$. We substitute this value of x back into the equation of the quadratic to find the corresponding y-coordinate.

", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Students enter equation and turning point

"}, "contributors": [{"name": "joshua boddy", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/557/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "joshua boddy", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/557/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}