// Numbas version: finer_feedback_settings {"name": "Functions", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Functions", "tags": [], "metadata": {"description": "

Student is given a rational function, h(x), with randomised coefficients, and a linear function, k(x), also with randomised coeffieients and asked to find:

\n
    \n
  1. h(k(x)) or k(h(x)) (randomly selected) for a randomised value of x
  2. \n
  3. The domain of h(x) - multiple choice part
  4. \n
  5. A general expresion for k(h(x)) or h(k(x)) - opposite combination to first part.
  6. \n
\n

Variables are constrained so that h(x) is not a degenerate form and that when evaluating h(x) denomiator is not 0.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Let \\(\\displaystyle{h(x)=\\frac{\\simplify{{a}*x+{b}}}{\\simplify{{c}*x+{d}}}}\\) and \\(k(x)=\\simplify{{l}x+{m}}\\).

", "advice": "

Part a)

\n

We have \\begin{align}k\\left(h(\\var{n})\\right)&=k\\left(\\simplify[!collectNumbers]{({a}*{n}+{b})/({c}*{n}+{d})}\\right)\\\\&=k(\\var[fractionNumbers]{eval(f_x,[\"x\":n])})\\\\&= \\var[fractionNumbers]{comb_n}\\end{align}

\n

We have \\begin{align}h\\left(k(\\var{n})\\right)&=h\\left(\\simplify[!collectNumbers]{{l}*{n}+{m}}\\right)\\\\&=h(\\var[fractionNumbers]{eval(g_x,[\"x\":n])})\\\\&= \\var[fractionNumbers]{comb_n}\\end{align}

\n

Part b)

\n

The domain of a function is the set of possible inputs. The function \\(h(x)\\) will not produce an output if it's denominator is \\(0\\), that is if \\(x=\\simplify[fractionNumbers]{-{d/c}}\\). Hence the domain of \\(h(x)\\) will be all real numbers except \\(x=\\simplify[fractionNumbers]{-{rational(d/c)}}\\).

\n

Part c)

\n

We require \\begin{align}h\\left( k(x)\\right)&=h\\left(\\simplify{{l}x+{m}}\\right)\\\\&=\\frac{\\simplify{{a}({l}x+{m})+{b}}}{\\simplify{{c}({l}x+{m})+{d}}}\\\\&=\\frac{\\simplify[expandBrackets,collectNumbers,cancelTerms]{{a*l}x+{a*m+b}}}{\\simplify[expandBrackets,collectNumbers,cancelTerms]{{c*l}x+{c*m+d}}}\\end{align}

\n

We require \\begin{align}k\\left( h(x)\\right)&=k\\left(\\frac{\\simplify{{a}x+{b}}}{\\simplify{{c}x+{d}}}\\right)\\\\&=\\simplify{{l}*({a}x+{b})/({c}x+{d})+{m}}\\\\&=\\frac{\\simplify{{l*a}x+{l*b}+{m*c}x+{m*d}}}{\\simplify{{c}x+{d}}}\\end{align}

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"f_x": {"name": "f_x", "group": "Ungrouped variables", "definition": "substitute([\"a\":a,\"b\":b,\"c\":c,\"d\":d],expression(\"(a*x+b)/(c*x+d)\"))", "description": "

Expression for h(x)

", "templateType": "anything", "can_override": false}, "g_x": {"name": "g_x", "group": "Ungrouped variables", "definition": "substitute([\"l\":l,\"m\":m],expression(\"l*x+m\"))", "description": "

Expression for k(x)

", "templateType": "anything", "can_override": false}, "comb": {"name": "comb", "group": "Ungrouped variables", "definition": "[substitute([\"x\":g_x],f_x),substitute([\"x\":f_x],g_x)]", "description": "

comb[0]=f(g(x)), comb[1]=g(f(x)) - calculates correct answer for both forms of composition of functions in part 3

", "templateType": "anything", "can_override": false}, "comb_n": {"name": "comb_n", "group": "Ungrouped variables", "definition": "eval(comb[if(switch=1,0,1)],[\"x\":n])", "description": "

if switch=1, comb_n=g(f(n)) else comb_n=f(g(n)) - correct value of composite function in part 1

", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "

Coefficient of x in numerator of h(x) - values of a, b, c and d are further constrained by Variable testing

", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-9..9 except 0)", "description": "

constant in numerator of h(x) - values of a, b, c and d are further constrained by Variable testing

", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(-5..5 except [0,1])", "description": "

Coefficient of x in denominator of h(x) - values of a, b, c and d are further constrained by Variable testing

", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "random(-9..9 except 0)", "description": "

constant in denominator of h(x) - values of a, b, c and d are further constrained by Variable testing

", "templateType": "anything", "can_override": false}, "l": {"name": "l", "group": "Ungrouped variables", "definition": "random(-9..9 except 0)", "description": "

Coefficient of x in k(x)

", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "random(-9..9 except 0)", "description": "

Constant term in k(x)

", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(1..6)", "description": "

Value of x at which composite function is to be evaluated.

", "templateType": "anything", "can_override": false}, "switch": {"name": "switch", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "

random value feciding order of composition of functions for part 1

", "templateType": "anything", "can_override": false}, "f_xNum": {"name": "f_xNum", "group": "Ungrouped variables", "definition": "substitute([\"a\":a,\"b\":b],expression(\"a*x+b\"))", "description": "", "templateType": "anything", "can_override": false}, "f_xDenom": {"name": "f_xDenom", "group": "Ungrouped variables", "definition": "substitute([\"c\":c,\"d\":d],expression(\"c*x+d\"))", "description": "", "templateType": "anything", "can_override": false}, "answer": {"name": "answer", "group": "Ungrouped variables", "definition": "comb[switch]", "description": "

Correct answer for part 3.

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "a*c-b*d<>1 and c*n+d<>0 and a*c-b*d<>0", "maxRuns": "200"}, "ungrouped_variables": ["f_x", "g_x", "comb_n", "comb", "a", "b", "c", "d", "l", "m", "n", "switch", "f_xNum", "f_xDenom", "answer"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Evaluate \\(k\\left(h(\\var{n})\\right).\\) \\(h\\left(k(\\var{n})\\right).\\) Leave your answer as a fraction. (Note to type the fraction \\(\\frac34\\), type 3/4)

\n

\\(k\\left(h(\\var{n})\\right)=\\) \\(h\\left(k(\\var{n})\\right)=\\) [[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "comb_n", "maxValue": "comb_n", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The domain of \\(h(x)\\) is:

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "radiogroup", "displayColumns": "1", "showCellAnswerState": true, "choices": ["All real \\(x\\) except \\(x=\\simplify[fractionNumbers]{{rational(-d/c)}}\\)", "All real \\(x\\) except \\(x=\\simplify[fractionNumbers]{{rational(d/c)}}\\)", "All real \\(x\\) except \\(x=\\simplify[fractionNumbers]{{rational(-d/c)}}\\) and \\(x=\\simplify[fractionNumbers]{{rational(-b/a)}}\\)", "All real \\(x\\)"], "matrix": ["1", 0, 0, 0], "distractors": ["", "", "", ""]}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is \\(h\\left(k(x)\\right) ?\\) \\(k\\left(h(x)\\right) ?\\) Simplify your answer as much as possible. Show full working for this part on your handwritten working.

\n

\\(h\\left(k(x)\\right)=\\) \\(k\\left(h(x)\\right)=\\)[[0]]

", "gaps": [{"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, "answer": "{answer}", "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": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}]}], "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}