1 Quiz Friday 8-29 Lectures: introduction and methods of proof Text: pp 1-26.

Slides:



Advertisements
Similar presentations
&& Department of nskinfo-i educationwww.nsksofttch.com CS2303-THEORY OF COMPUTATION uChapter: Closure.
Advertisements

Chapter 2 Revision of Mathematical Notations and Techniques
Introduction to Proofs
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
(CSC 102) Discrete Structures Lecture 14.
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
Discrete Mathematics Lecture 4 Harper Langston New York University.
So far we have learned about:
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Nondeterministic Finite Automata
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
Theoretical Computer Science COMP 335 Fall 2004
Introduction to Finite Automata Adapted from the slides of Stanford CS154.
Introduction to Proofs Goals 1.Introduce notion of proof & basic proof methods. 2.Distinguish between correct & incorrect arguments 3.Understand & construct.
Decision Properties of Regular Languages
1 Regular Expressions Definitions Equivalence to Finite Automata.
Mathematical Induction Assume that we are given an infinite supply of stamps of two different denominations, 3 cents and and 5 cents. Prove using mathematical.
1 CSCI 2400 section 3 Models of Computation Instructor: Costas Busch.
CISC 2315 Discrete Structures Professor William G. Tanner, Jr. Fall 2010 Slides created by James L. Hein, author of Discrete Structures, Logic, and Computability,
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
Introduction to Proofs
Reading and Writing Mathematical Proofs
Mathematics Review Exponents Logarithms Series Modular arithmetic Proofs.
MATH 224 – Discrete Mathematics
Copyright © Cengage Learning. All rights reserved. CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF ELEMENTARY NUMBER THEORY AND METHODS OF PROOF.
1 Chapter 1 Automata: the Methods & the Madness Angkor Wat, Cambodia.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
CSC201 Analysis and Design of Algorithms Asst.Proof.Dr.Surasak Mungsing Oct-151 Lecture 2: Definition of algorithm and Mathematical.
1 Section 1.1 A Proof Primer A proof is a demonstration that some statement is true. We normally demonstrate proofs by writing English sentences mixed.
CSE 311 Foundations of Computing I Lecture 8 Proofs and Set Theory Spring
1 Chapter 1 Introduction to the Theory of Computation.
Slides for CISC 2315: Discrete Structures Chapters CISC 2315 Discrete Structures Professor William G. Tanner, Jr. SPRING 2010 Slides created by James.
Lecture 05: Theory of Automata:08 Kleene’s Theorem and NFA.
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
Introduction to Finite Automata
CISC 2315 Discrete Structures Professor William G. Tanner, Jr. Spring 2011 Slides created by James L. Hein, author of Discrete Structures, Logic, and Computability,
1 Put your name if you want your attendance credit. Please put your as well. CSC 320 is done at 11:30 so I did NOT fill in the box for 11:30 for.
Fall 2005Costas Busch - RPI1 Mathematical Preliminaries.
Prof. Busch - LSU1 Mathematical Preliminaries. Prof. Busch - LSU2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Reading and Writing Mathematical Proofs Spring 2015 Lecture 4: Beyond Basic Induction.
Induction Proof. Well-ordering A set S is well ordered if every subset has a least element. [0, 1] is not well ordered since (0,1] has no least element.
Proofs, Induction and Recursion Basic Proof Techniques Mathematical Induction Recursive Functions and Recurrence Relations.
Theory of Computation, Feodor F. Dragan, Kent State University 1 TheoryofComputation Spring, 2015 (Feodor F. Dragan) Department of Computer Science Kent.
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Mathematical Preliminaries
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
THEORY OF COMPUTATION Komate AMPHAWAN 1. 2.
CS 203: Introduction to Formal Languages and Automata
Introduction to Finite Automata
Lecture 1 Overview Topics 1. Proof techniques: induction, contradiction Proof techniques June 1, 2015 CSCE 355 Foundations of Computation.
1 Regular Expressions Definitions Equivalence to Finite Automata.
Classifications LanguageGrammarAutomaton Regular, right- linear Right-linear, left-linear DFA, NFA Context-free PDA Context- sensitive LBA Recursively.
1 Mathematical Preliminaries. 2 Sets Functions Relations Graphs Proof Techniques.
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
Deterministic Finite Automata
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Introduction to Proofs Goals 1.Introduce notion of proof & basic proof methods. 2.Distinguish between correct & incorrect arguments 3.Understand & construct.
Chapter 1 Logic and Proof.
CSCE 355 Foundations of Computation
Methods of Proof.
CSCE 355 Foundations of Computation
Introduction to Finite Automata
CSCI-2400 Models of Computation.
Mathematical Preliminaries
Introduction to Proofs
Presentation transcript:

