• Unit 6: Recursion

    Using recursion, we can arrive at a succession of elements (such as numbers or events) by operating on one or more of the elements that came earlier. We do this using a rule or formula with a finite number of steps. In computer programming, we implement recursion with procedures, subroutines, functions, or algorithms that run one or more times until a specified condition is met. At that point, the remaining code in each procedure is processed from the last procedure called to the first. From a practitioner's perspective, recursive procedures are simple to write, but they are extremely memory-intensive, and it can be difficult to predict how much memory will be required.

    Recursion is common, so you will need to understand it at a fundamental level. A basic example of a recursive sequence is Dt = f(D[t-1]). The data at time t is a function of the data at the previous unit of time. In practice, this can be implemented as a recursive function or an explicit (that is, non-recursive) function. This unit will delve deeper into this topic.

    Completing this unit should take you approximately 5 hours.

    • 6.1: Introduction

    • 6.2: Transitioning from Informal to Formal

    • 6.3: The Many Faces of Recursion

    • 6.4: Sequences

    • 6.5: Recursion in the Real World

    • Unit 6 Assessment

      • Receive a grade