<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>2.4.2.5 Limits of piecewise function</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<p>Draw a graph of the following function for yourself:</p>
<p><span class="math inline">\(\qquad f(x)= 
\left\{
\begin{array}{ll} {@aa@} &amp; x&lt;{@ll@}\\
{@bb@} &amp; x= {@ll@} \\
{@cc@} &amp; x&gt; {@ll@}
\end{array} \right.\)</span></p>

<p>Find the following limits (if a limit does not exist type in <code>none</code>).</p>
<ol class="HELM_parts">
  <li><p>\(\lim_{x\rightarrow 0^+}f(x) = \) [[input:ans1]] [[validation:ans1]] [[feedback:prt1]]</p></li>
  <li><p>\(\lim_{x\rightarrow 0^-}f(x) = \) [[input:ans2]] [[validation:ans2]] [[feedback:prt2]]</p></li>
  <li><p>\(\lim_{x\rightarrow 0}f(x) = \) [[input:ans3]] [[validation:ans3]] [[feedback:prt3]]</p></li>
  <li><p>\(\lim_{x\rightarrow {@ll@}^+}f(x) = \) [[input:ans4]] [[validation:ans4]] [[feedback:prt4]]</p></li>
  <li><p>\(\lim_{x\rightarrow {@ll@}^-}f(x) = \) [[input:ans5]] [[validation:ans5]] [[feedback:prt5]]</p></li>
  <li><p>\(\lim_{x\rightarrow {@ll@}}f(x) = \) [[input:ans6]] [[validation:ans6]] [[feedback:prt6]]</p></li></ol>
<p><br></p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>The graph of 
\[\qquad f(x)= 
\left\{
\begin{array}{ll} {@aa@} &amp; x&lt;{@ll@}\\
{@bb@} &amp; x= {@ll@} \\
{@cc@} &amp; x&gt; {@ll@}
\end{array} \right.\] is shown below</p>
<figure class="HELM_figure">
{@plot([pg1, [discrete,[ [x0,ev(f0,x=x0)], [x0,f2]]], [discrete,[ [x0,f1]]] ], [x,(x0-5),(x0+5)], [y,-10,ev(f0,x=x0)+5], ps, pt, pc)@}
</figure>
<p>We use the graph to find the limits.</p>
<ol class="HELM_parts">
<li><p>There is no discontinuity at \(x = 0\), so \(\lim_{x\rightarrow 0^+}f(x) = {@a1@}\).</p></li>
<li><p>Similarly, \(\lim_{x\rightarrow 0^-}f(x) = {@a1@}\).</p></li>
<li><p>Similarly, \(\lim_{x\rightarrow 0}f(x) = {@a1@}\).</p></li>
<li><p>The function is discontinuous at \(x = {@ll@}\). We see from the graph that \(f\) approaches {@cc@} as \(x\) approaches {@ll@} from the right. Therefore, \(\lim_{x\rightarrow {@ll@}^+}f(x) = {@cc@}\).</p></li>
<li><p>On the other hand, we see that \(f\) approaches {@ta@} as \(x\) approaches {@ll@} from the left. Therefore, \(\lim_{x\rightarrow {@ll@}^-}f(x) = {@ta@}\).</p></li>
<li><p>Since the one-sided limits of \(f\) at \(x = {@ll@}\) are different, the limit at \(x = {@ll@}\) does not exist.</p></li>
</ol>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2021072200</text>
    </stackversion>
    <questionvariables>
      <text><![CDATA[a1: 1+rand(9);
a2: 2+rand(8);
aa: a2*x + a1;
ll: 2 + rand(4);
ta: a2*ll+a1;
bb: rand_with_prohib(1, 11, [ta]);
cc: rand_with_prohib(1, 12, [ta, bb]);

f0:aa;
f1:bb;
f2:cc;
x0:ll;
pg1:if x<(x0-1/1000) then f0 else if x<x0+1/1000 then f1 else f2;
ps:[style, lines, points, points];
pt:[point_type,circle,circle,bullet];
pc:[color, blue,red,blue];]]></text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\[\lim_{x\rightarrow 0}= {@a1@}, \, \lim_{x\rightarrow {@ll@}^+}f(x) = {@cc@}, \, \lim_{x\rightarrow {@ll@}^-}f(x) = {@ta@}, \, \lim_{x\rightarrow {@ll@}^-}f(x) = none \]</text>
    </questionnote>
    <questiondescription format="moodle_auto_format">
      <text/>
    </questiondescription>
    <questionsimplify>1</questionsimplify>
    <assumepositive>0</assumepositive>
    <assumereal>0</assumereal>
    <prtcorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:green;"><i class="fa fa-check"></i></span> Correct answer, well done.]]></text>
    </prtcorrect>
    <prtpartiallycorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:orange;"><i class="fa fa-adjust"></i></span> Your answer is partially correct.]]></text>
    </prtpartiallycorrect>
    <prtincorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:red;"><i class="fa fa-times"></i></span> Incorrect answer.]]></text>
    </prtincorrect>
    <decimals>.</decimals>
    <scientificnotation>*10</scientificnotation>
    <multiplicationsign>none</multiplicationsign>
    <sqrtsign>1</sqrtsign>
    <complexno>i</complexno>
    <inversetrig>cos-1</inversetrig>
    <logicsymbol>lang</logicsymbol>
    <matrixparens>[</matrixparens>
    <isbroken>0</isbroken>
    <variantsselectionseed/>
    <input>
      <name>ans1</name>
      <type>numerical</type>
      <tans>a1</tans>
      <boxsize>3</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords>none</allowwords>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans2</name>
      <type>numerical</type>
      <tans>a1</tans>
      <boxsize>3</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords>none</allowwords>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans3</name>
      <type>numerical</type>
      <tans>a1</tans>
      <boxsize>3</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords>none</allowwords>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans4</name>
      <type>numerical</type>
      <tans>cc</tans>
      <boxsize>3</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords>none</allowwords>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans5</name>
      <type>numerical</type>
      <tans>ta</tans>
      <boxsize>3</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords>none</allowwords>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans6</name>
      <type>numerical</type>
      <tans>none</tans>
      <boxsize>3</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <prt>
      <name>prt1</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>2</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>CasEqual</answertest>
        <sans>ans1</sans>
        <tans>a1</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-1-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>\(\lim_{x\rightarrow 0^+}f(x)\) is the value of&nbsp;{@aa@} at \(x=0\).</p>]]></text>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt2</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>2</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>CasEqual</answertest>
        <sans>ans2</sans>
        <tans>a1</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-1-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>\(\lim_{x\rightarrow 0^-}f(x)\) is the value of&nbsp;{@aa@} at \(x=0\).<br></p>]]></text>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt3</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>2</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>CasEqual</answertest>
        <sans>ans3</sans>
        <tans>a1</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt3-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt3-1-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>\(\lim_{x\rightarrow 0}f(x)\) is the value of&nbsp;{@aa@} at \(x=0\).<br></p>]]></text>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt4</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>2</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>CasEqual</answertest>
        <sans>ans4</sans>
        <tans>cc</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt4-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt4-1-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>\(\lim_{x\rightarrow {@ll@}^+}f(x)\) is the value {@cc@}.<br></p>]]></text>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt5</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>2</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>CasEqual</answertest>
        <sans>ans5</sans>
        <tans>ta</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt5-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt5-1-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>\(\lim_{x\rightarrow {@ll@}^-}f(x)\) is the value of&nbsp;{@aa@} at \(x={@ll@}\).<br></p>]]></text>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt6</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>2</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>CasEqual</answertest>
        <sans>ans6</sans>
        <tans>none</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt6-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt6-1-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>\(\lim_{x\rightarrow {@ll@}}f(x)\) does not exist because&nbsp;\(\lim_{x\rightarrow {@ll@}^+}f(x) \neq \lim_{x\rightarrow {@ll@}^-}f(x)\)</p>]]></text>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>121197615</deployedseed>
    <deployedseed>540047678</deployedseed>
    <deployedseed>1842502916</deployedseed>
    <deployedseed>1410690035</deployedseed>
    <deployedseed>1476014777</deployedseed>
    <deployedseed>1695108805</deployedseed>
    <deployedseed>339747090</deployedseed>
    <deployedseed>791403765</deployedseed>
    <deployedseed>1815541999</deployedseed>
    <deployedseed>1080337301</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>a1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>a1</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>a1</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>cc</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>ta</value>
      </testinput>
      <testinput>
        <name>ans6</name>
        <value>none</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt3</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt3-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt4</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt4-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt5</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt5-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt6</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt6-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>none</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>none</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>none</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>none</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>none</value>
      </testinput>
      <testinput>
        <name>ans6</name>
        <value>0</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt2-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt3</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt3-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt4</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt4-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt5</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt5-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt6</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt6-1-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>a1-1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>a1+1</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>a1+2</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>cc+1</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>a2*ll+a1+1</value>
      </testinput>
      <testinput>
        <name>ans6</name>
        <value>a1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt2-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt3</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt3-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt4</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt4-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt5</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt5-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt6</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt6-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
