SLIDE 1
Inductive Definition and Structural Induction
Class Notes
To explain what are inductive definitions and structural induction, we start with, in section 1, a simple abstraction—the natural numbers. And then in section 2, we show how to deploy these techniques into data structure design and algorithm analysis, via one concrete example: linked list.
1 Natural Numbers
Given the informal definitions of a natural number: a natural number is either:
- 1. zero; or
- 2. a natural number following another natural number.
we can write it in an inductive definition form: n → Zero → Succ n Given this inductive definition, we write a mapping function f from a given natural number n to an integer: f(n) =
- 0,
if n = Zero; 1 + f(m), if n = Succ m. note that function f is also inductively defined. Just like ordinary integers, we can also define operations on natural num-
- bers. Here is the definition of addition:
n1 ⊕ n2 =
- n2,