Section 3.3 Recursive Definitions. Recursive or inductive definitions of sets and functions on recursively defined sets are similar.

Similar documents
Mathematical Induction. Lecture 10-11

Cardinality. The set of all finite strings over the alphabet of lowercase letters is countable. The set of real numbers R is an uncountable set.

CS103B Handout 17 Winter 2007 February 26, 2007 Languages and Regular Expressions

Full and Complete Binary Trees

CMPSCI 250: Introduction to Computation. Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013

Math 55: Discrete Mathematics

C H A P T E R Regular Expressions regular expression

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

SECTION 10-2 Mathematical Induction

3. Mathematical Induction

The Halting Problem is Undecidable

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

Proseminar on Semantic Theory Fall 2013 Ling 720. Problem Set on the Formal Preliminaries : Answers and Notes

Automata and Formal Languages

Sample Induction Proofs

Fundamentele Informatica II

Reading 13 : Finite State Automata and Regular Expressions

Regular Languages and Finite State Machines

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

8 Divisibility and prime numbers

CHAPTER 7 GENERAL PROOF SYSTEMS

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

THEORY of COMPUTATION

If n is odd, then 3n + 7 is even.

Catalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity.

CSG 399 Lecture. The Inductive Approach to Protocol Analysis p.1

Recursive Algorithms. Recursion. Motivating Example Factorial Recall the factorial function. { 1 if n = 1 n! = n (n 1)! if n > 1

Mathematical Induction

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

An Innocent Investigation

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

Deterministic Finite Automata

Regular Languages and Finite Automata

SECTION 10-5 Multiplication Principle, Permutations, and Combinations

6.2 Permutations continued

CAs and Turing Machines. The Basis for Universal Computation

How To Compare A Markov Algorithm To A Turing Machine

Examination paper for MA0301 Elementær diskret matematikk

Cartesian Products and Relations

This asserts two sets are equal iff they have the same elements, that is, a set is determined by its elements.

Lecture 11: Tail Recursion; Continuations

Discrete Mathematics Problems

Computational Models Lecture 8, Spring 2009

(0, 0) : order 1; (0, 1) : order 4; (0, 2) : order 2; (0, 3) : order 4; (1, 0) : order 2; (1, 1) : order 4; (1, 2) : order 2; (1, 3) : order 4.

csci 210: Data Structures Recursion

INCIDENCE-BETWEENNESS GEOMETRY

Computability Theory

MACM 101 Discrete Mathematics I

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

Handout #1: Mathematical Reasoning

Theory of Computation Chapter 2: Turing Machines

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

26 Integers: Multiplication, Division, and Order

MATH10040 Chapter 2: Prime and relatively prime numbers

Continued Fractions and the Euclidean Algorithm

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

TAKE-AWAY GAMES. ALLEN J. SCHWENK California Institute of Technology, Pasadena, California INTRODUCTION

CS 103X: Discrete Structures Homework Assignment 3 Solutions

CHAPTER II THE LIMIT OF A SEQUENCE OF NUMBERS DEFINITION OF THE NUMBER e.

Writing Functions in Scheme. Writing Functions in Scheme. Checking My Answer: Empty List. Checking My Answer: Empty List

Finite Automata. Reading: Chapter 2

Basic Probability Concepts

Data Structures Fibonacci Heaps, Amortized Analysis

CS5236 Advanced Automata Theory

Handout NUMBER THEORY

24 Uses of Turing Machines

ON THE EMBEDDING OF BIRKHOFF-WITT RINGS IN QUOTIENT FIELDS

Lights and Darks of the Star-Free Star

FUNCTIONAL ANALYSIS LECTURE NOTES: QUOTIENT SPACES

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

Math 55: Discrete Mathematics

Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy

Chapter 7 Uncomputability

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws.

mod 10 = mod 10 = 49 mod 10 = 9.

Degrees that are not degrees of categoricity

An example of a computable

Introduction to Automata Theory. Reading: Chapter 1

MATH 4330/5330, Fourier Analysis Section 11, The Discrete Fourier Transform

Continued Fractions. Darren C. Collins

Sequence of Numbers. Mun Chou, Fong QED Education Scientific Malaysia

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

9.2 Summation Notation

( ) which must be a vector

Mathematical Induction

Notes on Determinant

The Classes P and NP

NUMBER SYSTEMS. William Stallings

Discrete Mathematics. Hans Cuypers. October 11, 2007

WHERE DOES THE 10% CONDITION COME FROM?

We can express this in decimal notation (in contrast to the underline notation we have been using) as follows: b + 90c = c + 10b

God created the integers and the rest is the work of man. (Leopold Kronecker, in an after-dinner speech at a conference, Berlin, 1886)

Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

THE DIMENSION OF A VECTOR SPACE

Basic Concepts of Point Set Topology Notes for OU course Math 4853 Spring 2011

Is Sometime Ever Better Than Alway?

Regression Verification: Status Report

Transcription:

Section 3.3 Recursive Definitions Recursive or inductive definitions of sets and functions on recursively defined sets are similar. 1. Basis step: For sets- set. State the basic building blocks (BBB's) of the or For functions- State the values of the function on the BBB s. 2. Inductive or recursive step: For sets- Show how to build new things from old with some construction rules. or For functions- Show how to compute the value of a function on the new things that can be built knowing the value on the old things. and Its Applications 4/E Kenneth Rosen TP 1

3. Extremal clause: For sets- If you can't build it with a finite number of applications of steps 1. and 2. then it isn't in the set. For functions- A function defined on a recursively defined set does not require an extremal clause. Note: Your author doesn't mention the extremal clause. It is a standard part of an inductive definition of a set but often ignored ( since everybody knows it is supposed to be there ). Also note: To prove something is in the set you must show how to construct it with a finite number of applications of the basis and inductive steps. To prove something is not in the set is often more difficult. Example: A recursive definition of N: and Its Applications 4/E Kenneth Rosen TP 2

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 new objects from old: add one to an old object to get a new one ). 3. Extremal clause: If you can't construct it with a finite number of applications of 1. and 2., it isn't in N. Now given the above recursive definition of N we can give recursive definitions of functions on N: 1. f(0) = 1 (the initial condition or the value of the function on the BBB s). 2. f(n + 1) = (n + 1) f(n) (the recurrence equation, how to define f on the new objects based on its value on old objects) f is the factorial function: f(n) = n!. Note how it follows the recursive definition of N. Proof of assertions about inductively defined objects usually involves a and Its Applications 4/E Kenneth Rosen TP 3

Proof by induction. Prove the assertion is true for the BBBs in the basis step. Prove that if the assertion is true for the old objects it must be true for the new objects you can build from the old objects. Example: Conclude the assertion must be true for all objects. We define an inductively where n is in N. Basis: a0= 1 Induction: a(n + 1) = an a Theorem: m n[a m a n = a m+n ] Proof: Since the powers of a have been defined inductively we must use a proof by induction somewhere. Get rid of the first quantifier on m by Universal Instantiation: Assume m is arbitrary. and Its Applications 4/E Kenneth Rosen TP 4

Now prove the remaining quantified assertion by induction: n[a m a n = a m+n ] 1. Basis step: Show it holds for n = 0. The left side becomes a m a 0 = a m (1) = a m The right side becomes a m+0 = a m Hence, the two sides are equal to the same value. 2. Induction step: The Induction hypothesis: Assume the assertion is true for n: a m a n = a m+ n. Now show it is true for n + 1. The left side becomes a m a n+1 = a m (a n a) = (a m a n )a = a m+n a which follows from the inductive step in the definition of an and the induction hypothesis and the associativity of multiplication. The right side becomes a m+(n+1) = a (m+n)+1 = a m+n a and Its Applications 4/E Kenneth Rosen TP 5

which follows from the inductive definition of the powers of a the associativity of addition. Hence, we have shown for arbitrary m that n[a m a n = a m+n ] is true by induction. Since m was arbitrary, by Universal Generalization, m n[a m a n = a m+n ]. Q. E. D. Example: A recursive definition of the Fibonacci sequence 1. Basis: 2. Induction: f(0) = f(1) = 1 (two initial conditions) f(n + 1) = f (n) + f(n - 1) (the recurrence equation). and Its Applications 4/E Kenneth Rosen TP 6

Example: A recursive definition of the set of strings over a finite alphabet. The set of all strings (including the empty or null string λ ) is called (the monoid) *. (Excluding the empty string it is called +. ) 1. Basis: 2. Induction: The empty string λ is in *. If w is in * and a is a symbol in, then wa is in *. Note: we can concatenate a on the right or left, but it makes a difference in proofs since concatenation is not commutative! 3. Extremal clause. Note: infinitely long strings cannot be in *. (why?) and Its Applications 4/E Kenneth Rosen TP 7

Example: Let = {a, b}. Then aab is in *. Proof: We construct it with a finite number of applications of the basis and inductive steps in the definition of *: 1. λ is in * by the basis step. 2. By step 1., the induction clause in the definition of * and the fact that a is in, we can conclude that λ a = a is in *. 3. Since a is in * from step 2., and a is a symbol in, applying the induction clause again we conclude that aa is in *. 4. Since aa is in * from step 3 and b is in, applying the induction clause again we conclude that aab is in *. Since we have shown aab is in * with a finite number of applications of the basis and induction clauses in the definition we have finished the proof. Q.E.D. and Its Applications 4/E Kenneth Rosen TP 8

Example: We give an inductive definition of the well formed parenthesis strings P: Example: 1. Basis clause: 2. Induction clause: 3. Extremal clause ( ) is in P if w is in P then so are ( ) w, (w), and w( ) (( )( )) is in P. Proof: 1. ( ) is in P by the basis clause 2. ( )( ) must be in P by step 1. and the induction clause 3. (( ) ( )) must be in P by step 2. and the induction clause. Q. E. D. Note: ))(( ) is not in P. Why? Can you prove it? and Its Applications 4/E Kenneth Rosen TP 9

(Hint: what can you say about the length of strings in P? How can you order the strings in P?) One More Example: The set S of bit strings with no more than a single 1. Basis: λ, 0, 1 are in S Induction: if w is in S, then so are 0w and w0 Extremal Clause and Its Applications 4/E Kenneth Rosen TP 10