Course-of-values recursion

Course-of-values recursion

In computability theory, course-of-values recursion is a technique for defining number-theoretic functions by recursion. In a definition of a function f by course-of-values recursion, the value of f(n+1) is computed from the sequence \langle f(1),f(2),\ldots,f(n)\rangle. The fact that such definitions can be converted into definitions using a simpler form of recursion is often used to prove that functions defined by course-of-values recursion are primitive recursive.

This article uses the convention that the natural numbers are the set {1,2,3,4,...}.

Contents

Definition and examples

The factorial function n! is recursively defined by the rules

1! = 1,
(n+1)! = (n+1)*(n!).

This recursion is a primitive recursion because it only requires the previous value n! in order to compute the next value (n+1)!. On the other hand, the function Fib(n), which returns the nth Fibonacci number, is defined with the recursion equations

Fib(1) = 1,
Fib(2) = 1,
Fib(n+2) = Fib(n+1) + Fib(n).

In order to compute Fib(n+2), the last two values of the Fib function are required. Finally, consider the function g defined with the recursion equations

g(1) = 2,
g(n+1) = \sum_{i = 1}^{n} g(i)^n.

To compute g(n+1) using these equations, all the previous values of g must be computed; no fixed finite number of previous values is sufficient in general for the computation of g. The functions Fib and g are examples of functions defined by course-of-values recursion.

In general, a function f is defined by course-of-values recursion if there is a fixed function h such that for all n,

f(n) = h(\langle f(1), f(2), \ldots, f(n-1)\rangle).

In this notation,

f(1) = h(\langle\rangle),

and thus the initial value(s) of the recursion must be "hard coded" into h.

Equivalence to primitive recursion

In order to convert a definition by course-of-values recursion into a primitive recursion, an auxiliary (helper) function is used. Suppose that

f(n) = h(\langle f(1), f(2), \ldots, f(n-1)\rangle).

To redefine f using primitive recursion, first define the auxiliary course-of-values function

\bar{f}(n) = \langle  f(1), f(2), \ldots, f(n-1), h(\langle f(1), f(2), \ldots, f(n-1)\rangle)\rangle.

Thus \bar{f} encodes the first n values of f, and \bar{f} is defined by primitive recursion because \bar{f}(n+1) is the concatenation of \bar{f}(n) and the one-element sequence \langle h(\bar{f}(n)) \rangle:

\bar{f}(1) = \langle h(\langle\rangle)\rangle,
\bar{f}(n+1) = \bar{f}(n) \smallfrown \langle h(\bar{f}(n))\rangle.

Given \bar{f}, the original function f can be defined by letting f(n) be the final element of the sequence \bar{f}(n). Thus f can be defined without a course-of-values recursion in any setting where it is possible to handle sequences of natural numbers. Such settings include LISP and the primitive recursive functions, discussed in the next section.

Application to primitive recursive functions

In the context of primitive recursive functions, it is convenient to have a means to represent finite sequences of natural numbers as single natural numbers. One such method, Gödel's encoding, represents a sequence \langle n_1,n_2,\ldots,n_k\rangle as

\prod_{i = 1}^k p_i^{n_i},

where pi represent the ith prime. It can be shown that, with this representation, the ordinary operations on sequences are all primitive recursive. These operations include

  • Determining the length of a sequence,
  • Extracting an element from a sequence given its index,
  • Concatenating two sequences.

Using this representation of sequences, it can be seen that if h(m) is primitive recursive then the function

f(n) = h(\langle f(1), f(2), \ldots, f(n-1)\rangle).

is also primitive recursive.

When the natural numbers are taken to begin with zero, the sequence \langle n_1,n_2,\ldots,n_k\rangle is instead represented as

\prod_{i = 1}^k p_i^{(n_i +1)},

which makes it possible to distinguish the codes for the sequences \langle 0 \rangle and \langle 0,0\rangle.

References

  • Hinman, P.G., 2006, Fundamentals of Mathematical Logic, A K Peters.
  • Odifreddi, P.G., 1989, Classical Recursion Theory, North Holland; second edition, 1999.

Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Recursion — Recursion, in mathematics and computer science, is a method of defining functions in which the function being defined is applied within its own definition. The term is also used more generally to describe a process of repeating objects in a self… …   Wikipedia

  • Tail recursion — In computer science, tail recursion (or tail end recursion) is a special case of recursion in which the last operation of the function is a recursive call. Such recursions can be easily transformed to iterations. Replacing recursion with… …   Wikipedia

  • Primitive recursive function — The primitive recursive functions are defined using primitive recursion and composition as central operations and are a strict subset of the recursive functions (recursive functions are also known as computable functions). The term was coined by… …   Wikipedia

  • Well-founded relation — In mathematics, a binary relation, R, is well founded (or wellfounded) on a class X if and only if every non empty subset of X has a minimal element with respect to R; that is, for every non empty subset S of X, there is an element m of S such… …   Wikipedia

  • List of mathematics articles (C) — NOTOC C C closed subgroup C minimal theory C normal subgroup C number C semiring C space C symmetry C* algebra C0 semigroup CA group Cabal (set theory) Cabibbo Kobayashi Maskawa matrix Cabinet projection Cable knot Cabri Geometry Cabtaxi number… …   Wikipedia

  • Mathematical induction — can be informally illustrated by reference to the sequential effect of falling dominoes. Mathematical induction is a method of mathematical proof typically used to establish that a given statement is true of all natural numbers (positive… …   Wikipedia

  • Mathematical logic — (also known as symbolic logic) is a subfield of mathematics with close connections to foundations of mathematics, theoretical computer science and philosophical logic.[1] The field includes both the mathematical study of logic and the… …   Wikipedia

  • Dynamic programming — For the programming paradigm, see Dynamic programming language. In mathematics and computer science, dynamic programming is a method for solving complex problems by breaking them down into simpler subproblems. It is applicable to problems… …   Wikipedia

  • Function (mathematics) — f(x) redirects here. For the band, see f(x) (band). Graph of example function, In mathematics, a function associates one quantity, the a …   Wikipedia

  • Subroutine — In computer science, a subroutine (function, method, procedure, or subprogram) is a portion of code within a larger program, which performs a specific task and can be relatively independent of the remaining code. The syntax of many programming… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”