<?xml version="1.0" encoding="UTF-8"?>
<quiz>


<question type="category">
<category>
<text>$course$/rexams/Exercise 01</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q01 : r-exams-org_anova </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>A survey with 50 persons was conducted to analyze the design of an advertising campaign. Each respondent was asked to evaluate the overall impression of the advertisement on an eleven-point scale from 0 (bad) to 10 (good). The evaluations are summarized separately with respect to type of occupation of the respondents in the following figure.</p>
<p><img src="@@PLUGINFILE@@/r-exams-org_anova-002.png" alt="image" /></p>
<p>To analyze the influence of occupation on the evaluation of the advertisement an analysis of variance was performed:</p>
<pre><code>  Res.Df    RSS Df Sum of Sq     F     Pr(&gt;F)
1     49 20.283                              
2     46 13.336  3     6.947 7.987 0.00021666</code></pre>
<p>Which of the following statements are correct?</p>
</p>]]></text>
<file name="r-exams-org_anova-002.png" encoding="base64">[encoded data, 10380 characters]</file>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>In order to be able to answer the questions the fraction of explained variance has to be determined. The residual sum of squares when using only a single overall mean value (<span class="math inline">\(\mathit{RSS}_0\)</span>) as well as the residual sum of squares when allowing different mean values given occupation (<span class="math inline">\(\mathit{RSS}_1\)</span>) are required. Both are given in the <code>RSS</code> column of the ANOVA table. The fraction of explained variance is given by <span class="math inline">\(1 -
\mathit{RSS}_1/\mathit{RSS}_0 = 1 - 13.336/20.283 =
0.343\)</span>.</p>
<p>The statements above can now be evaluated as right or wrong.</p>
<ol type = "a">
<li> False. The fraction of explained variance is <span class="math inline">\(0.343\)</span> and hence <em>not</em> smaller than 0.17. </li>
<li> False. An ANOVA always tests the null hypothesis, that all mean values are equal against the alternative hypothesis that they are different. </li>
<li> True. The <span class="math inline">\(p\)</span> value is <span class="math inline">\(0.000217\)</span> and hence significant. It can be shown that the evaluations differ with respect to the occupation of the respondents. </li>
<li> True. The fraction of explained variance is <span class="math inline">\(0.343\)</span> and hence larger than 0.21. </li>
<li> False. The test statistic is <span class="math inline">\(F = 7.987\)</span> and hence <em>not</em> smaller than <span class="math inline">\(4.8\)</span>. </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>false</single>
<answernumbering>abc</answernumbering>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
The fraction of explained variance is smaller than <span class="math inline">\(17\)</span>%.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The fraction of explained variance is <span class="math inline">\(0.343\)</span> and hence <em>not</em> smaller than 0.17.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
A one-sided alternative was tested for the mean values.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. An ANOVA always tests the null hypothesis, that all mean values are equal against the alternative hypothesis that they are different.
</p>]]></text>
</feedback>
</answer>
<answer fraction="50" format="html">
<text><![CDATA[<p>
It can be shown that the evaluation of the respondents depends on their occupation. (Significance level <span class="math inline">\(5\%\)</span>)
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. The <span class="math inline">\(p\)</span> value is <span class="math inline">\(0.000217\)</span> and hence significant. It can be shown that the evaluations differ with respect to the occupation of the respondents.
</p>]]></text>
</feedback>
</answer>
<answer fraction="50" format="html">
<text><![CDATA[<p>
The fraction of explained variance is larger than <span class="math inline">\(21\)</span>%.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. The fraction of explained variance is <span class="math inline">\(0.343\)</span> and hence larger than 0.21.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
The test statistic is smaller than <span class="math inline">\(4.8\)</span>.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The test statistic is <span class="math inline">\(F = 7.987\)</span> and hence <em>not</em> smaller than <span class="math inline">\(4.8\)</span>.
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 02</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q02 : r-exams-org_automaton </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>Consider the following automaton with initial state A and accepting state B:</p>
<p><img src="@@PLUGINFILE@@/automaton.png" style="width:5cm" alt="image" /></p>
<p>Which of the following sequences are accepted?</p>
</p>]]></text>
<file name="automaton.png" encoding="base64">[encoded data, 74196 characters]</file>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The given automaton accepts input strings which consist of an odd number of ones and even number of zeros.</p>
<ol type = "a">
<li> Not accepted </li>
<li> Not accepted </li>
<li> Not accepted </li>
<li> Not accepted </li>
<li> Not accepted </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>false</single>
<answernumbering>abc</answernumbering>
<answer fraction="-20" format="html">
<text><![CDATA[<p>
011110
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
Not accepted
</p>]]></text>
</feedback>
</answer>
<answer fraction="-20" format="html">
<text><![CDATA[<p>
1001011
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
Not accepted
</p>]]></text>
</feedback>
</answer>
<answer fraction="-20" format="html">
<text><![CDATA[<p>
0110
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
Not accepted
</p>]]></text>
</feedback>
</answer>
<answer fraction="-20" format="html">
<text><![CDATA[<p>
1011010
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
Not accepted
</p>]]></text>
</feedback>
</answer>
<answer fraction="-20" format="html">
<text><![CDATA[<p>
0101110
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
Not accepted
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/boxhist</text>
</category>
</question>


<question type="cloze">
<name>
<text> Q03 : Boxplot and histogram </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>For the 43 observations of the variable <code>x</code> in the data file <a href="@@PLUGINFILE@@/boxhist.csv"><code>boxhist.csv</code></a> draw a histogram, a boxplot and a stripchart. Based on the graphics, answer the following questions or check the correct statements, respectively. <em>(Comment: The tolerance for numeric answers is <span class="math inline">\(\pm0.4\)</span>, the true/false statements are either about correct or clearly wrong.)</em></p>
<ol type = "a">
<li> {1:MULTICHOICE:=The distribution is unimodal.~The distribution is <em>not</em> unimodal.} </li>
<li> {1:MULTICHOICE:The distribution is symmetric.~=The distribution is right-skewed.~The distribution is left-skewed.} </li>
<li> {1:MULTICHOICE:=The boxplot shows outliers.~The boxplot shows <em>no</em> outliers.} </li>
<li> A quarter of the observations is smaller than which value? {1:NUMERICAL:=0.27:0.4} </li>
<li> A quarter of the observations is greater than which value? {1:NUMERICAL:=1.11:0.4} </li>
<li> Half of the observations are greater than which value? {1:NUMERICAL:=0.38:0.4} </li>
</ol>
</p>]]></text>
<file name="boxhist.csv" encoding="base64">eAotMC4wMwowLjY4CjAuMjEKMC4zMwowLjM1CjAuMwowLjExCjAuNjkKMTAuMzgKMC43MgoyLjgKMC45NgowLjI0CjAuMjcKMC43CjIuMzEKMS4xMwowLjM4CjAuMDkKMC4xMQoxLjA5CjIuNTUKMS40MgowLjM0CjAuMzgKMC4zMgozLjU5CjAuMTYKMS45MgowLjM4CjAuMzMKMS43MQowLjExCi0wLjA0CjAuNDgKMC4zOAoyLjE4CjAuMzIKMS40CjAuMzQKMC4yMwowLjI3CjAuMzkK</file>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p><img src="@@PLUGINFILE@@/r-exams-org_boxhist-003.png" alt="image" /></p>
<ol type = "a">
<li> True / False </li>
<li> False / True / False </li>
<li> True / False </li>
<li> 0.27 </li>
<li> 1.11 </li>
<li> 0.38 </li>
</ol>
</p>]]></text>
<file name="r-exams-org_boxhist-003.png" encoding="base64">[encoded data, 10200 characters]</file>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>6</defaultgrade>
</question>


<question type="category">
<category>
<text>$course$/rexams/boxhist</text>
</category>
</question>