1 Quiz Friday 8-29 Lectures: introduction and methods of proof Text: pp 1-26

2 Methods of Proof

u Deductive proof: wUsed extensively in geometry & trigonometry wNot very important in this class u Inductive proof: wBasis of most automata theory wProficiency in induction is a primary objective of this class 3

Deductive proof uStep-by-step argument from given information to a conclusion u“from the information that you gave me, I deduce that ….” uNo internal assumptions are allowed uExample: proving that sets are equivalent 4

Proving equivalences about sets uIn automata theory frequently ask “Are sets constructed in different ways actually the same set?” uElements of sets are usually strings; hence sets are called “languages” uStatement “set E = set F” means every element in E is in F and every element in F is in E 5

Equivalent sets 2 u set E = set F is example of “if and only if” uElement x is in E if and only if x is in F uTo prove E = F must prove 2 if…then statements wIf x is in E then x is in F wIf x is in F then x is in E 6

Background on sets uIf x  A implies x  B, then A is a subset of B (written A  B) uIf, in addition, A  B then A is a proper subset of B (written A  B) u A  B = intersection of sets A and B defined by {x: x  A and x  B } uA  B = union of sets A and B defined by {x: x  A or x  B } 7

Background on sets 2 uA - B = difference of sets A and B defined by {x: x  A and x  B } uLet T be complement of S with respect to U then S  U, T  U, S  T = U, and S  T = null uSets obey laws similar to numbers (commutative, associative, distributive, etc) 8

Proof of distributive law of sets uR  (S  T) = (R  S)  (R  T) uLet E = R  (S  T) uLet F = (R  S)  (R  T) uMust prove wif x is in E then x is in F wif x is in F then x is in E 9

Proof of distributive law of sets 2 if x  R  (S  T) then x  R or x  (S  T) (def. of union) x  R or x  S and x  T (def. of intersection) x  R  S (def. of union) x  R  T (def. of union) x  (R  S)  (R  T) (def. of intersection) 10

Proof of distributive law of sets 3 if x  (R  S)  (R  T) then x  R  S (def. of intersection) x  R  T (def. of intersection) x  R or x  S and x  T (why?) x  R or x  (S  T) (def. of intersection) x  R  (S  T) (def. of union) 11

Contrapositives uGiven hypothesis H and conclusion C, one of following cases is true w1. H and C are both true w2. H is true and C is false w3. H is false and C is true w4. H and C are both false 12 uOnly (2) makes “if H then C” false u(3) does not apply to “if H then C” uIn both (1) and (4) “if H then C” is true

Contrapositives 2 uContrapositive of “if H then C” is “if not C then not H” wHypothesis is “not C” wConclusion is “not H” w4 cases of previous slide still apply 13 uOnly (2) makes “if not C then not H” false u(3) does not apply to “if not C then not H” uIn (1) and (4) “if not C then not H” is true uhence “if not C then not H” is equivalent to “if H then C” and may be easier to prove

Contrapositive 3 uContrapositive of “if x > 4 then 2 x > x 2” is “if 2 x < x 2 then x < 4” uSometimes contrapositive is easier to prove. uCan this contrapositive be proved by algebra? 14

Proof by contradiction Proving “if H and not C -> falsehood” is equivalent to proving “if H then C” Example using complement of a set 15

Proof by contradiction 2 uT is the complement of S with respect to U then S  U, T  U, S  T = U, and S  T = null uIf S is finite and U is infinite, then T is infinite uHypothesis has 3 parts wT is complement of S wS is finite wU is infinite uConclusion is “T is infinite” unot C is “T is finite” 16

Proof by contradiction 3 uIf T is finite, then ||T||=some integer m uS is finite; therefore ||S||=some integer n uT is complement of S with respect to U; therefore; S  T = U and S  T = null uHence, ||U||=m+n uBy definition, this means U is finite uH and not C contradicts part of H uThis proves “if H then C” 17

