// Numbas version: exam_results_page_options {"name": "Thanom's copy of Quadratics: Determine the equation of a parabola, completed square form", "extensions": ["geogebra", "jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"ungrouped_variables": ["r1", "r2", "a"], "preamble": {"css": "", "js": ""}, "variablesTest": {"maxRuns": 100, "condition": "r1<>r2"}, "tags": [], "extensions": ["geogebra", "jsxgraph"], "statement": "

Give the equation of a parabola in completed square form.

", "variable_groups": [], "parts": [{"customMarkingAlgorithm": "", "sortAnswers": false, "marks": 0, "type": "gapfill", "showFeedbackIcon": true, "unitTests": [], "scripts": {}, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "prompt": "

{plotgraph(r1,r2,a)}

\n

Write the equation of the quadratic function.

\n

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

", "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "gaps": [{"vsetRangePoints": 5, "vsetRange": [0, 1], "answerSimplification": "all", "failureRate": 1, "answer": "{a}(x-{r1})(x-{r2})", "checkingType": "absdiff", "customMarkingAlgorithm": "", "checkVariableNames": false, "marks": "4", "type": "jme", "showFeedbackIcon": true, "unitTests": [], "expectedVariableNames": [], "scripts": {}, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "checkingAccuracy": 0.001, "extendBaseMarkingAlgorithm": true, "showPreview": true}]}], "name": "Thanom's copy of Quadratics: Determine the equation of a parabola, completed square form", "metadata": {"description": "

A parabolic graph is given. The question is to determine the equation of the graph. Non-calculator. Advice is given.

", "licence": "Creative Commons Attribution 4.0 International"}, "functions": {"plotgraph": {"language": "javascript", "definition": "// This functions plots a graph of y = a(x-r1)^2+r2\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 = -8;\nvar x_max = 8;\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\nboard.create('functiongraph',\n [function(x){ return a*(x-r1)^2+r2;},x_min,x_max]);\n\n\n\nreturn div;", "type": "html", "parameters": [["r1", "number"], ["r2", "number"], ["a", "number"]]}}, "advice": "

The vertex of the parabola is at $(\\var{r1},\\var{r2})$. Therefore, the quadratic can be written as $a(x-\\var{r1})^2+\\var{r2}$, but we still need to determine $a$.

\n

If you know a point which lies on the parabola (which is not $(\\var{r1},\\var{r2})$), by substituting these values into the equation, you can solve for $a$.

\n

Here's an example:

\n

Imagine after the first step you reached $y = a(x-3)^2+5$. By looking at the graph we saw that $f(4) = 12$.  Substituting into our equation we get:

\n

$12 = f(4) = a(4-3)^2+5 = a \\cdot 1 + 6$, so $a = 7$.

\n

Then the final answer in this example would be $f(x) = 7(x-3)^2+5$.  (Depending on the wording of the question, you may have to expand the brackets too.  In this example, expanding the brackets gives $f(x) = 7x^2-42x+68$.)

", "variables": {"r2": {"definition": "random(-5..5)", "name": "r2", "templateType": "anything", "group": "Ungrouped variables", "description": ""}, "a": {"definition": "random(-3..3 except 0)", "name": "a", "templateType": "anything", "group": "Ungrouped variables", "description": ""}, "r1": {"definition": "random(-5..5)", "name": "r1", "templateType": "anything", "group": "Ungrouped variables", "description": ""}}, "rulesets": {}, "type": "question", "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"name": "Thanom Shaw", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2564/"}]}]}], "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"name": "Thanom Shaw", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2564/"}]}