// Numbas version: exam_results_page_options {"name": "Find discontinuities of piecewise-defined function", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Find discontinuities of piecewise-defined function", "metadata": {"notes": "", "licence": "Creative Commons Attribution 4.0 International", "description": ""}, "showQuestionGroupNames": false, "type": "question", "statement": "

Find the $2$ points $x=a$ and $x=b$, where $a \\lt b$,  at which the following function $f:\\mathbb{R} \\rightarrow \\mathbb{R}$ is not continuous.

\n

", "variable_groups": [], "preamble": {"js": "", "css": ""}, "variables": {"p": {"templateType": "anything", "name": "p", "group": "Ungrouped variables", "description": "", "definition": "random(-9..9)"}, "b": {"templateType": "anything", "name": "b", "group": "Ungrouped variables", "description": "", "definition": "a+random(1..3)"}, "er1": {"templateType": "anything", "name": "er1", "group": "Ungrouped variables", "description": "", "definition": "t*0+(1-t)*random(1,2,3)"}, "v": {"templateType": "anything", "name": "v", "group": "Ungrouped variables", "description": "", "definition": "if(w=3,1,0)"}, "t": {"templateType": "anything", "name": "t", "group": "Ungrouped variables", "description": "", "definition": "if(w=1,1,0)"}, "er2": {"templateType": "anything", "name": "er2", "group": "Ungrouped variables", "description": "", "definition": "u*0+(1-u)*random(1,2,3)"}, "c": {"templateType": "anything", "name": "c", "group": "Ungrouped variables", "description": "", "definition": "b+random(1..3)"}, "dis1": {"templateType": "anything", "name": "dis1", "group": "Ungrouped variables", "description": "", "definition": "if(w=1,b,a)"}, "w": {"templateType": "anything", "name": "w", "group": "Ungrouped variables", "description": "", "definition": "random(1..3)"}, "er3": {"templateType": "anything", "name": "er3", "group": "Ungrouped variables", "description": "", "definition": "v*0+(1-v)*random(1,2,3)"}, "q2": {"templateType": "anything", "name": "q2", "group": "Ungrouped variables", "description": "", "definition": "-random(1..3)"}, "dis2": {"templateType": "anything", "name": "dis2", "group": "Ungrouped variables", "description": "", "definition": "if(w=3,b,c)"}, "q1": {"templateType": "anything", "name": "q1", "group": "Ungrouped variables", "description": "", "definition": "random(1..4)"}, "lo1": {"templateType": "anything", "name": "lo1", "group": "Ungrouped variables", "description": "", "definition": "dis1"}, "u": {"templateType": "anything", "name": "u", "group": "Ungrouped variables", "description": "", "definition": "if(w=2,1,0)"}, "a": {"templateType": "anything", "name": "a", "group": "Ungrouped variables", "description": "", "definition": "random(-3..3)"}}, "tags": ["checked2015", "MAS2224"], "parts": [{"prompt": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$f(x) = \\left \\{ \\begin{array}{l} \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\\\\\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}}\\end{array} \\right .$$\\var{p},$$ x \\leq \\var{a},$
$\\simplify{{q1}*x+{p+er1-q1*a}},$$\\var{a} \\lt x \\leq \\var{b},$
$\\simplify{{q2}*x^2+{-2*q2*b}*x+{q2*b^2+q1*(b-a)+p+er1+er2}},$$\\var{b}\\lt x \\leq \\var{c},$
$\\var{q2*(c-b)*(c-b)+q1*(b-a)+p+er1+er2+er3},$$x \\gt \\var{c}.$
\n

$f$ is discontinuous at $x=a$ where $a=\\;$[[0]].

\n

$f$ is discontinuous at $x=b$ where $b=\\;$[[1]] (remember that $b \\gt a$).

", "showCorrectAnswer": true, "type": "gapfill", "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "showPrecisionHint": false, "minValue": "dis1", "type": "numberentry", "maxValue": "dis1", "scripts": {}, "showCorrectAnswer": true, "marks": 3}, {"correctAnswerFraction": false, "allowFractions": false, "showPrecisionHint": false, "minValue": "dis2", "type": "numberentry", "maxValue": "dis2", "scripts": {}, "showCorrectAnswer": true, "marks": 3}], "scripts": {}, "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "\n

{discont(a,b,c,p,q1,q2,er1,er2,er3,dis1,dis2)}

\n

\n

The function is discontinuous at $x=\\var{dis1},\\;\\;x=\\var{dis2}$.

\n

At $x=\\var{dis1}$ we have:

\n

\\[\\lim_{x \\nearrow\\; \\var{dis1}} f(x) \\neq \\lim_{x \\searrow\\; \\var{dis1}} f(x)\\]

\n

\n

At $x=\\var{dis2}$ we have:

\n

\\[\\lim_{x \\nearrow\\; \\var{dis2}} f(x) \\neq \\lim_{x \\searrow\\; \\var{dis2}} f(x)\\]

\n

\n

See graph of $f$ above.

\n", "functions": {"discont": {"type": "html", "parameters": [["a", "number"], ["b", "number"], ["c", "number"], ["p", "number"], ["q1", "number"], ["q2", "number"], ["er1", "number"], ["er2", "number"], ["er3", "number"], ["dis1", "number"], ["dis2", "number"]], "language": "javascript", "definition": "var boxup=Math.max(3,p,p+er1,q1*(b-a)+p+er1,q1*(b-a)+p+er1+er2,q2*(c-b)*(c-b)+q1*(b-a)+p+er1+er2,q2*(c-b)*(c-b)+q1*(b-a)+p+er1+er2+er3)+2;\nvar boxdown=Math.min(-3,p,p+er1,q1*(b-a)+p+er1,q1*(b-a)+p+er1+er2,q2*(c-b)*(c-b)+q1*(b-a)+p+er1+er2,q2*(c-b)*(c-b)+q1*(b-a)+p+er1+er2+er3)-2;\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px', {axis:true, boundingbox:[Math.min(-2,a-2),boxup,Math.max(c+2,2),boxdown]});\nvar brd=div.board;\nvar l1=brd.create('functiongraph',[function(x){return p;},a-2,a],{strokeColor:'red'});\nvar l2=brd.create('functiongraph',[function(x){return q1*x+(p+er1-q1*a);},a,b],{strokeColor:'red'});\nvar l3=brd.create('functiongraph',[function(x){return q2*x*x-2*b*q2*x+(p+er1+er2+q2*b*b+q1*(b-a));},b,c],{strokeColor:'red'});\nvar l4=brd.create('functiongraph',[function(x){return q2*(c-b)*(c-b)+q1*(b-a)+p+er1+er2+er3;},c,c+2],{strokeColor:'red'});\nreturn div;\n"}}, "question_groups": [{"pickQuestions": 0, "name": "", "pickingStrategy": "all-ordered", "questions": []}], "rulesets": {}, "ungrouped_variables": ["q1", "a", "c", "q2", "er1", "er2", "er3", "dis1", "dis2", "p", "lo1", "u", "t", "w", "v", "b"], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}