Inference rule for Induction

Similar documents
Recursively Defined Functions

Recursion defining an object (or function, algorithm, etc.) in terms of itself. Recursion can be used to define sequences

Recursive Definitions Structural Induction Recursive Algorithms

Recursion defining an object (or function, algorithm, etc.) in terms of itself. Recursion can be used to define sequences

Lamé s Theorem. Strings. Recursively Defined Sets and Structures. Recursively Defined Sets and Structures

CSE 20 DISCRETE MATH WINTER

Induction and Recursion. CMPS/MATH 2170: Discrete Mathematics

Chapter Summary. Mathematical Induction Recursive Definitions Structural Induction Recursive Algorithms

5.3 Recursive definitions and structural induction

Chapter Summary. Recursively defined Functions. Recursively defined sets and Structures Structural Induction

4&5 Binary Operations and Relations. The Integers. (part I)

Announcements. CS243: Discrete Structures. Strong Induction and Recursively Defined Structures. Review. Example (review) Example (review), cont.

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

Recursion. Tjark Weber. Functional Programming 1. Based on notes by Sven-Olof Nyström. Tjark Weber (UU) Recursion 1 / 37

CSC236 Week 4. Larry Zhang

CS158 Section B Exam 1 Key

Recursive definition of sets and structural induction

Automated Reasoning. Natural Deduction in First-Order Logic

Warmup Problem. Translate the following sentence from English into Propositional Logic. I want to eat ice cream even though I am on a diet.

10/9/17. Using recursion to define objects. CS 220: Discrete Structures and their Applications

CSE 20 DISCRETE MATH. Winter

Propositional Logic. Andreas Klappenecker

Recursion and Structural Induction

Recursion. Lars-Henrik Eriksson. Functional Programming 1. Based on a presentation by Tjark Weber and notes by Sven-Olof Nyström

AXIOMS FOR THE INTEGERS

CS 220: Discrete Structures and their Applications. Recursive objects and structural induction in zybooks

CSE 20 DISCRETE MATH. Fall

Chapter 3 Programming with Recursion

CS 173, Running Time Analysis, Counting, and Dynamic Programming. Tandy Warnow

CSE101: Design and Analysis of Algorithms. Ragesh Jaiswal, CSE, UCSD

Complexity, Induction, and Recurrence Relations. CSE 373 Help Session 4/7/2016

Mathematical Induction

4 Generating functions in two variables

CS 173 [A]: Discrete Structures, Fall 2012 Homework 8 Solutions

Fall Recursion and induction. Stephen Brookes. Lecture 4

Propositional Logic Formal Syntax and Semantics. Computability and Logic

Lecture 3.4: Recursive Algorithms

11 and 12 Arithmetic Sequence notes.notebook September 14, 2017

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

University of Illinois at Chicago Department of Computer Science. Final Examination. CS 151 Mathematical Foundations of Computer Science Fall 2012

Lecture 14: Lower Bounds for Tree Resolution

Recursion. What is Recursion? Simple Example. Repeatedly Reduce the Problem Into Smaller Problems to Solve the Big Problem

SC/MATH Boolean Formulae. Ref: G. Tourlakis, Mathematical Logic, John Wiley & Sons, York University

Recursion and Induction

This chapter covers recursive definition, including finding closed forms.

Mathematical Induction

Warmup Problem. Describe how structural induction differs from our MATH 135 notion of induction. 1/25

Handout 9: Imperative Programs and State

CS200: Recursion and induction (recap from cs161)

Discrete Mathematics Lecture 4. Harper Langston New York University

Fundamental mathematical techniques reviewed: Mathematical induction Recursion. Typically taught in courses such as Calculus and Discrete Mathematics.

1. Chapter 1, # 1: Prove that for all sets A, B, C, the formula

Revisiting Kalmar completeness metaproof

Outline. Introduction. 2 Proof of Correctness. 3 Final Notes. Precondition P 1 : Inputs include

Recursion: The Beginning

Verifying Safety Property of Lustre Programs: Temporal Induction

P1 Engineering Computation

CSE 311: Foundations of Computing. Lecture 8: Predicate Logic Proofs

1. Find f(1), f(2), f(3), and f(4) if f(n) is defined recursively by f(0) = 1 and for n = 0, 1, 2,

Foundations of Computation

Recursion: The Beginning

Recursive Definitions and Structural Induction

Mathematically Rigorous Software Design Review of mathematical prerequisites

Power Set of a set and Relations

Identify recursive algorithms Write simple recursive algorithms Understand recursive function calling

CMSC 330: Organization of Programming Languages. Formal Semantics of a Prog. Lang. Specifying Syntax, Semantics

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

COE428 Lecture Notes Week 1 (Week of January 9, 2017)

Chapter 3. Set Theory. 3.1 What is a Set?

CSCI 136 Data Structures & Advanced Programming. Lecture 9 Fall 2018 Instructors: Bills

An Annotated Language

CSC Discrete Math I, Spring Sets

Summary of Course Coverage

To illustrate what is intended the following are three write ups by students. Diagonalization

STABILITY AND PARADOX IN ALGORITHMIC LOGIC

Arithmetic Sequences