<question type="cloze">
<name>
<text> Q04 : Boxplot and histogram </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>For the 39 observations of the variable <code>x</code> in the data file <a href="@@PLUGINFILE@@/boxhist.csv"><code>boxhist.csv</code></a> draw a histogram, a boxplot and a stripchart. Based on the graphics, answer the following questions or check the correct statements, respectively. <em>(Comment: The tolerance for numeric answers is <span class="math inline">\(\pm0.2\)</span>, the true/false statements are either about correct or clearly wrong.)</em></p>
<table>
<tbody>
<tr class="odd">
<td align="left">The distribution is unimodal:</td>
<td align="right">{1:MULTICHOICE:=true~false}</td>
</tr>
<tr class="even">
<td align="left">The distribution is:</td>
<td align="right">{1:MULTICHOICE:=symmetric~right-skewed~left-skewed}</td>
</tr>
<tr class="odd">
<td align="left">The boxplot shows outliers:</td>
<td align="right">{1:MULTICHOICE:=true~false}</td>
</tr>
<tr class="even">
<td align="left">A quarter of the observations is smaller than:</td>
<td align="right"> {1:NUMERICAL:=0.235:0.2}</td>
</tr>
<tr class="odd">
<td align="left">A quarter of the observations is greater than:</td>
<td align="right"> {1:NUMERICAL:=1.64:0.2}</td>
</tr>
<tr class="even">
<td align="left">Half of the observations are smaller than:</td>
<td align="right"> {1:NUMERICAL:=0.87:0.2}</td>
</tr>
</tbody>
</table>
</p>]]></text>
<file name="boxhist.csv" encoding="base64">eAoxLjU3Ci0wLjE4CjMuMTQKMC41NwoyCjAuOTMKMS4xOAowLjk5CjAuMDYKMS4zOQowLjc3CjAuOAoyLjU3CjAuMzUKMi4yNAowLjIxCjAuODcKLTAuNTcKLTEuMjIKMy4xMQowLjQ1CjEuMzkKMC4xCjEuNzIKMS45CjMuNzgKLTAuMjkKMi4xNwotMC4xNgowLjc1CjAuNDEKMC42MwoxLjEKMS44MQoxLjI3CjEuNDEKMC4yNgowLjE2Ci0wLjY2Cg==</file>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p><img src="@@PLUGINFILE@@/r-exams-org_boxhist2-003.png" alt="image" /></p>
<ol type = "a">
<li> True / False </li>
<li> True / False / False </li>
<li> True / False </li>
<li> 0.235 </li>
<li> 1.64 </li>
<li> 0.87 </li>
</ol>
</p>]]></text>
<file name="r-exams-org_boxhist2-003.png" encoding="base64">[encoded data, 11600 characters]</file>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>6</defaultgrade>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 05</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q05 : r-exams-org_boxplots </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>In the following figure the distributions of a variable given by two samples (A and B) are represented by parallel boxplots. Which of the following statements are correct? <em>(Comment: The statements are either about correct or clearly wrong.)</em></p>
<p><img src="@@PLUGINFILE@@/r-exams-org_boxplots-002.png" alt="image" /></p>
</p>]]></text>
<file name="r-exams-org_boxplots-002.png" encoding="base64">[encoded data, 5204 characters]</file>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<ol type = "a">
<li> False. Distribution B has on average higher values than distribution A. </li>
<li> False. There are observations which deviate more than 1.5 times the interquartile range from the median. </li>
<li> True. The interquartile range in sample A is clearly bigger than in B. </li>
<li> True. The skewness of both distributions is similar, both are right-skewed. </li>
<li> False. Distribution A is right-skewed. </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>false</single>
<answernumbering>abc</answernumbering>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
The location of both distributions is about the same.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. Distribution B has on average higher values than distribution A.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
Both distributions contain no outliers.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. There are observations which deviate more than 1.5 times the interquartile range from the median.
</p>]]></text>
</feedback>
</answer>
<answer fraction="50" format="html">
<text><![CDATA[<p>
The spread in sample A is clearly bigger than in B.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. The interquartile range in sample A is clearly bigger than in B.
</p>]]></text>
</feedback>
</answer>
<answer fraction="50" format="html">
<text><![CDATA[<p>
The skewness of both samples is similar.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. The skewness of both distributions is similar, both are right-skewed.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
Distribution A is left-skewed.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. Distribution A is right-skewed.
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 06</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q06 : r-exams-org_capitals </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>Which of the following cities are the capital of the corresponding country?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<ol type = "a">
<li> False. The capital of New Zealand is Wellington. </li>
<li> True. Astana is the capital of Kazakhstan. </li>
<li> False. The capital of Turkey is Ankara. </li>
<li> False. The de facto capital of Switzerland is Bern. </li>
<li> True. Tokyo is the capital of Japan. </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>false</single>
<answernumbering>abc</answernumbering>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
Auckland (New Zealand)
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The capital of New Zealand is Wellington.
</p>]]></text>
</feedback>
</answer>
<answer fraction="50" format="html">
<text><![CDATA[<p>
Astana (Kazakhstan)
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. Astana is the capital of Kazakhstan.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
Istanbul (Turkey)
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The capital of Turkey is Ankara.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
Z<span>ü</span>rich (Switzerland)
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The de facto capital of Switzerland is Bern.
</p>]]></text>
</feedback>
</answer>
<answer fraction="50" format="html">
<text><![CDATA[<p>
Tokyo (Japan)
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. Tokyo is the capital of Japan.
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 07</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q07 : r-exams-org_cholesky </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>For the matrix <span class="math display">\[\begin{aligned}
  A &amp;= \left( \begin{array}{rrrr}  16 &amp; -12 &amp; -16 &amp;  16 \\ -12 &amp;  34 &amp;  27 &amp;   3 \\ -16 &amp;  27 &amp;  34 &amp;  -7 \\  16 &amp;   3 &amp;  -7 &amp;  41 \end{array} \right).\end{aligned}\]</span> compute the matrix <span class="math inline">\(L = (\ell_{ij})_{1 \leq i,j \leq 4}\)</span> from the Cholesky decomposition <span class="math inline">\(A = L L^\top\)</span>.</p>
<p>Which of the following statements are true?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The decomposition yields <span class="math display">\[\begin{aligned}
  L &amp;= \left( \begin{array}{rrrr}  4 &amp;  0 &amp;  0 &amp;  0 \\ -3 &amp;  5 &amp;  0 &amp;  0 \\ -4 &amp;  3 &amp;  3 &amp;  0 \\  4 &amp;  3 &amp;  0 &amp;  4 \end{array} \right)\end{aligned}\]</span> and hence:</p>
<ol type = "a">
<li> True. <span class="math inline">\(\ell_{33} = 3\)</span> </li>
<li> False. <span class="math inline">\(\ell_{32} = 3 \ngtr 3\)</span> </li>
<li> True. <span class="math inline">\(\ell_{41} = 4\)</span> </li>
<li> True. <span class="math inline">\(\ell_{11} = 4\)</span> </li>
<li> False. <span class="math inline">\(\ell_{21} = -3 \nless -3\)</span> </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>false</single>
<answernumbering>abc</answernumbering>
<answer fraction="33.33333" format="html">
<text><![CDATA[<p>
<span class="math inline">\(\ell_{33} = 3\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. <span class="math inline">\(\ell_{33} = 3\)</span>
</p>]]></text>
</feedback>
</answer>
<answer fraction="-50" format="html">
<text><![CDATA[<p>
<span class="math inline">\(\ell_{32} &gt; 3\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. <span class="math inline">\(\ell_{32} = 3 \ngtr 3\)</span>
</p>]]></text>
</feedback>
</answer>
<answer fraction="33.33333" format="html">
<text><![CDATA[<p>
<span class="math inline">\(\ell_{41} = 4\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. <span class="math inline">\(\ell_{41} = 4\)</span>
</p>]]></text>
</feedback>
</answer>
<answer fraction="33.33333" format="html">
<text><![CDATA[<p>
<span class="math inline">\(\ell_{11} = 4\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. <span class="math inline">\(\ell_{11} = 4\)</span>
</p>]]></text>
</feedback>
</answer>
<answer fraction="-50" format="html">
<text><![CDATA[<p>
<span class="math inline">\(\ell_{21} &lt; -3\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. <span class="math inline">\(\ell_{21} = -3 \nless -3\)</span>
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 08</text>
</category>
</question>


<question type="numerical">
<name>
<text> Q08 : r-exams-org_confint </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>The daily expenses of summer tourists in Vienna are analyzed. A survey with <span class="math inline">\(106\)</span> tourists is conducted. This shows that the tourists spend on average <span class="math inline">\(133\)</span> EUR. The sample variance <span class="math inline">\(s^2_{n-1}\)</span> is equal to <span class="math inline">\(154.2\)</span>.</p>
<p>Determine a <span class="math inline">\(95\%\)</span> confidence interval for the average daily expenses (in EUR) of a tourist.</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The <span class="math inline">\(95\%\)</span> confidence interval for the average expenses <span class="math inline">\(\mu\)</span> is given by: <span class="math display">\[\begin{aligned}
&amp;   &amp; \left[\bar{y} \, - \, 1.96\sqrt{\frac{s_{n-1}^2}{n}}, \; 
  \bar{y} \, + \, 1.96\sqrt{\frac{s_{n-1}^2}{n}}\right] \\
&amp; = &amp; \left[ 133 \, - \, 1.96\sqrt{\frac{154.2}{106}}, \;
             133 \, + \, 1.96\sqrt{\frac{154.2}{106}}\right] \\
&amp; = &amp; \left[130.636, \, 135.364\right].\end{aligned}\]</span></p>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<answer fraction="100" format="moodle_auto_format">
<text>130.636</text>
<text>135.364</text>
<tolerance>0.01</tolerance>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 09</text>
</category>
</question>


<question type="cloze">
<name>
<text> Q09 : r-exams-org_confint2 </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>The daily expenses of summer tourists in Vienna are analyzed. A survey with <span class="math inline">\(132\)</span> tourists is conducted. This shows that the tourists spend on average <span class="math inline">\(119.1\)</span> EUR. The sample variance <span class="math inline">\(s^2_{n-1}\)</span> is equal to <span class="math inline">\(135.7\)</span>.</p>
<p>Determine a <span class="math inline">\(95\%\)</span> confidence interval for the average daily expenses (in EUR) of a tourist.</p>
<ol type = "a">
<li> What is the lower confidence bound? {1:NUMERICAL:=117.113:0.01} </li>
<li> What is the upper confidence bound? {1:NUMERICAL:=121.087:0.01} </li>
</ol>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The <span class="math inline">\(95\%\)</span> confidence interval for the average expenses <span class="math inline">\(\mu\)</span> is given by: <span class="math display">\[\begin{aligned}
&amp;   &amp; \left[\bar{y} \, - \, 1.96\sqrt{\frac{s_{n-1}^2}{n}}, \; 
  \bar{y} \, + \, 1.96\sqrt{\frac{s_{n-1}^2}{n}}\right] \\
&amp; = &amp; \left[ 119.1 \, - \, 1.96\sqrt{\frac{135.7}{132}}, \;
             119.1 \, + \, 1.96\sqrt{\frac{135.7}{132}}\right] \\
&amp; = &amp; \left[117.113, \, 121.087\right].\end{aligned}\]</span></p>
<ol type = "a">
<li> The lower confidence bound is <span class="math inline">\(117.113\)</span>. </li>
<li> The upper confidence bound is <span class="math inline">\(121.087\)</span>. </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>2</defaultgrade>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 10</text>
</category>
</question>


<question type="cloze">
<name>
<text> Q10 : r-exams-org_confint3 </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>It is suspected that a supplier systematically underfills 5 l canisters of detergent. The filled volumes are assumed to be normally distributed. A small sample of <span class="math inline">\(10\)</span> canisters is measured exactly. This shows that the canisters contain on average <span class="math inline">\(4978.6\)</span> ml. The sample variance <span class="math inline">\(s^2_{n-1}\)</span> is equal to <span class="math inline">\(2045.3\)</span>.</p>
<p>Determine a <span class="math inline">\(99\%\)</span> confidence interval for the average content of a canister (in ml).</p>
<ol type = "a">
<li> What is the lower confidence bound? {1:NUMERICAL:=4932.123:0.1~%50%4941.762:0.1#Approximately normal instead of exact t solution.} </li>
<li> What is the upper confidence bound? {1:NUMERICAL:=5025.077:0.1~%50%5015.438:0.1#Approximately normal instead of exact t solution.} </li>
</ol>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The <span class="math inline">\(99\%\)</span> confidence interval for the average content <span class="math inline">\(\mu\)</span> in ml is given by: <span class="math display">\[\begin{aligned}
&amp;   &amp; \left[\bar{y} \, - \, t_{n-1;0.995}\sqrt{\frac{s_{n-1}^2}{n}}, \;
  \bar{y} \, + \, t_{n-1;0.995}\sqrt{\frac{s_{n-1}^2}{n}}\right] \\
&amp; = &amp; \left[ 4978.6 \, - \, 3.2498\sqrt{\frac{2045.3}{10}}, \;
             4978.6 \, + \, 3.2498\sqrt{\frac{2045.3}{10}}\right] \\
&amp; = &amp; \left[4932.123, \, 5025.077\right].\end{aligned}\]</span></p>
<ol type = "a">
<li> The lower confidence bound is <span class="math inline">\(4932.123\)</span>. </li>
<li> The upper confidence bound is <span class="math inline">\(5025.077\)</span>. </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>2</defaultgrade>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 11</text>
</category>
</question>


<question type="shortanswer">
<name>
<text> Q11 : r-exams-org_countrycodes </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>What is the three-letter country code (ISO 3166-1 alpha-3) for Brunei?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The ISO 3166-1 alpha-3 code for Brunei is BRN.</p>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<usecase>0</usecase>
<answer fraction="100" format="moodle_auto_format">
<text>
BRN
</text>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 12</text>
</category>
</question>


<question type="numerical">
<name>
<text> Q12 : r-exams-org_currency8 </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>On 2013-05-03 one Euro (€) was buying 1.3109 US Dollars ($) and 0.8431 British Pounds (£). At Frankfurter Börse around noon adidas AG was the largest winner compared with the day before with a price of € 84.8492 per share. If you buy 77 shares, how much are they worth in €?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The worth in € is the number of shares <span class="math inline">\(\times\)</span> stock price <span class="math inline">\(\times\)</span> exchange rate, i.e., <span class="math inline">\(77 \times 84.8492 \times 1 \approx 6533.388\)</span>.</p>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<answer fraction="100" format="moodle_auto_format">
<text>6533.388</text>
<tolerance>0.01</tolerance>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 13</text>
</category>
</question>


<question type="numerical">
<name>
<text> Q13 : r-exams-org_deriv </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>What is the derivative of <span class="math inline">\(f(x) = x^{8} e^{3.6x}\)</span>, evaluated at <span class="math inline">\(x = 0.76\)</span>?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>Using the product rule for <span class="math inline">\(f(x) = g(x) \cdot h(x)\)</span>, where <span class="math inline">\(g(x) := x^{8}\)</span> and <span class="math inline">\(h(x) := e^{3.6x}\)</span>, we obtain <span class="math display">\[\begin{aligned}
f&#39;(x) &amp; = &amp; [g(x) \cdot h(x)]&#39; = g&#39;(x) \cdot h(x) + g(x) \cdot h&#39;(x) \\
      &amp; = &amp; 8 x^{8 - 1} \cdot e^{3.6x} + x^{8} \cdot e^{3.6x} \cdot 3.6 \\
      &amp; = &amp; e^{3.6x} \cdot(8 x^7 + 3.6 x^{8}) \\
      &amp; = &amp; e^{3.6x} \cdot x^7 \cdot (8 + 3.6x).\end{aligned}\]</span> Evaluated at <span class="math inline">\(x = 0.76\)</span>, the answer is <span class="math display">\[e^{3.6\cdot 0.76} \cdot 0.76^7 \cdot (8 + 3.6\cdot 0.76) = 24.253105.\]</span> Thus, rounded to two digits we have <span class="math inline">\(f&#39;(0.76) = 24.25\)</span>.</p>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<answer fraction="100" format="moodle_auto_format">
<text>24.25</text>
<tolerance>0.01</tolerance>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 14</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q14 : r-exams-org_deriv2 </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>What is the derivative of <span class="math inline">\(f(x) = x^{2} e^{3.9x}\)</span>, evaluated at <span class="math inline">\(x = 0.65\)</span>?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>Using the product rule for <span class="math inline">\(f(x) = g(x) \cdot h(x)\)</span>, where <span class="math inline">\(g(x) := x^{2}\)</span> and <span class="math inline">\(h(x) := e^{3.9x}\)</span>, we obtain <span class="math display">\[\begin{aligned}
f&#39;(x) &amp; = &amp; [g(x) \cdot h(x)]&#39; = g&#39;(x) \cdot h(x) + g(x) \cdot h&#39;(x) \\
      &amp; = &amp; 2 x^{2 - 1} \cdot e^{3.9x} + x^{2} \cdot e^{3.9x} \cdot 3.9 \\
      &amp; = &amp; e^{3.9x} \cdot(2 x^1 + 3.9 x^{2}) \\
      &amp; = &amp; e^{3.9x} \cdot x^1 \cdot (2 + 3.9x).\end{aligned}\]</span> Evaluated at <span class="math inline">\(x = 0.65\)</span>, the answer is <span class="math display">\[e^{3.9\cdot 0.65} \cdot 0.65^1 \cdot (2 + 3.9\cdot 0.65) = 37.190084.\]</span> Thus, rounded to two digits we have <span class="math inline">\(f&#39;(0.65) = 37.19\)</span>.</p>
<ol type = "a">
<li> False </li>
<li> False </li>
<li> True </li>
<li> False </li>
<li> False </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>true</single>
<answernumbering>abc</answernumbering>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(16.40\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(28.02\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p>
<span class="math inline">\(37.19\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(21.98\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(21.73\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 15</text>
</category>
</question>


<question type="numerical">
<name>
<text> Q15 : r-exams-org_dist </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>What is the distance between the two points <span class="math inline">\(p = (2, 4)\)</span> and <span class="math inline">\(q = (5, 5)\)</span> in a Cartesian coordinate system?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The distance <span class="math inline">\(d\)</span> of <span class="math inline">\(p\)</span> and <span class="math inline">\(q\)</span> is given by <span class="math inline">\(d^2 = (p_1 - q_1)^2 + (p_2 - q_2)^2\)</span> (Pythagorean formula).</p>
<p>Hence <span class="math inline">\(d = \sqrt{(p_1 - q_1)^2 + (p_2 - q_2)^2} =
  \sqrt{(2 - 5)^2 + (4 - 5)^2}
   = 3.162\)</span>.</p>
<p><img src="@@PLUGINFILE@@/r-exams-org_dist-002.png" alt="image" /></p>
</p>]]></text>
<file name="r-exams-org_dist-002.png" encoding="base64">[encoded data, 20660 characters]</file>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<answer fraction="100" format="moodle_auto_format">
<text>3.162</text>
<tolerance>0.01</tolerance>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 16</text>
</category>
</question>


<question type="cloze">
<name>
<text> Q16 : r-exams-org_dist2 </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>Given two points <span class="math inline">\(p = (1, 3)\)</span> and <span class="math inline">\(q = (3, 5)\)</span> in a Cartesian coordinate system:</p>
<ol type = "a">
<li> What is the Manhattan distance <span class="math inline">\(d_1(p, q)\)</span>? {1:NUMERICAL:=4:0.01} </li>
<li> What is the Euclidean distance <span class="math inline">\(d_2(p, q)\)</span>? {1:NUMERICAL:=2.828:0.01} </li>
<li> What is the maximum distance <span class="math inline">\(d_\infty(p, q)\)</span>? {1:NUMERICAL:=2:0.01} </li>
</ol>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The distances are visualized below in green (<span class="math inline">\(d_1\)</span>), red (<span class="math inline">\(d_2\)</span>), and blue (<span class="math inline">\(d_\infty\)</span>).</p>
<p><img src="@@PLUGINFILE@@/r-exams-org_dist2-002.png" alt="image" /></p>
<ol type = "a">
<li> <span class="math inline">\(d_1(p, q) = \sum_i |p_i - q_i| = |1 - 3| +     |3 - 5| = 4\)</span>. </li>
<li> <span class="math inline">\(d_2(p, q) = \sqrt{\sum_i (p_i - q_i)^2} = \sqrt{(1 -     3)^2 + (3 - 5)^2} = 2.828\)</span>. </li>
<li> <span class="math inline">\(d_\infty(p, q) = \max_i |p_i - q_i| = \max(|1 -     3|, |3 - 5|) = 2\)</span>. </li>
</ol>
</p>]]></text>
<file name="r-exams-org_dist2-002.png" encoding="base64">[encoded data, 20856 characters]</file>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>3</defaultgrade>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 17</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q17 : r-exams-org_dist3 </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>What is the distance between the two points <span class="math inline">\(p = (2, 3)\)</span> and <span class="math inline">\(q = (4, 2)\)</span> in a Cartesian coordinate system?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The distance <span class="math inline">\(d\)</span> of <span class="math inline">\(p\)</span> and <span class="math inline">\(q\)</span> is given by <span class="math inline">\(d^2 = (p_1 - q_1)^2 + (p_2 - q_2)^2\)</span> (Pythagorean formula).</p>
<p>Hence <span class="math inline">\(d = \sqrt{(p_1 - q_1)^2 + (p_2 - q_2)^2} =
  \sqrt{(2 - 4)^2 + (3 - 2)^2}
   = 2.236\)</span>.</p>
<p><img src="@@PLUGINFILE@@/r-exams-org_dist3-003.png" alt="image" /></p>
<ol type = "a">
<li> False </li>
<li> False </li>
<li> False </li>
<li> True </li>
<li> False </li>
</ol>
</p>]]></text>
<file name="r-exams-org_dist3-003.png" encoding="base64">[encoded data, 20868 characters]</file>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>true</single>
<answernumbering>abc</answernumbering>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(3.055\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(6.233\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(7.810\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p>
<span class="math inline">\(2.236\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(0.376\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 18</text>
</category>
</question>


<question type="essay">
<name>
<text> Q18 : r-exams-org_essayreg </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>Consider the following regression results:</p>
<pre><code>Call:
lm(formula = y ~ x, data = d)

Residuals:
     Min       1Q   Median       3Q      Max 
-1.86125 -0.53222 -0.07195  0.57294  2.78071 

Coefficients:
            Estimate Std. Error t value Pr(&gt;|t|)
(Intercept) -0.08941    0.11695  -0.764    0.448
x           -0.91396    0.11132  -8.210 1.91e-11

Residual standard error: 0.9244 on 61 degrees of freedom
Multiple R-squared:  0.525, Adjusted R-squared:  0.5172 
F-statistic: 67.41 on 1 and 61 DF,  p-value: 1.912e-11</code></pre>
<p>Describe how the response <code>y</code> depends on the regressor <code>x</code>.</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The presented results describe a linear regression.</p>
<p>The mean of the response <code>y</code> decreases with increasing <code>x</code>.</p>
<p>If <code>x</code> increases by <span class="math inline">\(1\)</span> unit then a change of <code>y</code> by about <span class="math inline">\(-0.91\)</span> units can be expected.</p>
<p>Also, the effect of <code>x</code> is significant at the <span class="math inline">\(5\)</span> percent level.</p>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<responseformat>editor</responseformat>
<responserequired>0</responserequired>
<responsefieldlines>5</responsefieldlines>
<attachments>1</attachments>
<attachmentsrequired>0</attachmentsrequired>

</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 19</text>
</category>
</question>


<question type="cloze">
<name>
<text> Q19 : r-exams-org_fourfold </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>An industry-leading company seeks a qualified candidate for a management position. A management consultancy carries out an assessment center which concludes in making a positive or negative recommendation for each candidate: From previous assessments they know that of those candidates that are actually eligible for the position (event <span class="math inline">\(E\)</span>) <span class="math inline">\(63\%\)</span> get a positive recommendation (event <span class="math inline">\(R\)</span>). However, out of those candidates that are not eligible <span class="math inline">\(73\%\)</span> get a negative recommendation. Overall, they know that only <span class="math inline">\(11\%\)</span> of all job applicants are actually eligible.</p>
<p>What is the corresponding fourfold table of the joint probabilities? (Specify all entries in percent.)</p>
<ol type = "a">
<li> <span class="math inline">\(P(E \cap R)\)</span> {1:NUMERICAL:=6.93:0.05} </li>
<li> <span class="math inline">\(P(\overline{E} \cap R)\)</span> {1:NUMERICAL:=24.03:0.05} </li>
<li> <span class="math inline">\(P(E \cap \overline{R})\)</span> {1:NUMERICAL:=4.07:0.05} </li>
<li> <span class="math inline">\(P(\overline{E} \cap \overline{R})\)</span> {1:NUMERICAL:=64.97:0.05} </li>
</ol>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>Using the information from the text, we can directly calculate the following joint probabilities: <span class="math display">\[\begin{aligned}
  P(E \cap R) &amp; = &amp;
    P(R | E) \cdot P(E) = 0.63 \cdot 0.11 = 0.0693 = 6.93\%\\
  P(\overline{E} \cap \overline{R}) &amp; = &amp;
    P(\overline{R} | \overline{E}) \cdot P(\overline{E}) = 0.73 \cdot 0.89 = 0.6497 = 64.97\%.\end{aligned}\]</span> The remaining probabilities can then be found by calculating sums and differences in the fourfold table:</p>
<table>
<thead>
<tr class="header">
<th align="center"></th>
<th align="center"> <span class="math inline">\(R\)</span> </th>
<th align="center"> <span class="math inline">\(\overline{R}\)</span> </th>
<th align="center">sum</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"> <span class="math inline">\(E\)</span> </td>
<td align="center"> <span><strong>6.93</strong></span> </td>
<td align="center"> <span><em>4.07</em></span> </td>
<td align="center"> <span><strong>11.00</strong></span> </td>
</tr>
<tr class="even">
<td align="center"> <span class="math inline">\(\overline{E}\)</span> </td>
<td align="center"> <span><em>24.03</em></span> </td>
<td align="center"> <span><strong>64.97</strong></span> </td>
<td align="center"> <span><em>89.00</em></span> </td>
</tr>
<tr class="odd">
<td align="center">sum</td>
<td align="center"> <span><em>30.96</em></span> </td>
<td align="center"> <span><em>69.04</em></span> </td>
<td align="center"> <span><strong>100.00</strong></span> </td>
</tr>
</tbody>
</table>
<ol type = "a">
<li> <span class="math inline">\(P(E \cap R) =  6.93\%\)</span> </li>
<li> <span class="math inline">\(P(\overline{E} \cap R) = 24.03\%\)</span> </li>
<li> <span class="math inline">\(P(E \cap \overline{R}) =  4.07\%\)</span> </li>
<li> <span class="math inline">\(P(\overline{E} \cap \overline{R}) = 64.97\%\)</span> </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>4</defaultgrade>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 20</text>
</category>
</question>


<question type="cloze">
<name>
<text> Q20 : r-exams-org_fourfold2 </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>An industry-leading company seeks a qualified candidate for a management position. A management consultancy carries out an assessment center which concludes in making a positive or negative recommendation for each candidate: From previous assessments they know that of those candidates that are actually eligible for the position (event <span class="math inline">\(E\)</span>) <span class="math inline">\(77\%\)</span> get a positive recommendation (event <span class="math inline">\(R\)</span>). However, out of those candidates that are not eligible <span class="math inline">\(67\%\)</span> get a negative recommendation. Overall, they know that only <span class="math inline">\(14\%\)</span> of all job applicants are actually eligible.</p>
<p>What is the corresponding fourfold table of the joint probabilities? (Specify all entries in percent.)</p>
<table>
<thead>
<tr class="header">
<th align="center"></th>
<th align="center"> <span class="math inline">\(R\)</span> </th>
<th align="center"> <span class="math inline">\(\overline{R}\)</span> </th>
<th align="center">sum</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"> <span class="math inline">\(E\)</span> </td>
<td align="center">  {1:NUMERICAL:=10.78:0.05~%0%10:0}% </td>
<td align="center">  {1:NUMERICAL:=3.22:0.05~%0%10:0}% </td>
<td align="center">  {1:NUMERICAL:=14:0.05~%0%10:0}% </td>
</tr>
<tr class="even">
<td align="center"> <span class="math inline">\(\overline{E}\)</span> </td>
<td align="center">  {1:NUMERICAL:=28.38:0.05~%0%10:0}% </td>
<td align="center">  {1:NUMERICAL:=57.62:0.05~%0%10:0}% </td>
<td align="center">  {1:NUMERICAL:=86:0.05~%0%10:0}% </td>
</tr>
<tr class="odd">
<td align="center">sum</td>
<td align="center">  {1:NUMERICAL:=39.16:0.05~%0%10:0}% </td>
<td align="center">  {1:NUMERICAL:=60.84:0.05~%0%10:0}% </td>
<td align="center">  {1:NUMERICAL:=100:0.05~%0%10:0}% </td>
</tr>
</tbody>
</table>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>Using the information from the text, we can directly calculate the following joint probabilities: <span class="math display">\[\begin{aligned}
  P(E \cap R) &amp; = &amp;
    P(R | E) \cdot P(E) = 0.77 \cdot 0.14 = 0.1078 = 10.78\%\\
  P(\overline{E} \cap \overline{R}) &amp; = &amp;
    P(\overline{R} | \overline{E}) \cdot P(\overline{E}) = 0.67 \cdot 0.86 = 0.5762 = 57.62\%.\end{aligned}\]</span> The remaining probabilities can then be found by calculating sums and differences in the fourfold table:</p>
<table>
<thead>
<tr class="header">
<th align="center"></th>
<th align="center"> <span class="math inline">\(R\)</span> </th>
<th align="center"> <span class="math inline">\(\overline{R}\)</span> </th>
<th align="center">sum</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"> <span class="math inline">\(E\)</span> </td>
<td align="center"> <span><strong>10.78</strong></span> </td>
<td align="center"> <span><em>3.22</em></span> </td>
<td align="center"> <span><strong>14.00</strong></span> </td>
</tr>
<tr class="even">
<td align="center"> <span class="math inline">\(\overline{E}\)</span> </td>
<td align="center"> <span><em>28.38</em></span> </td>
<td align="center"> <span><strong>57.62</strong></span> </td>
<td align="center"> <span><em>86.00</em></span> </td>
</tr>
<tr class="odd">
<td align="center">sum</td>
<td align="center"> <span><em>39.16</em></span> </td>
<td align="center"> <span><em>60.84</em></span> </td>
<td align="center"> <span><strong>100.00</strong></span> </td>
</tr>
</tbody>
</table>
<ol type = "a">
<li> <span class="math inline">\(P(E \cap R) =  10.78\%\)</span> </li>
<li> <span class="math inline">\(P(\overline{E} \cap R) =  28.38\%\)</span> </li>
<li> <span class="math inline">\(P(E \cap \overline{R}) =   3.22\%\)</span> </li>
<li> <span class="math inline">\(P(\overline{E} \cap \overline{R}) =  57.62\%\)</span> </li>
<li> <span class="math inline">\(P(R) =  39.16\%\)</span> </li>
<li> <span class="math inline">\(P(\overline{R}) =  60.84\%\)</span> </li>
<li> <span class="math inline">\(P(E) =  14.00\%\)</span> </li>
<li> <span class="math inline">\(P(\overline{E}) =  86.00\%\)</span> </li>
<li> <span class="math inline">\(P(\Omega) = 100.00\%\)</span> </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>9</defaultgrade>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 21</text>
</category>
</question>


<question type="numerical">
<name>
<text> Q21 : r-exams-org_fruit </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>Given the following information:</p>
<table>
<tbody>
<tr class="odd">
<td align="center"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/pineapple.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center">=</td>
<td align="right"><span class="math inline">\(597\)</span></td>
</tr>
<tr class="even">
<td align="center"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/banana.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/banana.png" style="width:0.85cm" alt="image" /></td>
<td align="center">=</td>
<td align="right"><span class="math inline">\(119\)</span></td>
</tr>
<tr class="odd">
<td align="center"><img src="@@PLUGINFILE@@/pineapple.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/pineapple.png" style="width:0.85cm" alt="image" /></td>
<td align="center">=</td>
<td align="right"><span class="math inline">\(1035\)</span></td>
</tr>
</tbody>
</table>
<p>Compute:</p>
<table>
<tbody>
<tr class="odd">
<td align="center"><img src="@@PLUGINFILE@@/banana.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/pineapple.png" style="width:0.85cm" alt="image" /></td>
<td align="center">=</td>
<td align="right"><span class="math inline">\(\text{?}\)</span></td>
</tr>
</tbody>
</table>
</p>]]></text>
<file name="pineapple.png" encoding="base64">[encoded data, 18108 characters]</file>
<file name="pineapple.png" encoding="base64">[encoded data, 18108 characters]</file>
<file name="pineapple.png" encoding="base64">[encoded data, 18108 characters]</file>
<file name="pineapple.png" encoding="base64">[encoded data, 18108 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="banana.png" encoding="base64">[encoded data, 9708 characters]</file>
<file name="banana.png" encoding="base64">[encoded data, 9708 characters]</file>
<file name="banana.png" encoding="base64">[encoded data, 9708 characters]</file>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The information provided can be interpreted as the price for three fruit baskets with different combinations of the three fruits. This corresponds to a system of linear equations where the price of the three fruits is the vector of unknowns <span class="math inline">\(x\)</span>:</p>
<table>
<tbody>
<tr class="odd">
<td align="center"><span class="math inline">\(x_1 =\)</span></td>
<td align="left"><img src="@@PLUGINFILE@@/banana.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(x_2 =\)</span></td>
<td align="left"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(x_3 =\)</span></td>
<td align="left"><img src="@@PLUGINFILE@@/pineapple.png" style="width:0.85cm" alt="image" /></td>
</tr>
</tbody>
</table>
<p>The system of linear equations is then: <span class="math display">\[\begin{aligned}
\left( \begin{array}{rrr} 0 &amp; 2 &amp; 1 \\ 2 &amp; 1 &amp; 0 \\ 0 &amp; 1 &amp; 2 \end{array} \right) \cdot \left( \begin{array}{r} x_1 \\ x_2 \\ x_3 \end{array} \right) &amp; = &amp; \left( \begin{array}{r}  597 \\  119 \\ 1035 \end{array} \right)\end{aligned}\]</span> This can be solved using any solution algorithm, e.g., elimination: <span class="math display">\[x_1 = 33, \, x_2 = 53, \, x_3 = 491.\]</span> Based on the three prices for the different fruits it is straightforward to compute the total price of the fourth fruit basket via:</p>
<table>
<tbody>
<tr class="odd">
<td align="center"><img src="@@PLUGINFILE@@/banana.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/pineapple.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(=\)</span></td>
<td align="right"></td>
</tr>
<tr class="even">
<td align="center"><span class="math inline">\(x_1\)</span></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><span class="math inline">\(x_2\)</span></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><span class="math inline">\(x_3\)</span></td>
<td align="center"><span class="math inline">\(=\)</span></td>
<td align="right"></td>
</tr>
<tr class="odd">
<td align="center"><span class="math inline">\(33\)</span></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><span class="math inline">\(53\)</span></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><span class="math inline">\(491\)</span></td>
<td align="center"><span class="math inline">\(=\)</span></td>
<td align="right"><span class="math inline">\(577\)</span>.</td>
</tr>
</tbody>
</table>
</p>]]></text>
<file name="pineapple.png" encoding="base64">[encoded data, 18108 characters]</file>
<file name="pineapple.png" encoding="base64">[encoded data, 18108 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="banana.png" encoding="base64">[encoded data, 9708 characters]</file>
<file name="banana.png" encoding="base64">[encoded data, 9708 characters]</file>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<answer fraction="100" format="moodle_auto_format">
<text>577</text>
<tolerance>0</tolerance>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 22</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q22 : r-exams-org_fruit2 </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>Given the following information:</p>
<table>
<tbody>
<tr class="odd">
<td align="center"><img src="@@PLUGINFILE@@/banana.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/pineapple.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/banana.png" style="width:0.85cm" alt="image" /></td>
<td align="center">=</td>
<td align="right"><span class="math inline">\(497\)</span></td>
</tr>
<tr class="even">
<td align="center"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/banana.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center">=</td>
<td align="right"><span class="math inline">\(272\)</span></td>
</tr>
<tr class="odd">
<td align="center"><img src="@@PLUGINFILE@@/pineapple.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center">=</td>
<td align="right"><span class="math inline">\(505\)</span></td>
</tr>
</tbody>
</table>
<p>Compute:</p>
<table>
<tbody>
<tr class="odd">
<td align="center"><img src="@@PLUGINFILE@@/banana.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/pineapple.png" style="width:0.85cm" alt="image" /></td>
<td align="center">=</td>
<td align="right"><span class="math inline">\(\text{?}\)</span></td>
</tr>
</tbody>
</table>
</p>]]></text>
<file name="pineapple.png" encoding="base64">[encoded data, 18108 characters]</file>
<file name="pineapple.png" encoding="base64">[encoded data, 18108 characters]</file>
<file name="pineapple.png" encoding="base64">[encoded data, 18108 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="banana.png" encoding="base64">[encoded data, 9708 characters]</file>
<file name="banana.png" encoding="base64">[encoded data, 9708 characters]</file>
<file name="banana.png" encoding="base64">[encoded data, 9708 characters]</file>
<file name="banana.png" encoding="base64">[encoded data, 9708 characters]</file>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The information provided can be interpreted as the price for three fruit baskets with different combinations of the three fruits. This corresponds to a system of linear equations where the price of the three fruits is the vector of unknowns <span class="math inline">\(x\)</span>:</p>
<table>
<tbody>
<tr class="odd">
<td align="center"><span class="math inline">\(x_1 =\)</span></td>
<td align="left"><img src="@@PLUGINFILE@@/banana.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(x_2 =\)</span></td>
<td align="left"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(x_3 =\)</span></td>
<td align="left"><img src="@@PLUGINFILE@@/pineapple.png" style="width:0.85cm" alt="image" /></td>
</tr>
</tbody>
</table>
<p>The system of linear equations is then: <span class="math display">\[\begin{aligned}
\left( \begin{array}{rrr} 2 &amp; 0 &amp; 1 \\ 1 &amp; 2 &amp; 0 \\ 0 &amp; 2 &amp; 1 \end{array} \right) \cdot \left( \begin{array}{r} x_1 \\ x_2 \\ x_3 \end{array} \right) &amp; = &amp; \left( \begin{array}{r} 497 \\ 272 \\ 505 \end{array} \right)\end{aligned}\]</span> This can be solved using any solution algorithm, e.g., elimination: <span class="math display">\[x_1 = 88, \, x_2 = 92, \, x_3 = 321.\]</span> Based on the three prices for the different fruits it is straightforward to compute the total price of the fourth fruit basket via:</p>
<table>
<tbody>
<tr class="odd">
<td align="center"><img src="@@PLUGINFILE@@/banana.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/orange.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><img src="@@PLUGINFILE@@/pineapple.png" style="width:0.85cm" alt="image" /></td>
<td align="center"><span class="math inline">\(=\)</span></td>
<td align="right"></td>
</tr>
<tr class="even">
<td align="center"><span class="math inline">\(x_1\)</span></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><span class="math inline">\(x_2\)</span></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><span class="math inline">\(x_3\)</span></td>
<td align="center"><span class="math inline">\(=\)</span></td>
<td align="right"></td>
</tr>
<tr class="odd">
<td align="center"><span class="math inline">\(88\)</span></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><span class="math inline">\(92\)</span></td>
<td align="center"><span class="math inline">\(+\)</span></td>
<td align="center"><span class="math inline">\(321\)</span></td>
<td align="center"><span class="math inline">\(=\)</span></td>
<td align="right"><span class="math inline">\(501\)</span>.</td>
</tr>
</tbody>
</table>
</p>]]></text>
<file name="pineapple.png" encoding="base64">[encoded data, 18108 characters]</file>
<file name="pineapple.png" encoding="base64">[encoded data, 18108 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="orange.png" encoding="base64">[encoded data, 9348 characters]</file>
<file name="banana.png" encoding="base64">[encoded data, 9708 characters]</file>
<file name="banana.png" encoding="base64">[encoded data, 9708 characters]</file>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>true</single>
<answernumbering>abc</answernumbering>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(278\)</span>
</p>]]></text>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(272\)</span>
</p>]]></text>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(321\)</span>
</p>]]></text>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p>
<span class="math inline">\(501\)</span>
</p>]]></text>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(562\)</span>
</p>]]></text>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 23</text>
</category>
</question>


<question type="shortanswer">
<name>
<text> Q23 : r-exams-org_function </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>What is the name of the R function for extracting the estimated covariance matrix from a fitted (generalized) linear model object?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p><code>vcov</code> is the R function for extracting the estimated covariance matrix from a fitted (generalized) linear model object. See <code>?vcov</code> for the corresponding manual page.</p>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<usecase>0</usecase>
<answer fraction="100" format="moodle_auto_format">
<text>
vcov
</text>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 24</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q24 : r-exams-org_gaussmarkov </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>Under the assumptions of the Gauss-Markov theorem the errors of a linear regression model need to be:</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>Under the assumptions of the Gauss-Markov theorem the errors of a linear regression model need to be uncorrelated, homoscedastic, and with mean zero.</p>
<ol type = "a">
<li> True. The errors need to be homoscedastic with finite variance. </li>
<li> False. No distribution assumption is needed. </li>
<li> False. No distribution assumption is needed. </li>
<li> False. Independence is not assumed, only lack of correlation. </li>
<li> True. The errors need to be uncorrelated. </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>false</single>
<answernumbering>abc</answernumbering>
<answer fraction="50" format="html">
<text><![CDATA[<p>
homoscedastic
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. The errors need to be homoscedastic with finite variance.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
normally distributed
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. No distribution assumption is needed.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
identically distributed
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. No distribution assumption is needed.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
independent
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. Independence is not assumed, only lack of correlation.
</p>]]></text>
</feedback>
</answer>
<answer fraction="50" format="html">
<text><![CDATA[<p>
uncorrelated
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. The errors need to be uncorrelated.
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 25</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q25 : r-exams-org_hessian </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>Compute the Hessian of the function <span class="math display">\[\begin{aligned}
  f(x_1, x_2) = 9 x_1^{2} + 4  x_1  x_2 + 9  x_2^{2}\end{aligned}\]</span> at <span class="math inline">\((x_1, x_2) = (4, -1)\)</span>. What is the value of the upper left element?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The first-order partial derivatives are <span class="math display">\[\begin{aligned}
  f&#39;_1(x_1, x_2) &amp;=&amp; 18 x_1 + 4 x_2  \\
  f&#39;_2(x_1, x_2) &amp;=&amp; 4 x_1 + 18 x_2\end{aligned}\]</span> and the second-order partial derivatives are <span class="math display">\[\begin{aligned}
  f&#39;&#39;_{11}(x_1, x_2) &amp;=&amp; 18\\
  f&#39;&#39;_{12}(x_1, x_2) &amp;=&amp; 4\\
  f&#39;&#39;_{21}(x_1, x_2) &amp;=&amp; 4\\
  f&#39;&#39;_{22}(x_1, x_2) &amp;=&amp; 18\end{aligned}\]</span></p>
<p>Therefore the Hessian is <span class="math display">\[\begin{aligned}
  f&#39;&#39;(x_1, x_2) = \left( \begin{array}{rr} 18 &amp;  4 \\  4 &amp; 18 \end{array} \right)\end{aligned}\]</span> independent of <span class="math inline">\(x_1\)</span> and <span class="math inline">\(x_2\)</span>. Thus, the upper left element is: <span class="math inline">\(f&#39;&#39;_{11}(4, -1) = 18\)</span>.</p>
<ol type = "a">
<li> False </li>
<li> True </li>
<li> False </li>
<li> False </li>
<li> False </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>true</single>
<answernumbering>abc</answernumbering>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(-15\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p>
<span class="math inline">\(18\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(-24\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(-6\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(4\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 26</text>
</category>
</question>


<question type="numerical">
<name>
<text> Q26 : r-exams-org_lagrange </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>A firm has the following production function: <span class="math display">\[F(K,L)= K L^{}.\]</span> The price for one unit of <em>capital</em> is <span class="math inline">\(p_K = 4\)</span> and the price for one unit of <em>labor</em> is <span class="math inline">\(p_L = 14\)</span>. Minimize the costs of the firm considering its production function and given a target production output of 460 units.</p>
<p>How high are in this case the minimal costs?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p><em>Step 1</em>: Formulating the minimization problem. <span class="math display">\[\begin{aligned}
\min_{K,L} C(K,L) &amp;=&amp; p_K K + p_L L\\
 &amp;=&amp; 4 K + 14 L\\
\mbox{subject to:} &amp;&amp;  F(K,L) = Q \\
&amp;&amp; K L^{} = 460 \end{aligned}\]</span></p>
<p><em>Step 2</em>: Lagrange function. <span class="math display">\[\begin{aligned}
\mathcal{L}(K, L, \lambda) &amp;=&amp; C(K, L)-\lambda (F(K, L) - Q) \\
&amp;=&amp; 4 K + 14 L - \lambda (K L^{} -460)\end{aligned}\]</span></p>
<p><em>Step 3</em>: First order conditions. <span class="math display">\[\begin{aligned}
\frac{\partial {\mathcal {L}}}{\partial K} &amp; = &amp; 4 - \lambda L^{} = 0\\
\frac{\partial {\mathcal {L}}}{\partial L} &amp; = &amp; 14 - {1} \lambda K L^{1-1} = 0 \\
\frac{\partial {\mathcal {L}}}{\partial \lambda} &amp; = &amp; -(K L^{}-460) = 0\end{aligned}\]</span></p>
<p><em>Step 4</em>: Solve the system of equations for <span class="math inline">\(K\)</span>, <span class="math inline">\(L\)</span>, and <span class="math inline">\(\lambda\)</span>.</p>
<p>Equating Equations (1) and (2) after solving for <span class="math inline">\(\lambda\)</span> gives: <span class="math display">\[\begin{aligned}
\frac{4}{L^{}} &amp; = &amp; \frac{14}{{1} K L^{1-1}}\\
K &amp; = &amp; \frac{14}{1 \cdot 4} \cdot L^{1 - (1 -1)}\\
K &amp; = &amp; \frac{14}{4} \cdot L\end{aligned}\]</span></p>
<p>Substituting this in the optimization constraint gives: <span class="math display">\[\begin{aligned}
K L^{} &amp; = &amp; 460\\
\left(\frac{14}{4}\cdot L \right) L^{} &amp; = &amp; 460\\
\frac{14}{4} L^{2} &amp; = &amp; 460\\
L &amp; = &amp; \left(\frac{4}{14} \cdot 
460\right)^{\frac{1}{2}} = 11.46423008~\approx~11.46\\
K &amp; = &amp; \frac{14}{4} \cdot L = 40.12480528~\approx~40.12\end{aligned}\]</span></p>
<p>The minimal costs can be obtained by substituting the optimal factor combination in the objective function: <span class="math display">\[\begin{aligned}
 C(K, L) &amp; = &amp; 4 K + 14 L\\
         &amp; = &amp; 160.499221 + 160.499221 \\
         &amp; = &amp; 320.998442 \approx 321.00
 \end{aligned}\]</span> Given the target output, the minimal costs are <span class="math inline">\(321.00\)</span>.</p>
<p><img src="@@PLUGINFILE@@/r-exams-org_lagrange-003.png" alt="image" /></p>
</p>]]></text>
<file name="r-exams-org_lagrange-003.png" encoding="base64">[encoded data, 34168 characters]</file>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<answer fraction="100" format="moodle_auto_format">
<text>321</text>
<tolerance>0.01</tolerance>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 27</text>
</category>
</question>


<question type="cloze">
<name>
<text> Q27 : r-exams-org_lm </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>Using the data provided in <a href="@@PLUGINFILE@@/regression.csv"><code>regression.csv</code></a> estimate a linear regression of <code>y</code> on <code>x</code> and answer the following questions.</p>
<ol type = "a">
<li> {1:MULTICHOICE:<code>x</code> and <code>y</code> are not significantly correlated~<code>y</code> increases significantly with <code>x</code>~=<code>y</code> decreases significantly with <code>x</code>} </li>
<li> Estimated slope with respect to <code>x</code>: {1:NUMERICAL:=-0.641:0.01} </li>
</ol>
</p>]]></text>
<file name="regression.csv" encoding="base64">[encoded data, 4960 characters]</file>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p><img src="@@PLUGINFILE@@/r-exams-org_lm-002.png" alt="image" /></p>
<p>To replicate the analysis in R:</p>
<pre><code>## data
d &lt;- read.csv(&quot;regression.csv&quot;)
## regression
m &lt;- lm(y ~ x, data = d)
summary(m)
## visualization
plot(y ~ x, data = d)
abline(m)</code></pre>
</p>]]></text>
<file name="r-exams-org_lm-002.png" encoding="base64">[encoded data, 15744 characters]</file>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>2</defaultgrade>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 28</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q28 : r-exams-org_logic </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>Consider the following gates coding logical operators:</p>
<table>
<tbody>
<tr class="odd">
<td align="center">A</td>
<td align="center">B</td>
<td align="center">C</td>
</tr>
<tr class="even">
<td align="center"><img src="@@PLUGINFILE@@/A.png" style="width:2.5cm" alt="image" /></td>
<td align="center"><img src="@@PLUGINFILE@@/B.png" style="width:2.5cm" alt="image" /></td>
<td align="center"><img src="@@PLUGINFILE@@/C.png" style="width:2.5cm" alt="image" /></td>
</tr>
</tbody>
</table>
<p>Which of these gates belongs to the following logical truth table?</p>
<p><img src="@@PLUGINFILE@@/table.png" style="width:1.5cm" alt="image" /></p>
</p>]]></text>
<file name="table.png" encoding="base64">[encoded data, 27204 characters]</file>
<file name="C.png" encoding="base64">[encoded data, 12612 characters]</file>
<file name="B.png" encoding="base64">[encoded data, 16452 characters]</file>
<file name="A.png" encoding="base64">[encoded data, 16376 characters]</file>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The truth table codes the logical <strong>or</strong> operator.</p>
<p>The gates displayed code the following logical operators: A = <strong>nor</strong>, B = <strong>or</strong>, C = <strong>nand</strong>.</p>
<p>Hence, the truth table corresponds to: B.</p>
<ol type = "a">
<li> False </li>
<li> True </li>
<li> False </li>
<li> False </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>true</single>
<answernumbering>abc</answernumbering>
<answer fraction="0" format="html">
<text><![CDATA[<p>
A
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p>
B
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
C
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
None of these
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 29</text>
</category>
</question>


<question type="numerical">
<name>
<text> Q29 : r-exams-org_regression </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>For 65 firms the number of employees <span class="math inline">\(X\)</span> and the amount of expenses for continuing education <span class="math inline">\(Y\)</span> (in EUR) were recorded. The statistical summary of the data set is given by:</p>
<table>
<thead>
<tr class="header">
<th align="left"></th>
<th align="center">Variable <span class="math inline">\(X\)</span></th>
<th align="center">Variable <span class="math inline">\(Y\)</span></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">Mean</td>
<td align="center">57</td>
<td align="center">238</td>
</tr>
<tr class="even">
<td align="left">Variance</td>
<td align="center">102</td>
<td align="center">2275</td>
</tr>
</tbody>
</table>
<p>The correlation between <span class="math inline">\(X\)</span> and <span class="math inline">\(Y\)</span> is equal to 0.81.</p>
<p>Estimate the expected amount of money spent for continuing education by a firm with 65 employees using least squares regression.</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>First, the regression line <span class="math inline">\(y_i = \beta_0 + \beta_1 x_i +
\varepsilon_i\)</span> is determined. The regression coefficients are given by: <span class="math display">\[\begin{aligned}
&amp;&amp; \hat \beta_1 = r \cdot \frac{s_y}{s_x} = 
0.81 \cdot \sqrt{\frac{2275}{102}} = 3.82539, \\
&amp;&amp; \hat \beta_0 = \bar y - \hat \beta_1 \cdot \bar x = 
238 - 3.82539 \cdot 57 = 19.95281.\end{aligned}\]</span></p>
<p>The estimated amount of money spent by a firm with 65 employees is then given by: <span class="math display">\[\begin{aligned}
\hat y = 19.95281 + 3.82539 \cdot 65 = 268.603.\end{aligned}\]</span></p>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<answer fraction="100" format="moodle_auto_format">
<text>268.603</text>
<tolerance>0.01</tolerance>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 30</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q30 : r-exams-org_relfreq </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>In a small city the satisfaction with the local public transportation is evaluated. One question of interest is whether inhabitants of the city center are more satisfied with public transportation compared to those living in the suburbs.</p>
<p>A survey with 250 respondents gave the following contingency table:</p>
<pre><code>           Location
Evaluation  city center suburbs
  very good          17      13
  good               47      24
  bad                26      65
  very bad           10      48</code></pre>
<p>The following table of percentages was constructed:</p>
<pre><code>           Location
Evaluation  city center suburbs    
  very good        56.7        43.3
  good             66.2        33.8
  bad              28.6        71.4
  very bad         17.2        82.8</code></pre>
<p>Which of the following statements are correct?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>In the percentage table, the row sums are about 100 (except for possible rounding errors). Hence, the table provides row percentages, i.e., conditional proportions for location given satisfaction level.</p>
<ol type = "a">
<li> False. The column sums do not give 100. </li>
<li> False. The total sums do not give 100. </li>
<li> True. This evaluation gives row percentages. </li>
<li> False. This is an interpretation of total percentages, but the table gives row percentages. </li>
<li> False. This is an interpretation of column percentages, but the table gives row percentages. </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>false</single>
<answernumbering>abc</answernumbering>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
The percentage table gives the satisfaction distribution for each location type.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The column sums do not give 100.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
The percentage table contains total percentages.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The total sums do not give 100.
</p>]]></text>
</feedback>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p>
The percentage table can be easily constructed from the original contingency table: percentages are calculated for each row.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. This evaluation gives row percentages.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
The value in row 4 and column 1 in the percentage table indicates: 17.2 percent of the respondents live in the city center and evaluated the public tranportation as very bad.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. This is an interpretation of total percentages, but the table gives row percentages.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
The value in row 2 and column 1 in the percentage table indicates: 66.2 percent of the respondents in the city center evaluated the public transportation as good.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. This is an interpretation of column percentages, but the table gives row percentages.
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 31</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q31 : r-exams-org_Rlogo </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>What does the following logo stand for?</p>
<p><img src="@@PLUGINFILE@@/Rlogo.png" alt="image" /></p>
</p>]]></text>
<file name="Rlogo.png" encoding="base64">[encoded data, 26516 characters]</file>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The logo stands for the R system for statistical computing and graphics (<a href="http://www.R-project.org/"><code>http://www.R-project.org/</code></a>).</p>
<ol type = "a">
<li> False. R is an open-source project, not a company. </li>
<li> False. Although R is (also) a letter in the alphabet, this is not what the logo represents. </li>
<li> False. The R project does not sell anything. </li>
<li> True. R is a programming language. </li>
<li> False. R is not a search engine. </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>true</single>
<answernumbering>abc</answernumbering>
<answer fraction="0" format="html">
<text><![CDATA[<p>
Technology company
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. R is an open-source project, not a company.
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
Letter in the alphabet
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. Although R is (also) a letter in the alphabet, this is not what the logo represents.
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
Online retailer
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The R project does not sell anything.
</p>]]></text>
</feedback>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p>
Programming language
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. R is a programming language.
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
Search engine
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. R is not a search engine.
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 32</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q32 : r-exams-org_scatterplot </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>The following figure shows a scatterplot. Which of the following statements are correct?</p>
<p><img src="@@PLUGINFILE@@/r-exams-org_scatterplot-002.png" alt="image" /></p>
</p>]]></text>
<file name="r-exams-org_scatterplot-002.png" encoding="base64">[encoded data, 25544 characters]</file>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<ol type = "a">
<li> False. The regression line at <span class="math inline">\(X=-49.9\)</span> implies a value of about <span class="math inline">\(Y = 61\)</span>. </li>
<li> False. Only a slightly positive association between the variables is observable in the scatterplot. This implies a correlation coefficient with an absolute value smaller than <span class="math inline">\(0.8\)</span>. </li>
<li> False. The slope of the regression line is given by <span class="math inline">\(r \cdot s_y/s_x\)</span> and hence not about equal to <span class="math inline">\(1\)</span>. </li>
<li> False. The standard deviation of <span class="math inline">\(X\)</span> is about equal to <span class="math inline">\(1\)</span> and is therefore smaller than <span class="math inline">\(6\)</span>. </li>
<li> True. The mean of <span class="math inline">\(Y\)</span> is about equal to <span class="math inline">\(60\)</span> and hence is larger than <span class="math inline">\(30\)</span>. </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>false</single>
<answernumbering>abc</answernumbering>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
For <span class="math inline">\(X =  -49.9\)</span>, <span class="math inline">\(Y\)</span> can be expected to be about 21 .
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The regression line at <span class="math inline">\(X=-49.9\)</span> implies a value of about <span class="math inline">\(Y = 61\)</span>.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
The absolute value of the correlation coefficient is at least <span class="math inline">\(0.8\)</span>.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. Only a slightly positive association between the variables is observable in the scatterplot. This implies a correlation coefficient with an absolute value smaller than <span class="math inline">\(0.8\)</span>.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
The slope of the regression line is about <span class="math inline">\(1\)</span>.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The slope of the regression line is given by <span class="math inline">\(r \cdot s_y/s_x\)</span> and hence not about equal to <span class="math inline">\(1\)</span>.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
The standard deviation of <span class="math inline">\(X\)</span> is at least <span class="math inline">\(6\)</span>.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The standard deviation of <span class="math inline">\(X\)</span> is about equal to <span class="math inline">\(1\)</span> and is therefore smaller than <span class="math inline">\(6\)</span>.
</p>]]></text>
</feedback>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p>
The mean of <span class="math inline">\(Y\)</span> is at least <span class="math inline">\(30\)</span>.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. The mean of <span class="math inline">\(Y\)</span> is about equal to <span class="math inline">\(60\)</span> and hence is larger than <span class="math inline">\(30\)</span>.
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 33</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q33 : r-exams-org_swisscapital </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>What is the seat of the federal authorities in Switzerland (i.e., the de facto capital)?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>There is no de jure capital but the de facto capital and seat of the federal authorities is Bern.</p>
<ol type = "a">
<li> False. </li>
<li> False. </li>
<li> False. </li>
<li> True. </li>
<li> False. </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>true</single>
<answernumbering>abc</answernumbering>
<answer fraction="0" format="html">
<text><![CDATA[<p>
Basel
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False.
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
Zurich
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False.
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
Lausanne
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False.
</p>]]></text>
</feedback>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p>
Bern
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True.
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
St. Gallen
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False.
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 34</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q34 : r-exams-org_switzerland </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>Which of the following statements about Switzerland is correct?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<ol type = "a">
<li> False. There is no de jure capital but the de facto capital of Switzerland is Bern. </li>
<li> True. The official languages are: German, French, Italian, Romansh. </li>
<li> False. The currency is the Swiss Franc (CHF). </li>
<li> False. Switzerland is part of the Schengen Area but not the EU. </li>
<li> True. The establishment of the Swiss Confederation is traditionally dated to August 1, 1291. </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>false</single>
<answernumbering>abc</answernumbering>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
Zurich is the capital of Switzerland.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. There is no de jure capital but the de facto capital of Switzerland is Bern.
</p>]]></text>
</feedback>
</answer>
<answer fraction="50" format="html">
<text><![CDATA[<p>
Italian is an official language in Switzerland.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. The official languages are: German, French, Italian, Romansh.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
The currency in Switzerland is the Euro.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The currency is the Swiss Franc (CHF).
</p>]]></text>
</feedback>
</answer>
<answer fraction="-33.33333" format="html">
<text><![CDATA[<p>
Switzerland is part of the European Union (EU).
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. Switzerland is part of the Schengen Area but not the EU.
</p>]]></text>
</feedback>
</answer>
<answer fraction="50" format="html">
<text><![CDATA[<p>
The Swiss national holiday is August 1.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. The establishment of the Swiss Confederation is traditionally dated to August 1, 1291.
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 35</text>
</category>
</question>


<question type="cloze">
<name>
<text> Q35 : r-exams-org_tstat_verbatim </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>Measuring the protein concentration in raw milk you obtain the following sample of <span class="math inline">\(n=17\)</span> observations. Test the two-sided hypothesis <span class="math inline">\(H_0: \mu = 3.5\)</span> given that the sample measurements follow a normal distribution.</p>
<pre><code> [1] 4.29 3.96 4.31 5.09 4.58 4.68 4.10 4.17 4.57 4.83 3.83 4.57 4.08 4.52 3.63 4.41 3.54</code></pre>
<p>Fill in the gaps below:</p>
<ol type = "a">
<li> Mean {1:NUMERICAL:=4.304:0.1} </li>
<li> Variance {1:NUMERICAL:=0.175:0.001~%50%0.175:0.1#Rounding error; correct answer: 0.175} </li>
<li> Test statistic {1:NUMERICAL:=7.916:0.1} </li>
<li> Lower “critical” value {1:NUMERICAL:=-2.921:0.1} </li>
<li> Upper “critical” value {1:NUMERICAL:=2.921:0.1} </li>
<li> {1:MULTICHOICE_V:Keep <span class="math inline">\(H_0\)</span>~=Reject <span class="math inline">\(H_0\)</span>} </li>
</ol>
</p>]]></text>
</questiontext>
<penalty>0</penalty>
<defaultgrade>6</defaultgrade>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 36</text>
</category>
</question>


<question type="numerical">
<name>
<text> Q36 : r-exams-org_tstat </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>A machine fills milk into <span class="math inline">\(250\)</span>ml packages. It is suspected that the machine is not working correctly and that the amount of milk filled differs from the setpoint <span class="math inline">\(\mu_0 = 250\)</span>. A sample of <span class="math inline">\(170\)</span> packages filled by the machine are collected. The sample mean <span class="math inline">\(\bar{y}\)</span> is equal to <span class="math inline">\(236.7\)</span> and the sample variance <span class="math inline">\(s^2_{n-1}\)</span> is equal to <span class="math inline">\(176.81\)</span>.</p>
<p>Test the hypothesis that the amount filled corresponds on average to the setpoint. What is the absolute value of the <span class="math inline">\(t\)</span> test statistic?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The <span class="math inline">\(t\)</span> test statistic is calculated by: <span class="math display">\[\begin{aligned}
  t &amp; = &amp; \frac{\bar y - \mu_0}{\sqrt{\frac{s^2_{n-1}}{n}}}
  = \frac{236.7 - 250}{\sqrt{\frac{176.81}{170}}}
  = -13.041.\end{aligned}\]</span> The absolute value of the <span class="math inline">\(t\)</span> test statistic is thus equal to <span class="math inline">\(13.041\)</span>.</p>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<answer fraction="100" format="moodle_auto_format">
<text>13.041</text>
<tolerance>0.01</tolerance>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 37</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q37 : r-exams-org_tstat2 </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>A machine fills milk into <span class="math inline">\(250\)</span>ml packages. It is suspected that the machine is not working correctly and that the amount of milk filled differs from the setpoint <span class="math inline">\(\mu_0 = 250\)</span>. A sample of <span class="math inline">\(230\)</span> packages filled by the machine are collected. The sample mean <span class="math inline">\(\bar{y}\)</span> is equal to <span class="math inline">\(231.5\)</span> and the sample variance <span class="math inline">\(s^2_{n-1}\)</span> is equal to <span class="math inline">\(130.93\)</span>.</p>
<p>Test the hypothesis that the amount filled corresponds on average to the setpoint. What is the value of the <span class="math inline">\(t\)</span> test statistic?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>The <span class="math inline">\(t\)</span> test statistic is calculated by: <span class="math display">\[\begin{aligned}
  t &amp; = &amp; \frac{\bar y - \mu_0}{\sqrt{\frac{s^2_{n-1}}{n}}}
  = \frac{231.5 - 250}{\sqrt{\frac{130.93}{230}}}
  = -24.52.\end{aligned}\]</span> The <span class="math inline">\(t\)</span> test statistic is thus equal to <span class="math inline">\(-24.520\)</span>.</p>
<ol type = "a">
<li> False </li>
<li> False </li>
<li> True </li>
<li> False </li>
<li> False </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>true</single>
<answernumbering>abc</answernumbering>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(38.088\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(30.005\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p>
<span class="math inline">\(-24.520\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(40.782\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="0" format="html">
<text><![CDATA[<p>
<span class="math inline">\(8.213\)</span>
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
</question>


<question type="category">
<category>
<text>$course$/rexams/Exercise 38</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q38 : r-exams-org_ttest </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>The waiting time (in minutes) at the cashier of two supermarket chains with different cashier systems is compared. The following statistical test was performed:</p>
<pre><code>    Two Sample t-test

data:  Waiting by Supermarket
t = -1.3439, df = 135, p-value = 0.1812
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -1.6935040  0.3231159
sample estimates:
 mean in group Sparag mean in group Consumo 
             5.288424              5.973618 </code></pre>
<p>Which of the following statements are correct? (Significance level <span class="math inline">\(5\%\)</span>)</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<ol type = "a">
<li> False. The absolute value of the test statistic is equal to 1.344. </li>
<li> False. The test aims at showing that the difference of means is unequal to <span class="math inline">\(0\)</span>. </li>
<li> True. The <span class="math inline">\(p\)</span> value is equal to <span class="math inline">\(0.181\)</span>. </li>
<li> False. The test result is not significant (<span class="math inline">\(p \ge 0.05\)</span>). </li>
<li> False. The test result ist not significant (<span class="math inline">\(p \ge 0.05\)</span>). </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>false</single>
<answernumbering>abc</answernumbering>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
The absolute value of the test statistic is larger than 1.96.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The absolute value of the test statistic is equal to 1.344.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
A one-sided alternative was tested.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The test aims at showing that the difference of means is unequal to <span class="math inline">\(0\)</span>.
</p>]]></text>
</feedback>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p>
The <span class="math inline">\(p\)</span> value is larger than <span class="math inline">\(0.05\)</span>.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True. The <span class="math inline">\(p\)</span> value is equal to <span class="math inline">\(0.181\)</span>.
</p>]]></text>
</feedback>
</answer>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
The test shows that the waiting time is longer at Sparag than at Consumo.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The test result is not significant (<span class="math inline">\(p \ge 0.05\)</span>).
</p>]]></text>
</feedback>
</answer>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
The test shows that the waiting time is shorter at Sparag than at Consumo.
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False. The test result ist not significant (<span class="math inline">\(p \ge 0.05\)</span>).
</p>]]></text>
</feedback>
</answer>
</question>

</quiz>
