Page 294 - HOW TO PROVE IT: A Structured Approach, Second Edition
P. 294

P1: Oyk/
                   0521861241c06  CB996/Velleman  October 20, 2005  1:8  0 521 86124 1  Char Count= 0






                                   280                  Mathematical Induction
                                   in this way we can compute f (n) for any natural number n. Thus, the two
                                   equations really do give us a rule that determines a unique value f (n) for each
                                   natural number n, so they define a function f with domain N. Definitions of
                                   this kind are called recursive definitions.
                                     Sometimes we’ll work backwards when using a recursive definition to eval-
                                   uate a function. For example, suppose we want to compute f (6), where f is
                                   the function just defined. According to the second equation in the definition
                                   of f, f (6) = 6 · f (5), so to complete the calculation we must compute f (5).
                                   Using the second equation again, we find that f (5) = 5 · f (4), so we must
                                   compute f (4). Continuing in this way leads to the following calculation:
                                                      f (6) = 6 · f (5)
                                                         = 6 · 5 · f (4)
                                                         = 6 · 5 · 4 · f (3)
                                                         = 6 · 5 · 4 · 3 · f (2)
                                                         = 6 · 5 · 4 · 3 · 2 · f (1)
                                                         = 6 · 5 · 4 · 3 · 2 · 1 · f (0)
                                                         = 6 · 5 · 4 · 3 · 2 · 1 · 1
                                                         = 720.

                                     Perhaps now you recognize the function f. For any positive integer n,
                                   f (n) = n · (n − 1) · (n − 2) ··· 1, and f (0) = 1. This number is called n facto-
                                   rial, denoted n!. For example, 6! = 720. Often, if a function can be written as
                                   a formula with an ellipsis (...) in it, then the use of the ellipsis can be avoided
                                   by giving a recursive definition for the function. Such a definition is usually
                                   easier to work with.
                                     Many familiar functions are most easily defined using recursive definitions.
                                                                         n
                                   For example, for any number a, we could define a with the following recursive
                                   definition:
                                                       0
                                                      a = 1;
                                                                           n
                                                      for every n ∈ N, a n+1  = a · a.
                                                                     4
                                   Using this definition, we would compute a like this:
                                                               3
                                                          4
                                                         a = a · a
                                                               2
                                                            = a · a · a
                                                               1
                                                            = a · a · a · a
                                                               0
                                                            = a · a · a · a · a
                                                            = 1 · a · a · a · a.
   289   290   291   292   293   294   295   296   297   298   299