// Numbas version: exam_results_page_options {"name": "Laure's copy of 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, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "preamble": {"css": "", "js": ""}, "name": "Laure's copy of Thanom's copy of Quadratics: Determine the equation of a parabola, completed square form", "statement": "

Give the equation of a parabola in completed square form.

", "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": {"r1": {"definition": "random(-5..-5)", "templateType": "anything", "name": "r1", "group": "Ungrouped variables", "description": ""}, "a": {"definition": "random(-3..3 except 0)", "templateType": "anything", "name": "a", "group": "Ungrouped variables", "description": ""}, "r2": {"definition": "random(-5..5)", "templateType": "anything", "name": "r2", "group": "Ungrouped variables", "description": ""}}, "extensions": ["geogebra", "jsxgraph"], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

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

"}, "functions": {"plotgraph": {"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;", "language": "javascript", "type": "html", "parameters": [["r1", "number"], ["r2", "number"], ["a", "number"]]}}, "variablesTest": {"condition": "r1<>r2", "maxRuns": 100}, "ungrouped_variables": ["r1", "r2", "a"], "parts": [{"sortAnswers": false, "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "prompt": "

{plotgraph(r1,r2,a)}

\n

Write the equation of the quadratic function.

\n

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

", "type": "gapfill", "showCorrectAnswer": true, "gaps": [{"showPreview": true, "marks": "4", "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "failureRate": 1, "vsetRange": [0, 1], "showCorrectAnswer": true, "answerSimplification": "all", "type": "jme", "checkVariableNames": false, "expectedVariableNames": [], "answer": "{a}(x-{r1})(x-{r2})", "variableReplacements": [], "checkingType": "absdiff", "unitTests": [], "vsetRangePoints": 5, "checkingAccuracy": 0.001, "scripts": {}, "showFeedbackIcon": true}], "marks": 0, "variableReplacements": [], "unitTests": [], "scripts": {}, "showFeedbackIcon": true}], "tags": [], "variable_groups": [], "type": "question", "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"name": "Laure Helme-Guizon", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2531/"}, {"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": "Laure Helme-Guizon", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2531/"}, {"name": "Thanom Shaw", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2564/"}]}