






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Recursive definitions, which are used to define sets, equations, or processes by defining a starting point and providing a rule for continuing to build on previously defined items. Recursive definitions consist of a basis and recursion, where the basis defines values for some finite number of elements, and the recursion defines remaining elements based on previously defined items. Two examples are provided for sets and functions, including the natural numbers and the fibonacci sequence.
Typology: Study notes
1 / 12
This page cannot be seen from the preview
Don't miss anything!







Recursive Definitions Recursive form ^ Recursive form
Recursive Definitions Recursive Definition ^ Recursively Defined Functions^ Function,
F , defined on nonnegative integers. To give a recursive definition of
F :
^ (Basis)
Specify
F (0). ^ (Recursive Step)
Give a rule for defining F ( n +1)
from^ F
evaluated at smaller values.
Recursive Definitions Example ^ Example (set):A recursive definition of N (set of naturalnumbers)1.^ Basis: 0 is in N (0 is the BBB).2.^ Induction: if n is in N then so is n + 1 (how to build newobjects from old: “add one to an old object toget a new one”).
Recursive Definitions Example ^ Example (function):A recursive definition of the
Fibonacci sequence
(Classical): A young pair of rabbits (one for each sex) isplaced on a island. After they are 2 months old, each pairproduces another pair each month. The number of pairsof rabbits after n month is f(n).1.^ Basis: f(0) = f(1) = 1(two initial conditions)2.^ Induction: f(n + 1) = f (n) + f(n - 1)(the recurrence equation).
Recursive Definitions Example ^ Example (set):A recursive definition of the set of strings over a finitealphabet.An^ alphabet
Σ^ is a finite set. A^ string
over^ Σ^
is a finite sequence of symbols from
The set of all strings over
Σ^ is denoted by
The^ empty string
(the string containing no symbols) is the string containing no symbols. Its length is 0 and it isdenoted by
λ. (Note
λ∈ Σ ***** .) wx^ ∈ Σ *****
whenever w
∈ Σ *****^ and x
A^ language
over^ Σ^ is a subset of
Recursive Definitions Example ^ Example: Given the recurrence relation a
Recursive Definitions ExampleCompound Interest:On your 21