Recursive Definitions and Mathematical Induction
Definition: Recursive Definition
There is a method used to define sets called recursive
definitions.
You write a recursive definition in 3 steps:
- Specify some of the basic elements in the set.
- Give some rules for how to construct more elements
in the set from the elements that we know are already there .
- Say that there are no other elements in the set except those
constructed using steps 1 and 2.
Questions
- Why do we want to define sets using a recursive definition?
- Because most times, the number of elements in a set are infinite
, and a recursive definition lets us give a finite
definition of infinite sets.
- But we've used the "..." to define infinite sets. Why isn't that
good enough ?
- Variety is the spice of life. `
Actually, sometimes it can be extremely difficult to do this.
- Why are these called recursive definitions?
- Because one (or more) of the rules used to define the set
mentions the set itself
Example 1
Defining a set consisting of all positive integer numbers that are divisible by 2
We can define this set as: EVEN = {x| x = 2n, for n= 1, 2, 3, ,,,}
But, as you can see, we still have the
... !
Here is a recursive definition of EVEN:
- 2 is in EVEN
- If x is in EVEN, and y is in EVEN,
x+y is in EVEN.
- The only elements in the set EVEN are those that can be
produced from RULEs 1 and 2 above.
Pretty tricky.
Deep Thought #1
How can we prove that, say, the number 14 is in the set EVEN?
Using the non-recursive definition
we can divide 14 by 2 and see that there is no remainder.
Using the recursive definition, this is what we do:
- by Rule 1: 2 is in EVEN
- by Rule 2: x=2, y=2 -> 4 is in EVEN
- by Rule 2: x=2, y=4 -> 6 is in EVEN
- by Rule 2: x=4, y=4 -> 8 is in EVEN
- by Rule 2: x=6, y=8 -> 14 is in EVEN
Notice we can use the recursive definition to construct an
infinite set.
Example 2
Notice that Recursive Definitions are not completely alien to us in the real world...
We define the set of people who are DESCENDENTS of Henry VIII:
- The children of Henry VIII are in DESCENDENTS
- If person x is a child of person y
and person y is in DESCENDENTS,
then person x is in DESCENDENTS.
- No other persons are in DESCENDENTS except those defined by Rule 1 and
Rule 2.
Example 3
Define the set of all polynomials of one variable
(Note: I'm going to use the symbol "^" to denote "to the power", so that
x^3 denotes "x cubed").
This example is for those folks who know some algebraic notation, but do
not know what a polynomial is. So, for these folks, we are going to define
a set, POLY, which is the set of all polynomials of one variable (x).
- Any number is in POLY
- The variable x is in POLY
- If p is in POLY and q is in POLY,
then so are p+q, (p), and pq.
(The symbol pq means multiplication.)
- POLY only contains those things which can be created by using the
three rules above.
Rule 1 and Rule 2 establish the "basic things" that are in POLY; Rule 3
allows us to construct more elements of POLY by using elements already in POLY.
Let's look at how these rules can be used to show that the equation
5x^3 + 8x - 9 is in POLY. We look at the different subexpressions of this
equation.
- by Rule 1, 5 is in POLY
- by Rule 2, x is in POLY
- by Rule 3, (5)(x) is in POLY, call it 5x
- by Rule 3, (5x)(x) is in POLY, call it 5x^2
- by Rule 1, 8 is in POLY
- by Rule 3, (8)(x) is in POLY
- by Rule 3, 5x^2 + 8x is in POLY
- by Rule 1, -9 is in POLY
- by Rule 3, 5x^2 + 8x + (-9) = 5x^2 + 8x -9 is in POLY
Rules could have been included to make the notation prettier, but these
rules allow us to produce all the polynomials, and we just need to rely on
figuring out some simple arithmetic, like p + (-q) = p - q.
Deep Thought #2
There are several other rule sequences which could have produced the
same result for this equation!
Example 4
Many functions in mathematics are defined
recursively
Look at the factorial function !.
5! = 5 * 4 * 3 * 2 *1
and defined for n in N:
n! = n * (n-1) * (n-2) * ... 2 * 1
Factorial is defined recursively as:
- 0! = 1
- n! = n * (n-1)!
Notice that Rule 2 defines factorial in terms of factorial!
The Principle of Mathematical Induction
In the rest of the course, we will be defining properties of sets, and
these sets will contain the strings generated by a grammar. The strings
that are in the set can be described using a statement which is
some property involving
a natural number n, P(n), so that P(n) is true for every single n in N.
The statement might be
- a numerical equality, such as:
1 + 2 + ... + n = n(n+1)/2
- a numerical inequality, such as:
n! > 2^n
- an assertion about strings generated by a grammar.
(Don't worry, you'll get plenty of examples later).
Mathematicians (and computer scientists!),
whenever they come up with a formula like
the sum of n numbers (above), need to prove that it is
true for any n! Sure, they can start at n=1 and show it's true,
then for n=2, then n=3,...
If this is how they proved such statements, we
wouldn't be able to use it today, because they could only say something
like "We know it's true for n=1 through n=912348, and we're forging ahead..."
So, how do we prove a statement, P(n), for any n, in a finite amount of time?
We use (you guessed it) The Principle of Mathematical Induction
Given: property P(n) applied to the natural numbers, N= {0,1,...}.
For any n in N, either P(n) = True or P(n) = False.
If you want to probe that P(n) is true for every n in N, you can use
Standard Induction
Definition: Standard Induction
- Basis: prove that P(0) is True.
- Prove the implication:
If for some arbitrary n in N P(n) = True then
P(n+1) = True.
To prove an implication p->q,
assume p is True, then prove q is True.
For inductive proofs, p is called the Induction Hypothesis (IH) and
q is called the Induction Step (IS).
Notice that the IH is really just stating what you're trying to prove!
(seems weird, huh?)
To do this:
- Induction Hypothesis: Assume that P(n) is true for some arbitrary n
- Induction Step: Prove that P(n+1) is true.
From 1 and 2 it follows that P(n) = True for every n in N.
Example 5
Prove: P(n) == 0 + 1 + ... + n = n(n+1)/2
- Basis: P(0): 0 = 0(0+1)/2.
- Induction Hypothesis: Assume that P(n) is true.
Assume that P(n) = n(n+1)/2 is True.
- Induction Step: Prove that P(n+1) is true. Normally we write P(n+1) in
terms of P(n) and "something else":
P(n+1) = P(n) + n+1 = n(n+1)/2 + n+1 = n(n+1)/2 + 2(n+1)/2 = (n+1)(n+2)/2
References
- Daniel I.A. Cohen. Introduction to Computer Theory. Wiley, 1986.
- Thomas A. Sudkamp. Languages and Machines: An Introduction to the Theory of
Computer Science. 2e. Addison-Wesley, 1997.
- Derick Wood. Theory of Computation. Wiley, 1987.
©Elaine Wenderholm
All rights reserved.
Last modified: Thu Sep 17 14:09:15 EDT 1998