Skip to main content
Engineering LibreTexts

3.11: Chapter Review

  • Page ID
    85964
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    In this chapter, we used a loop to perform a repetitive computation—updating a model 30 times—and to compute sequences and series. Also, we used the plot function to visualize the results.

    Here are some terms from this chapter you might want to remember.

    Absolute error is the difference between an approximation and an exact answer. Relative error is the same difference expressed as a fraction or percentage of the exact answer.

    A loop is part of a program that runs repeatedly. A loop variable is a variable that gets assigned a different value each time through the loop. A range is a sequence of values assigned to the loop variable, often specified with the colon operator—for example, 1:5. The body of a loop is the set of statements inside the loop that runs repeatedly. An accumulator is a variable that is used to accumulate a result a little bit at a time.

    In mathematics, a sequence is a set of numbers that correspond to the positive integers. The numbers that make up the sequence are called . A series is the sum of a sequence of elements. Sometimes we compute the elements of a sequence recurrently, which means that each new element depends on previous elements. Sometimes we can compute the elements directly, without using previous elements.

    Generalization is a way to make a program more versatile, for example, by replacing a specific value with a variable that can have any value. Incremental development is a way of programming by making a series of small, testable changes. Scaffolding is code you write to help you program or debug but that is not part of the finished program.

    In the next chapter, we’ll use a vector to store the results from a loop.


    This page titled 3.11: Chapter Review is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Allen B. Downey (Green Tea Press) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.