// Numbas version: exam_results_page_options {"name": "Graphing logarithms with horizontal and vertical transformations and base>1 ", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"ungrouped_variables": ["b", "a", "c", "d", "s"], "extensions": ["jsxgraph"], "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

Graphing $y=a\\log_{b}(\\pm x+d)+c$

"}, "tags": [], "name": "Graphing logarithms with horizontal and vertical transformations and base>1 ", "rulesets": {}, "preamble": {"css": "", "js": ""}, "functions": {"graph1": {"language": "javascript", "parameters": [["quad", "number"]], "type": "html", "definition": "var div = Numbas.extensions.jsxgraph.makeBoard('300px','300px',{boundingBox:[-12,12,12,-12],grid:true,axis:false});\nvar board = div.board;\n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = board.create('ticks',[xaxis,2],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 0\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,2],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n});\n\na = Numbas.jme.unwrapValue(scope.variables.a);\nb = Numbas.jme.unwrapValue(scope.variables.b);\nc = Numbas.jme.unwrapValue(scope.variables.c);\nd = Numbas.jme.unwrapValue(scope.variables.d);\ns = Numbas.jme.unwrapValue(scope.variables.s);\n\n\n\nif(quad==1){board.create('functiongraph',[function(x){ return a*Math.log(s*x+d)/Math.log(b)+c}],{strokeWidth:2});}\nif(quad==2){board.create('functiongraph',[function(x){ return a*Math.log(-s*x-d)/Math.log(b)+c}],{strokeWidth:2});}\nif(quad==3){board.create('functiongraph',[function(x){ return -a*Math.log(s*x+d)/Math.log(b)-c}],{strokeWidth:2});}\nif(quad==4){board.create('functiongraph',[function(x){ return -a*Math.log(-s*x-d)/Math.log(b)-c}],{strokeWidth:2});}\n\nreturn div;"}}, "parts": [{"marks": 0, "prompt": "

The $x$-intercept of $y=\\simplify{{a}log({s}x+{d},{b})+{c}}$ is the point $\\large($[[0]], [[1]]$\\large)$.

\n

Note: You should input the exact answer, not just a decimal approximation.

", "showFeedbackIcon": true, "scripts": {}, "gaps": [{"marks": 1, "showFeedbackIcon": true, "type": "jme", "showpreview": true, "expectedvariablenames": [], "showCorrectAnswer": true, "answer": "{s}*{b}^(-{c/a})-{s}*{d}", "variableReplacementStrategy": "originalfirst", "checkingaccuracy": 0.001, "scripts": {}, "vsetrangepoints": 5, "vsetrange": [0, 1], "variableReplacements": [], "checkvariablenames": false, "checkingtype": "absdiff", "answersimplification": "fractionNumbers, simplifyFractions, basic, unitFactor"}, {"marks": 1, "showFeedbackIcon": true, "type": "jme", "showpreview": true, "expectedvariablenames": [], "showCorrectAnswer": true, "answer": "0", "variableReplacementStrategy": "originalfirst", "checkingaccuracy": 0.001, "scripts": {}, "vsetrangepoints": 5, "vsetrange": [0, 1], "variableReplacements": [], "checkvariablenames": false, "checkingtype": "absdiff"}], "type": "gapfill", "variableReplacements": [], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}, {"marks": 0, "prompt": "

Another important point on the curve is ${\\large(}\\simplify[fractionNumbers]{{(b-d)/s}},$ [[0]]$\\large)$.