Figure 4.1: The evolution of a rooted tree.

Backtracking. Module 6. The Eight Queens Problem. CS 147 Sam Houston State University Dr. McGuire. Backtracking. Recursion Revisited

Computer Science 236 Fall Nov. 11, 2010

These notes present some properties of chordal graphs, a set of undirected graphs that are important for undirected graphical models.

Algorithms for Data Science

Goals: Define the syntax of a simple imperative language Define a semantics using natural deduction 1

CSE Discrete Structures

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

THE PRINCIPLE OF INDUCTION. MARK FLANAGAN School of Electrical, Electronic and Communications Engineering University College Dublin

Natural Numbers. We will use natural numbers to illustrate several ideas that will apply to Haskell data types in general.

Introduction to Computer Science

Coq projects for type theory 2018

Extending ACL2 with SMT solvers

DISCRETE MATHEMATICS

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

CMPSCI 250: Introduction to Computation. Lecture #14: Induction and Recursion (Still More Induction) David Mix Barrington 14 March 2013

Online Appendix: A Stackelberg Game Model for Botnet Data Exfiltration

Lecture 6,

Induction and Semantics in Dafny

Solution Set 8 Date: 1 December, 1992

Practice Problems: All Computer Science majors are people. Some computer science majors are logical thinkers. Some people are logical thinkers.

Data Structures and Algorithms Running time, Divide and Conquer January 25, 2018

The Matrix-Tree Theorem and Its Applications to Complete and Complete Bipartite Graphs

Framework for Design of Dynamic Programming Algorithms

Transcription:

Inference rule for Induction Let P( ) be a predicate with domain the positive integers BASE CASE INDUCTIVE STEP INDUCTIVE Step: Usually a direct proof Assume P(x) for arbitrary x (Inductive Hypothesis), and show P(x+1) Follows by Universal Generalization

Inference rule for Strong Induction BASE CASES INDUCTIVE STEP INDUCTIVE Step: Usually a direct proof To show P(x+1) for arbitrary x, assume (as Inductive Hypotheses), as many of P(x), P(x-1), P(x-2), P(1) as needed

Recursively Defined Functions Definition: A recursive or inductive definition of a function consists of two steps BASIS STEP: Specify the value of the function at zero RECURSIVE STEP: Give a rule for finding its value at an integer from its values at smaller integers Seen earlier as recurrence relations (e.g., Fibonacci sequence)

Recursively Defined Functions Example: Give a recursive definition of the factorial function n! Example: Give a recursive definition of n å k = 0 a k.

Recursively Defined Sets and Structures Recursive definitions of sets have the following parts: The basis step specifies an initial collection of elements The recursive step gives the rules for forming new elements in the set from those already known to be in the set An exclusion rule specifies that the set contains nothing other than those elements specified in the basis step and generated by applications of the rules in the recursive step. (This is sometimes assumed and not stated.)

Recursively Defined Sets and Structures Example : Subset of Integers S: BASIS STEP: 3 S. RECURSIVE STEP: If x S and y S, then x + y is in S. Defines the set of all positive integer multiples of 3 Example: The natural numbers N: BASIS STEP: 0 N. RECURSIVE STEP: If n is in N, then n + 1 is in N.

Well-Formed Formulae in Propositional Logic Definition: The set of well-formed formulae (WFFs) in propositional logic involving T, F, propositional variables, and operators from the set {,,,, }. BASIS STEP: T,F, and s, where s is a propositional variable, are well-formed formulae. RECURSIVE STEP: If E and F are well formed formulae, then ( E), (E F), (E F), (E F), (E F), are well-formed formulae. Examples: ((p q) (q F)) is a well-formed formula. pq is not a well formed formula.

Structural Induction To prove a property of the elements of a recursively defined set, we show the following two steps. BASIS STEP: Show that the result holds for all elements specified in the basis step of the recursive definition. INDUCTIVE STEP: Show that if the statement is true for each of the elements used to construct new elements in the recursive step of the definition, the result holds for these new elements.

Structural Induction Example Prove that every well-formed formula (WFF) in propositional logic contains an equal number of left and right parentheses BASIS STEP: Each of T,F, and s contains an equal number (zero) of left and right parentheses INDUCTIVE STEP: Assume E and F are WFFs that, by the inductive hypothesis, each contain an equal number of left and right parentheses. We must show that each of ( E), (E F), (E F), (E F), and (E F) contain an equal number of left and right parentheses

Revisiting Recursively Defined Functions Definition: A recursive or inductive definition of a function consists of two steps BASIS STEP: Specify the value of the function at zero RECURSIVE STEP: Give a rule for finding its value at an integer from its values at smaller integers A generalization Example 13 (page 377)

GENERALIZED INDUCTION Can be used to prove properties of functions from other domains that possess the well-ordering property (Every nonempty subset of the set has a minimum element) Example: Ordered pairs of non-negative integers Lexicographic ordering (x 1, y 1 ) < (x 2, y 2 ): (x 1 < x 2 ) or (x 1 =x 2 and y 1 < y 2 ) Example 13 (page 377)

GENERALIZED INDUCTION

GENERALIZED INDUCTION The Ackermann function (as per the text)