• Home
  • Southern New Hampshire University
  • Discrete Mathematics MAT230
  • Recursion in Discrete Mathematics

Recursion in Discrete Mathematics

Discrete Math Notes: Chapter 7: Recursion 7.5 Recursive algorithms recursive algorithm, an algorithm that calls itself recursive calls, an algorithm's calls to itself are known overview: A recursive algorithm is one that repeats itself. A recursively defined algorithm, like recursively defined sequences and structures, has a base case in which the output is computed directly on a tiny input. The pseudo-code comments that begin with "//" describe the purpose of particular phases but are not part of the algorithm. The algorithm below takes a set A as input and returns the power set of that set. Remember that the power set of A (abbreviated P(A)) is the collection of all A subsets. P(A elements )'s are subsets of A. The details of how the set is represented and manipulated on a computer are removed, but there are enough details to perform the algorithm on paper. When the input A is the empty set, the algorithm's base case is used. The empty set's power set is the set in which the empty set is the lone element. The procedure then removes an element x from A in the recursive step to create A', whose cardinality is strictly smaller than A. The algorithm is then applied to A' in a recursive manner. All of the elements in A's power set are also found in A's power set.