Skip to main content

Exercises 5.20 Hodgepodge

View Source for exercises
<exercises xml:id="runestone-hodgepodge">
  <title>Hodgepodge</title>

  <exercise label="multifile-program-2">
    <statement>
      <p>
        This is a test of accessing program resources across pages by relying
        on what is in the database.
      </p>
    </statement>

    <program interactive="activecode" add-files="addh-v1 addcpp-v1" compile-also="addcpp-v1" language="cpp">
              
              #include "add.h"
              #include &lt;iostream&gt;
              using namespace std;
              int main() {
                  int a = 1;
                  int b = 2;
                  cout &lt;&lt; "The sum of " &lt;&lt; a &lt;&lt; " and " &lt;&lt; b &lt;&lt; " is " &lt;&lt; add(a, b) &lt;&lt; endl;
              }
    </program>
  </exercise>

  <exercise label="true-false-exercise-with-tasks-in-exercises">
    <title>With Tasks in an Exercises Division</title>

    <introduction>
      <p>
        Structured with task, recycled earlier from earlier, to make sure that
        the tasks do not get counted as Runestone reading activities (since
        they are inside an <tag>exercise</tag> inside of an
        <tag>exercises</tag> division.
      </p>
    </introduction>

    <task label="true-false-task-in-exercises">
      <title>True/False</title>

      <idx>vector space</idx>
      <statement correct="no">
        <p>
          Every vector space has finite dimension.
        </p>
      </statement>

      <feedback>
        <p>
          The vector space of all polynomials with finite degree has a basis,
          <m>B = \{1,x,x^2,x^3,\dots\}</m>, which is infinte.
        </p>
      </feedback>

      <hint>
        <p>
          <m>P_n</m>, the vector space of polynomials with degree at most
          <m>n</m>, has dimension <m>n+1</m> by
          <xref ref="theorem-exponent-laws"/>. [Cross-reference is just a
          demo, content is not relevant.] What happens if we relax the
          defintion and remove the parameter <m>n</m>?
        </p>
      </hint>
    </task>

    <task label="short-answer-task-in-exercises">
      <statement>
        <p>
          Explain your reasoning in the previous question.
        </p>
      </statement>
      <response/>
    </task>

    <conclusion>
      <p>
        A sequence of <tag>task</tag> can have a <tag>conclusion</tag>, like
        this one, even if they do not see much use in practice.
      </p>
    </conclusion>
  </exercise>
</exercises>

1.

View Source for exercise
<exercise label="multifile-program-2">
  <statement>
    <p>
      This is a test of accessing program resources across pages by relying
      on what is in the database.
    </p>
  </statement>

  <program interactive="activecode" add-files="addh-v1 addcpp-v1" compile-also="addcpp-v1" language="cpp">
            
            #include "add.h"
            #include &lt;iostream&gt;
            using namespace std;
            int main() {
                int a = 1;
                int b = 2;
                cout &lt;&lt; "The sum of " &lt;&lt; a &lt;&lt; " and " &lt;&lt; b &lt;&lt; " is " &lt;&lt; add(a, b) &lt;&lt; endl;
            }
  </program>
</exercise>
This is a test of accessing program resources across pages by relying on what is in the database.

2. With Tasks in an Exercises Division.

View Source for exercise
<exercise label="true-false-exercise-with-tasks-in-exercises">
  <title>With Tasks in an Exercises Division</title>

  <introduction>
    <p>
      Structured with task, recycled earlier from earlier, to make sure that
      the tasks do not get counted as Runestone reading activities (since
      they are inside an <tag>exercise</tag> inside of an
      <tag>exercises</tag> division.
    </p>
  </introduction>

  <task label="true-false-task-in-exercises">
    <title>True/False</title>

    <idx>vector space</idx>
    <statement correct="no">
      <p>
        Every vector space has finite dimension.
      </p>
    </statement>

    <feedback>
      <p>
        The vector space of all polynomials with finite degree has a basis,
        <m>B = \{1,x,x^2,x^3,\dots\}</m>, which is infinte.
      </p>
    </feedback>

    <hint>
      <p>
        <m>P_n</m>, the vector space of polynomials with degree at most
        <m>n</m>, has dimension <m>n+1</m> by
        <xref ref="theorem-exponent-laws"/>. [Cross-reference is just a
        demo, content is not relevant.] What happens if we relax the
        defintion and remove the parameter <m>n</m>?
      </p>
    </hint>
  </task>

  <task label="short-answer-task-in-exercises">
    <statement>
      <p>
        Explain your reasoning in the previous question.
      </p>
    </statement>
    <response/>
  </task>

  <conclusion>
    <p>
      A sequence of <tag>task</tag> can have a <tag>conclusion</tag>, like
      this one, even if they do not see much use in practice.
    </p>
  </conclusion>
</exercise>
Structured with task, recycled earlier from earlier, to make sure that the tasks do not get counted as Runestone reading activities (since they are inside an <exercise> inside of an <exercises> division.

(a) True/False.

View Source for task
<task label="true-false-task-in-exercises">
  <title>True/False</title>

  <idx>vector space</idx>
  <statement correct="no">
    <p>
      Every vector space has finite dimension.
    </p>
  </statement>

  <feedback>
    <p>
      The vector space of all polynomials with finite degree has a basis,
      <m>B = \{1,x,x^2,x^3,\dots\}</m>, which is infinte.
    </p>
  </feedback>

  <hint>
    <p>
      <m>P_n</m>, the vector space of polynomials with degree at most
      <m>n</m>, has dimension <m>n+1</m> by
      <xref ref="theorem-exponent-laws"/>. [Cross-reference is just a
      demo, content is not relevant.] What happens if we relax the
      defintion and remove the parameter <m>n</m>?
    </p>
  </hint>
</task>
    Every vector space has finite dimension.
  • True.

  • The vector space of all polynomials with finite degree has a basis, \(B = \{1,x,x^2,x^3,\dots\}\text{,}\) which is infinte.
  • False.

  • The vector space of all polynomials with finite degree has a basis, \(B = \{1,x,x^2,x^3,\dots\}\text{,}\) which is infinte.
Hint.
View Source for hint
<hint>
  <p>
    <m>P_n</m>, the vector space of polynomials with degree at most
    <m>n</m>, has dimension <m>n+1</m> by
    <xref ref="theorem-exponent-laws"/>. [Cross-reference is just a
    demo, content is not relevant.] What happens if we relax the
    defintion and remove the parameter <m>n</m>?
  </p>
</hint>
\(P_n\text{,}\) the vector space of polynomials with degree at most \(n\text{,}\) has dimension \(n+1\) by TheoremΒ 3.2.16. [Cross-reference is just a demo, content is not relevant.] What happens if we relax the defintion and remove the parameter \(n\text{?}\)

(b)

View Source for task
<task label="short-answer-task-in-exercises">
  <statement>
    <p>
      Explain your reasoning in the previous question.
    </p>
  </statement>
  <response/>
</task>
Explain your reasoning in the previous question.
A sequence of <task> can have a <conclusion>, like this one, even if they do not see much use in practice.
You have attempted of activities on this page.