// Numbas version: exam_results_page_options {"name": "RAW demo", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "RAW demo", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

A worked example about polynomials. 

"}, "extensions": [], "type": "question", "statement": "

This question is about manipulating linear and quadratic functions. 

\n

You could also use this section to provide any formulae the students might want to reference. 

\n

Or it could be the main, referenced part of a multi-part question. 

", "variable_groups": [{"name": "Part 1", "variables": ["x0", "a", "b"]}, {"name": "Part 2", "variables": ["a2", "b2", "c2", "name"]}, {"name": "Part 3", "variables": ["r", "s", "b3", "c3"]}], "preamble": {"css": "", "js": ""}, "variables": {"name": {"name": "name", "templateType": "anything", "group": "Part 2", "description": "", "definition": "random(['Matt','Jessica','Luke','Danny'])"}, "b": {"name": "b", "templateType": "randrange", "group": "Part 1", "description": "", "definition": "random(-5..5#1)"}, "x0": {"name": "x0", "templateType": "randrange", "group": "Part 1", "description": "

This is the value for x which is substituted in part 1. 

", "definition": "random(0..5#1)"}, "s": {"name": "s", "templateType": "anything", "group": "Part 3", "description": "

One root of the polynomial in part 3.

", "definition": "random(-10..10 except [0,r])"}, "c3": {"name": "c3", "templateType": "anything", "group": "Part 3", "description": "

Constant term in part 3. 

", "definition": "r*s"}, "b2": {"name": "b2", "templateType": "anything", "group": "Part 2", "description": "", "definition": "random(-5..5 except 0)"}, "c2": {"name": "c2", "templateType": "anything", "group": "Part 2", "description": "", "definition": "random(-5..5 except 0)"}, "a2": {"name": "a2", "templateType": "anything", "group": "Part 2", "description": "", "definition": "random(-5..5 except 0)"}, "r": {"name": "r", "templateType": "anything", "group": "Part 3", "description": "

One root of the polynomial in part 3. 

", "definition": "random(-10..10 except 0)"}, "a": {"name": "a", "templateType": "randrange", "group": "Part 1", "description": "", "definition": "random(-5..5#1)"}, "b3": {"name": "b3", "templateType": "anything", "group": "Part 3", "description": "

Coefficient of x in part 3.

", "definition": "-(r+s)"}}, "tags": [], "parts": [{"variableReplacements": [], "customMarkingAlgorithm": "", "minValue": "a*x0+b", "type": "numberentry", "maxValue": "a*x0+b", "notationStyles": ["plain", "en", "si-en"], "unitTests": [], "correctAnswerStyle": "plain", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "prompt": "

Let's look at functions of the form $f(x) = \\simplify{a x + b}$. 

\n

Suppose $f(x) = \\simplify{{a}x+{b}}$. 

\n

Find $f(\\var{x0})$. 

", "allowFractions": false, "mustBeReducedPC": 0, "showCorrectAnswer": true, "mustBeReduced": false, "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": 1}, {"checkingType": "absdiff", "variableReplacements": [], "expectedVariableNames": ["x"], "vsetRangePoints": 5, "type": "jme", "checkingAccuracy": 0.001, "checkVariableNames": true, "unitTests": [], "failureRate": 1, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "prompt": "

{name}'s favourite quadratic is $g(x) = \\simplify[all,!noleadingminus]{{a2}x^2 + {b2}x + {c2}}$.

\n

Find $g'(x)$. 

", "showPreview": true, "answer": "2*a2*x+b2", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {}, "vsetRange": [0, 1], "marks": "1"}, {"variableReplacements": [], "expectedVariableNames": [], "stepsPenalty": "0", "variableReplacementStrategy": "originalfirst", "checkVariableNames": false, "showCorrectAnswer": true, "showPreview": true, "answer": "set(r,s)", "unitTests": [], "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": "2", "vsetRangePoints": 5, "type": "jme", "checkingType": "absdiff", "failureRate": 1, "checkingAccuracy": 0.001, "showFeedbackIcon": true, "vsetRange": [0, 1], "steps": [{"type": "1_n_2", "distractors": ["", "", "Check the sign of the coefficient of $x$. ", ""], "matrix": ["1", 0, 0, 0], "displayColumns": 0, "variableReplacements": [], "maxMarks": 0, "unitTests": [], "choices": ["$\\simplify{r+s = {-b3}}$ and $\\simplify{rs = {c3}}$.", "$\\simplify{r+s = {-b3}}$ and $\\simplify{rs = {-c3}}$.", "$\\simplify{r+s = {b3}}$ and $\\simplify{rs = {c3}}$.", "$\\simplify{r+s = {b3}}$ and $\\simplify{rs = {-c3}}$."], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "prompt": "

If the roots of $h(x)$ are $r$ and $s$, then $h(x) = (x-r)(x-s) = x^2 -(r+s)x +rs$. 

\n

What does this tell us about $r$ and $s$?

", "minMarks": 0, "displayType": "radiogroup", "shuffleChoices": true, "customMarkingAlgorithm": "", "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": 0}], "customMarkingAlgorithm": "", "prompt": "

Consider the quadratic $h(x) = \\simplify{x^2 + {b3}x + {c3}}$.

\n

What is the set of roots of $h(x)$? Use the Numbas syntax set(a,b,c) in your answer. 

\n

"}], "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

When evaluating a function $f(x)$ at a point $x=\\var{x0}$, simply substitute $x$ in the expression with the value $\\var{x0}$.

\n

When differentiating a polynomial with respect to $x$, take each term $a_n x^n$ and multiply its coefficient by $n$ before reducing its power by 1, giving $n a_n x^{n-1}$. 

\n

To find the roots of a quadratic, you might be able to do it by sight by noting that the sum of the two roots should be the negative of the coefficient of $x$, while the product of the two roots should be the constant term. This is explained in more detail in the expanded part above. 

\n

Otherwise, you can always find the root(s) of a general quadratic $a x^2 + b x + c = 0$ by using the quadratic formula: 

\n

\\[r = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}\\]

", "functions": {}, "rulesets": {}, "ungrouped_variables": [], "contributors": [{"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}]}]}], "contributors": [{"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}]}