Inductive proof u Many types of induction u Induction on integers is most familiar 18

Induction on integers uS(n) is statement about integers we want to prove uBase case establishes truth of the statement for n=i s typically the smallest integer where statement is true uInductive step proves statement for n>i s typically by “if S(n) then S(n+1)” u“if S(n)” is called the “inductive hypothesis” 19

How I grade inductive proofs u Proof of base case u Statement of inductive hypothesis u How inductive hypothesis is used wBasis for algebra that completes the proof wAll algebraic operations are on the rhs of equals sign 20

Assignment #1 Due Prove by induction on integers that  k=1 to n k = n(n+1)/2 Your proof must include the following: (1) truth of base case (2) statement of inductive hypothesis (3) correct application of inductive hypothesis

22 uBasis can consist of a range of i values, all of which must be used in the inductive step. u“if S(n-1) then S(n)” is equivalent to “if S(n) then S(n+1)” uExample: if S(n-1) then S(n) applied to assignment 1 Exceptions to typical approach

23 Prove  j=1 to n j = n(n+1)/2 Base case n=1  j=1 to 1 j = 1(1+1)/2

24 Review Induction used 2 ways in the class recursive definitions proofs Both have 3 parts base case assumption (IH) induction Example: definition of tree and proof that n=e+1

Structural Induction uAutomata theory involves recursive definitions that become the subject of inductive proofs. uExample: recursive definition of a tree wBasis: single node is a tree wIH: assume that T 1, … T k are trees wInduction: connect then to the node that is root of a recursively defined tree 25

Structural induction 2 uProve: in every tree n = e +1, where n is the number of nodes and e is the number of edges uBasis: true for single-node tree uIH: assume n i =e i +1 true for trees T 1, …, T k uInduction: wn=1+n 1 +n 2 +…+n k = 1+(e 1 +1)+…+(e k +1) wn=1+k+e 1 +…+e k = 1+e 26

Switch automaton uNodes are states; Arcs are transitions uArcs labeled by strings that induce the indicated transitions uArrow indicates the start state 27 off push on Start push

Data transfer automaton uData induces transition to sending uLoop keeps automaton in sending state until transmission is done u“Ready” and “Sending” are complex states uMany conditions must be met for automaton to be in these states 28 ReadySending data in done timeout Start

Mutual Induction uAn inductive hypothesis may have several facets uExample: all the conditions necessary to put an automaton in a certain state uIf all facets depend on a common value of an integer, then we have “mutual induction” 29

Example of Mutual Induction uS1(n): automaton in the off state after n pushes iff n is even uS2(n): automaton is in the on state after n pushes iff n is odd 30 off push on Start push Prove the following about the “switch” automaton

Both S 1 (n) and S 2 (n) are iff uIf n is even, then switch is off uIf switch is off, then n is even uIf n is odd, then switch is on uIf switch is on, then n is odd 31 off push on Start push Given that switch starts in “off” we must prove that after n pushes …

Prove : if n is even then switch is off uIH: if k is odd then switch is on uIf n is even then n-1 is odd uBy IH, switch is on after n-1 pushes uOne more push tunes switch off uSimilar proof for other 3 statements 32 off push on Start push Basis: n=0 true zero even by definition and switch starts in off

33

Mutual Induction 3 u“switch” automata is always in exactly one state. Not generally true uone-state character of switch makes this example of mutual induction artificial uProof of S1(n) implies the truth of S2(n) uText treats as mutual induction 34 off push on Start push

Loop invariant and induction uLoop invariant is statement about iterative algorithm uProve the statement is true by induction uShow true before 1 st iteration (base case or initialization) uIf true on i th iteration (inductive hypothesis) remains true before i+1 iteration (maintenance) 35

Loop invariant Termination uAspect of loop invariant analysis that goes beyond general inductive proof uHaving establish that the loop invariant is true, statement of the loop invariant when looping terminates proves the correctness of the iterative algorithm 36

Example: Sort by insertion 37

Validation is usual approach in code development uTest code for some simple cases were hand calculation is practical uIf a “validated” code fails, usually learn something important uIn CS 317 get some practice with formal proofs 38