// Numbas version: exam_results_page_options {"name": "Find all real roots of a quadratic equation", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Find all real roots of a quadratic equation", "tags": [], "metadata": {"description": "

A simple question to find the roots of a quadratic. Using to test integration of NUmbas into Canvas.

", "licence": "All rights reserved"}, "statement": "

Find one of the real roots of the quadratic \\[P(x)=\\simplify{x^2-2*{Integer}x+{integer}^2-{discriminant}}\\]

\n

\n
", "advice": "

To find the roots, we use the quadratic equation, which says that if the roots of the quadratic $ax^2+bx+c$ are $x_{+,-}$, then these roots are given by \\[x_{+,-}=\\frac{-b\\pm\\sqrt{b^2-4ac}}{2a}\\].

\n

In this case, we have $a=1$, $b=\\var{-2*Integer}$, and $c=\\var{Integer^2-Discriminant}$. So therefore:

\n

\\[x_{+,-}=\\frac{-b\\pm\\sqrt{b^2-4ac}}{2a}=\\frac{\\var{2*Integer}\\pm\\sqrt{(\\var{-2*Integer})^2-4(1)(\\var{Integer^2-Discriminant})}}{2(1)}\\]

\n

\\[=\\frac{\\var{2*Integer}\\pm\\sqrt{\\var{(-2*Integer)^2}-(\\var{(2*Integer)^2-4*Discriminant})}}{2(1)}=\\frac{\\var{2*Integer}\\pm\\sqrt{\\var{(2*Integer)^2-4*(Integer^2-Discriminant)}}}{2}=\\var{Integer}\\pm\\sqrt{\\var{Discriminant}}\\]

\n

So we have $x_{+}=\\var{Integer}+\\sqrt{\\var{Discriminant}}$, and $x_-=\\var{Integer}-\\sqrt{\\var{Discriminant}}$

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"Discriminant": {"name": "Discriminant", "group": "Ungrouped variables", "definition": "random(1 .. 18#1)", "description": "", "templateType": "randrange", "can_override": false}, "Integer": {"name": "Integer", "group": "Ungrouped variables", "definition": "random(-8..8 except 0)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["Discriminant", "Integer"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write down one of the roots, in surd notation, using the quadratic formula.

\n

If you need to use a square root, you type sqrt(), and put the quantity you are taking a square root of in the brackets. So sqrt(7) will give you $\\sqrt{7}$.

\n

", "alternatives": [{"type": "jme", "useCustomName": true, "customName": "Negative Root", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": false, "answer": "{integer}-sqrt({discriminant})", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": true, "valuegenerators": []}], "answer": "{integer}+sqrt({discriminant})", "answerSimplification": "all", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Conor Meade", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14066/"}]}]}], "contributors": [{"name": "Conor Meade", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14066/"}]}