", "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": true, "marks": 1, "minValue": "{a+c}", "type": "numberentry", "allowFractions": true, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "maxValue": "{a+c}", "mustBeReduced": false, "scripts": {}, "correctAnswerStyle": "plain", "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "showFeedbackIcon": true, "mustBeReducedPC": 0}], "type": "gapfill", "variableReplacements": [], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}, {"marks": 0, "displayColumns": "1", "type": "1_n_2", "prompt": "

As $x$ increases decreases without bound, 

", "matrix": ["if(a>0,1,0)", "if(a<0,1,0)", "0", 0], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "distractors": ["", "", "", ""], "scripts": {}, "minMarks": 0, "choices": ["

$y$ increases without bound.

", "

$y$ decreases without bound.

", "

$y$ approaches $\\var{c}$.

", "

$y$ approaches $0$.

"], "maxMarks": 0, "shuffleChoices": true, "variableReplacements": [], "showFeedbackIcon": true}, {"marks": 0, "prompt": "

The vertical asymptote of $y=\\simplify{{a}log({s}x+{d},{b})+{c}}$ is $x=$ [[0]].

", "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": true, "marks": 1, "minValue": "{-d/s}", "type": "numberentry", "allowFractions": true, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "maxValue": "{-d/s}", "mustBeReduced": false, "scripts": {}, "correctAnswerStyle": "plain", "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "showFeedbackIcon": true, "mustBeReducedPC": 0}], "type": "gapfill", "variableReplacements": [], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}, {"marks": 0, "displayColumns": "2", "type": "1_n_2", "prompt": "

Which graph best represents $y=\\simplify{{a}log({s}x+{d},{b})+{c}}$?

", "matrix": ["1", 0, 0, 0], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "distractors": ["", "", "", ""], "scripts": {}, "minMarks": 0, "choices": ["

{graph1(1)}

", "

{graph1(2)}

", "

{graph1(3)}

", "

{graph1(4)}

"], "maxMarks": 0, "shuffleChoices": true, "variableReplacements": [], "showFeedbackIcon": true}], "variable_groups": [], "statement": "

The following questions will gauge your understanding of logarithms and how to graph them. 

\n

The logarithm you will be working with for this question is \\[y=\\simplify{{a}log({s}x+{d},{b})+{c}}.\\]

", "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"a": {"group": "Ungrouped variables", "templateType": "anything", "name": "a", "description": "

a

", "definition": "random(-4..4 except [0,1,b])"}, "d": {"group": "Ungrouped variables", "templateType": "anything", "name": "d", "description": "", "definition": "random(-4..4 except 0)"}, "s": {"group": "Ungrouped variables", "templateType": "anything", "name": "s", "description": "", "definition": "random(-1,1)"}, "b": {"group": "Ungrouped variables", "templateType": "anything", "name": "b", "description": "", "definition": "random(2..6)"}, "c": {"group": "Ungrouped variables", "templateType": "anything", "name": "c", "description": "", "definition": "random(-6..6 except [0,a,b,-a])"}}, "advice": "

This question assumes you understand the definition and the laws of logarithms.

\n

a) To find the $x$-intercept, substitute $y=0$ into the equation and solve for $x$:

\n

$\\begin{align*}&&0&=\\simplify{{a}log({s}x+{d},{b})+{c}}\\\\\\implies&& \\var{-c}&=\\simplify{{a}log({s}x+{d},{b})}\\\\\\implies&&\\simplify[fractionNumbers,simplifyFractions,basic]{-{c/a}}&=\\simplify{log({s}x+{d},{b})}\\\\\\implies&&\\simplify[fractionNumbers,simplifyFractions,basic]{{b}^(-{c/a})}&=\\simplify{{s}x+{d}}\\\\\\implies&&\\simplify[fractionNumbers,simplifyFractions,basic,unitDenominator,unitFactor]{({b}^(-{c/a})-{d})/{s}}&=x\\end{align*}$ 

\n

Therefore, the $x$-intercept is the point $\\left(\\simplify[fractionNumbers,simplifyFractions,basic,unitDenominator,unitFactor]{({b}^(-{c/a})-{d})/{s}},0\\right)$.

\n

b) Substitute $x=\\simplify[fractionNumbers]{{(b-d)/s}}$ into the equation: $y=\\simplify[!collectNumbers,basic,fractionNumbers]{{a}log(({(b-d)})+{d},{b})+{c}}=\\simplify[!collectNumbers,basic]{{a}log({b},{b})+{c}}=\\var{a+c}$. Therefore, another easily found point is $\\left(\\simplify[fractionNumbers]{{(b-d)/s}},\\var{a+c}\\right)$.

\n

\n

c) As $x$ gets larger and larger (increases without bound, or approaches infinity) $y=\\simplify{{a}log({s}x+{d},{b})+{c}}$ gets smaller and smaller (decreases without bound, or approaches negative infinity). larger and larger (increases without bound, or approaches infinity). 

\n

\n

c) As $x$ gets smaller and smaller (decreases without bound, or approaches negative infinity) $y=\\simplify{{a}log({s}x+{d},{b})+{c}}$ gets smaller and smaller (decreases without bound, or approaches negative infinity). larger and larger (increases without bound, or approaches infinity). 

\n

\n

\n

d) An asymptote is a line or curve that approaches a given curve arbitrarily closely. For the curve $y=\\simplify{{a}log({s}x+{d},{b})+{c}}$ the closer $\\simplify{{s}x+{d}}$ gets to zero (approaching from the right), the smaller larger $y$ gets (without bound). In other words, as $x$ approaches $\\simplify[fractionNumbers]{{-d/s}}$ from the right left, $y$ approaches negative infinity. This means that the asymptote for $y=\\simplify{{a}log({s}x+{d},{b})+{c}}$ is the line $x=\\simplify[fractionNumbers]{{-d/s}}$.

\n

e) Given all the information above, it should be clear that the graph should look like 

\n

{graph1(1)}

", "type": "question", "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}