// Numbas version: exam_results_page_options {"name": "Intersection: linear and quadratic, two points", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"advice": "", "name": "Intersection: linear and quadratic, two points", "extensions": [], "statement": "", "preamble": {"js": "", "css": ""}, "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"ansy2": {"definition": "grad*root2+yint", "group": "Ungrouped variables", "description": "", "name": "ansy2", "templateType": "anything"}, "quadccoeff": {"definition": "proots+yint", "group": "Ungrouped variables", "description": "", "name": "quadccoeff", "templateType": "anything"}, "proots": {"definition": "root1*root2", "group": "Ungrouped variables", "description": "", "name": "proots", "templateType": "anything"}, "sroots": {"definition": "-root1-root2", "group": "Ungrouped variables", "description": "", "name": "sroots", "templateType": "anything"}, "root1": {"definition": "roots[0]", "group": "Ungrouped variables", "description": "", "name": "root1", "templateType": "anything"}, "root2": {"definition": "roots[1]", "group": "Ungrouped variables", "description": "", "name": "root2", "templateType": "anything"}, "ansy1": {"definition": "grad*root1+yint", "group": "Ungrouped variables", "description": "", "name": "ansy1", "templateType": "anything"}, "roots": {"definition": "sort(shuffle(-12..12)[0..2])", "group": "Ungrouped variables", "description": "", "name": "roots", "templateType": "anything"}, "grad": {"definition": "random(-6..6 except 0)", "group": "Ungrouped variables", "description": "", "name": "grad", "templateType": "anything"}, "yint": {"definition": "random(-6..6 except 0)", "group": "Ungrouped variables", "description": "", "name": "yint", "templateType": "anything"}, "quadxcoeff": {"definition": "sroots+grad", "group": "Ungrouped variables", "description": "", "name": "quadxcoeff", "templateType": "anything"}}, "ungrouped_variables": ["roots", "root1", "root2", "grad", "sroots", "proots", "yint", "quadxcoeff", "quadccoeff", "ansy1", "ansy2"], "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": ""}, "functions": {}, "rulesets": {}, "parts": [{"extendBaseMarkingAlgorithm": true, "prompt": "

Find the $x$ and $y$ values that satisfy both of the following equations. That is, find the points of intersection of the two curves.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$y$$=$$\\simplify{{grad}x+{yint}}$               $(1)$
$y$$=$$\\simplify{x^2+{quadxcoeff}x+{quadccoeff}}$               $(2)$
\n

$x_1=$ [[0]],   $y_1=$ [[1]] and $x_2=$ [[2]], $y_2=$ [[3]]

\n

Note: To input your answer please ensure that $x_1<x_2$.

\n

", "showCorrectAnswer": true, "customMarkingAlgorithm": "", "gaps": [{"extendBaseMarkingAlgorithm": true, "unitTests": [], "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "minValue": "root1", "showCorrectAnswer": true, "correctAnswerStyle": "plain", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "marks": 1, "maxValue": "root1", "type": "numberentry", "scripts": {}, "showFeedbackIcon": true, "mustBeReduced": false, "correctAnswerFraction": false, "allowFractions": true, "variableReplacements": []}, {"extendBaseMarkingAlgorithm": true, "unitTests": [], "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "minValue": "ansy1", "showCorrectAnswer": true, "correctAnswerStyle": "plain", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "marks": 1, "maxValue": "ansy1", "type": "numberentry", "scripts": {}, "showFeedbackIcon": true, "mustBeReduced": false, "correctAnswerFraction": true, "allowFractions": true, "variableReplacements": []}, {"extendBaseMarkingAlgorithm": true, "unitTests": [], "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "minValue": "root2", "showCorrectAnswer": true, "correctAnswerStyle": "plain", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "marks": 1, "maxValue": "root2", "type": "numberentry", "scripts": {}, "showFeedbackIcon": true, "mustBeReduced": false, "correctAnswerFraction": false, "allowFractions": true, "variableReplacements": []}, {"extendBaseMarkingAlgorithm": true, "unitTests": [], "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "minValue": "ansy2", "showCorrectAnswer": true, "correctAnswerStyle": "plain", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "marks": 1, "maxValue": "ansy2", "type": "numberentry", "scripts": {}, "showFeedbackIcon": true, "mustBeReduced": false, "correctAnswerFraction": true, "allowFractions": true, "variableReplacements": []}], "variableReplacementStrategy": "originalfirst", "unitTests": [], "marks": 0, "type": "gapfill", "scripts": {}, "showFeedbackIcon": true, "steps": [{"type": "information", "extendBaseMarkingAlgorithm": true, "scripts": {}, "showFeedbackIcon": true, "prompt": "

There are many ways to solve these equations simultaneously. Here is one method.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$y$$=$$\\simplify{{grad}x+{yint}}$               $(1)$
$y$$=$$\\simplify{x^2+{quadxcoeff}x+{quadccoeff}}$               $(2)$
\n

Substitute the expression for $y$ given in $(1)$ into $(2)$:
\\[\\simplify{{grad}x+{yint} =x^2+{quadxcoeff}x+{quadccoeff}}\\]

\n

Since we have a quadratic here we get everything onto one side:
\\[0=\\simplify{x^2+{sroots}x+{proots}}\\]

\n

There are various ways to solve a quadratic, in this particular case we can factorise the quadratic:

\n

\\[(\\simplify{x-{root1}})(\\simplify{x-{root2}})=0\\]

\n

Therefore, $x=\\var{root1},\\,\\var{root2}$.

\n


Now for $x=\\var{root1}$, we can determine the corresponding $y$ value by substituting $x=\\var{root1}$ into either equation $(1)$ or $(2)$. Below we substitute into $(1)$:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$y$$=$$\\simplify[!collectnumbers]{{grad}({root1})+{yint}}$
$=$$\\var{ansy1}$
\n

Now for $x=\\var{root2}$, so we can determine the corresponding $y$ value by substituting $x=\\var{root2}$ into either equation $(1)$ or $(2)$. Below we substitute into $(1)$:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$y$$=$$\\simplify[!collectnumbers]{{grad}({root2})+{yint}}$
$=$$\\var{ansy2}$
\n

Therefore the values that satisfy equations $(1)$ and $(2)$ are $x_1=\\var{root1}$, $y_1=\\var{ansy1}$ and $x_2=\\var{root2}$, $y_2=\\var{ansy2}$.

\n

In other words, the two curves intersect at the points $(\\var{root1},\\var{ansy1})$ and $(\\var{root2},\\var{ansy2})$.

", "showCorrectAnswer": true, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "unitTests": [], "marks": 0, "variableReplacements": []}], "sortAnswers": false, "stepsPenalty": "0", "variableReplacements": []}], "tags": [], "variable_groups": [], "type": "question", "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "heike hoffmann", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2960/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "heike hoffmann", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2960/"}]}