// Numbas version: exam_results_page_options {"name": "Introduction to Functions", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Introduction to Functions", "tags": [], "metadata": {"description": "Introducing function notation, including evaluating a function for a given input.", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

You are given the following functions:

\n

$f(x) = \\var{a}x+\\var{b}$

\n

$g(x) = \\var{c}x-\\var{d}$ 

\n

$h(x) = \\var{d}x^2-\\var{b}x+\\var{c-1}$ 

", "advice": "

(i) To find $f(\\var{x})$ we simply substitute $x=\\var{x}$ into our function $f(x) = \\var{a}x+\\var{b}$

\n

Hence $f(\\var{x})=\\var{a}(\\var{x})+\\var{b}=\\var{f(x)}$

\n

\n

(ii) To find $h(\\var{x+2})$ we simply substitute $x=\\var{x+2}$ into our function $h(x) = \\var{d}x^2-\\var{b}x+\\var{c-1}$ 

\n

Hence $h(\\var{x+2})=\\var{d}(\\var{x+2})^2-\\var{b}(\\var{x+2})+\\var{c-1}=\\var{h(x+2)}$

\n

\n

(iii) To find $g(x^2)$ given that $x=\\var{x}$ we note that $x^2=\\var{x}^2=\\var{x^2}$

\n

Hence we just need to calculate $g(\\var{x^2})= \\var{c}(\\var{x^2})-\\var{d}=\\var{g(x^2)}$

\n

\n

(iv) From (i) we note that $f(\\var{x})=\\var{f(x)}$ and hence $ff(\\var{x})=f(f(\\var{x}))=f(\\var{f(x)})=\\var{a}(\\var{f(x)})+\\var{b}=\\var{f(f(x))}$

\n

\n

(v) We note that $gh(\\var{x+2})=g(h(\\var{x+2}))=g(\\var{h(x+2)})$ using our answer from (ii)

\n

But then $g(\\var{h(x+2)}) = \\var{c}(\\var{h(x+2)})-\\var{d}=\\var{g(h(x+2))}$ 

\n

\n

\n

(vi) Note that $hg(\\var{x+2})=h(g(\\var{x+2}))$

\n

So first we must calculate $g(\\var{x+2})=\\var{c}(\\var{(x+2)})-\\var{d}=\\var{g(x+2)}$

\n

Then $hg(\\var{x+2}) = h(\\var{g(x+2)}) = \\var{d}(\\var{g(x+2)})^2-\\var{b}(\\var{g(x+2)})+\\var{c-1} =\\var{h(g(x+2))}$ 

\n

\n

Note the difference between (v) and (vi):

\n

To find $hg(\\var{x+2})$ we first find $g(\\var{x+2})$, then apply $h$ to this answer

\n

To find $gh(\\var{x+2})$ we first find $h(\\var{x+2})$, then apply $g$ to this answer

\n

\n

(vii) $h(\\var{x+2})g(\\var{x+2})$ simply means $h(\\var{x+2}) \\times g(\\var{x+2})=\\var{h(x+2)} \\times \\var{g(x+2)}=\\var{h(x+2)*g(x+2)}$

", "rulesets": {}, "extensions": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(2 .. 8#1)", "description": "", "templateType": "randrange"}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(1 .. 8#1)", "description": "", "templateType": "randrange"}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(2 .. 8#1)", "description": "", "templateType": "randrange"}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "random(2 .. 8#1)", "description": "", "templateType": "randrange"}, "x": {"name": "x", "group": "Ungrouped variables", "definition": "random(2 .. 4#1)", "description": "", "templateType": "randrange"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "c", "d", "x"], "variable_groups": [], "functions": {"f": {"parameters": [["x", "number"]], "type": "number", "language": "jme", "definition": "{a}*x+{b}"}, "g": {"parameters": [["x", "number"]], "type": "number", "language": "jme", "definition": "{c}*x-{d}"}, "h": {"parameters": [["x", "number"]], "type": "number", "language": "jme", "definition": "{d}*x^2-{b}*x+{c}-1"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

Calculate:

\n

(i) $f(\\var{x})=$[[0]]

\n

(ii) $h(\\var{x+2})=$[[1]]

\n

(iii) $g(x^2)=$ [[2]] given that $x=\\var{x}$

\n

(iv) $ff(\\var{x})=$[[3]]

\n

(v) $gh(\\var{x+2})=$[[4]]

\n

(vi) $hg(\\var{x+2})=$[[5]]

\n

(vii) $h(\\var{x+2})g(\\var{x+2})=$[[6]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "gap 1", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "f({x})", "maxValue": "f({x})", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "gap 2", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "h({x+2})", "maxValue": "h({x+2})", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "gap 3", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "g({x^2})", "maxValue": "g({x^2})", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "gap 4", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "f(f({x}))", "maxValue": "f(f({x}))", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "gap 5", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "g(h({x+2}))", "maxValue": "g(h({x+2}))", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "gap 6", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "h(g({x+2}))", "maxValue": "h(g({x+2}))", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "gap 7", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "g({x+2})*h({x+2})", "maxValue": "g({x+2})*h({x+2})", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "contributors": [{"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}