CS2420: Lecture 2 Vladimir Kulyukin Computer Science Department Utah State University.

Slides:



Advertisements
Similar presentations
Introduction to Proofs
Advertisements

Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Induction: One Step At A Time Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 4Jan 22, 2004Carnegie Mellon University.
CS2420: Lecture 24 Vladimir Kulyukin Computer Science Department Utah State University.
Self-Reference - Induction Cmput Lecture 7 Department of Computing Science University of Alberta ©Duane Szafron 1999 Some code in this lecture is.
CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.
CSE115/ENGR160 Discrete Mathematics 01/31/12 Ming-Hsuan Yang UC Merced 1.
1 Intro to Induction Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong.
CSE115/ENGR160 Discrete Mathematics 02/01/11
CS2420: Lecture 27 Vladimir Kulyukin Computer Science Department Utah State University.
So far we have learned about:
CS 5000: Lecture 37 Vladimir Kulyukin Department of Computer Science Utah State University.
CS2420: Lecture 15 Vladimir Kulyukin Computer Science Department Utah State University.
1 Homework #1 Solutions 2 #1. True or False a)Given a language (set of strings) L, the question: “Is string w  L” is a decision problem: T F b)  =
Great Theoretical Ideas in Computer Science for Some.
C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester Prepared by: amani Omer.
Methods of Proof & Proof Strategies
CISC 2315 Discrete Structures Professor William G. Tanner, Jr. Fall 2010 Slides created by James L. Hein, author of Discrete Structures, Logic, and Computability,
Introduction to Proofs
Discrete Mathematics, Part II CSE 2353 Fall 2007 Margaret H. Dunham Department of Computer Science and Engineering Southern Methodist University Some slides.
Copyright © Cengage Learning. All rights reserved. CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF ELEMENTARY NUMBER THEORY AND METHODS OF PROOF.
Methods of Proofs PREDICATE LOGIC The “Quantifiers” and are known as predicate quantifiers. " means for all and means there exists. Example 1: If we.
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.
10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Methods of Proof Lecture 3: Sep 9. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical.
Slides for CISC 2315: Discrete Structures Chapters CISC 2315 Discrete Structures Professor William G. Tanner, Jr. SPRING 2010 Slides created by James.
CISC 2315 Discrete Structures Professor William G. Tanner, Jr. Spring 2011 Slides created by James L. Hein, author of Discrete Structures, Logic, and Computability,
Great Theoretical Ideas in Computer Science.
Logical Reasoning:Proof Prove the theorem using the basic axioms of algebra.
Discrete Structures & Algorithms More on Methods of Proof / Mathematical Induction EECE 320 — UBC.
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/18 Module.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 The Foundations: Logic and Proofs Introduction to Proofs.
Methods of Proof Dr. Yasir Ali. Proof A (logical) proof of a statement is a finite sequence of statements (called the steps of the proof) leading from.
COMPSCI 102 Discrete Mathematics for Computer Science.
Inductive Reasoning Great Theoretical Ideas In Computer Science Victor AdamchikCS Spring 2010 Lecture 2Jan 14, 2010Carnegie Mellon University.
4.1 Proofs and Counterexamples. Even Odd Numbers Find a property that describes each of the following sets E={…, -4, -2, 0, 2, 4, 6, …} O={…, -3, -1,
Great Theoretical Ideas in Computer Science.
Inverse, Contrapositive & indirect proofs Sections 6.2/6.3.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Math Review 1.
CS104:Discrete Structures Chapter 2: Proof Techniques.
5.1 Indirect Proof Objective: After studying this section, you will be able to write indirect proofs.
COMPSCI 102 Introduction to Discrete Mathematics.
Section 1.7. Definitions A theorem is a statement that can be shown to be true using: definitions other theorems axioms (statements which are given as.
Direct Proof and Counterexample I Lecture 11 Section 3.1 Fri, Jan 28, 2005.
5-5 Indirect Proof. Indirect Reasoning: all possibilities are considered and then all but one are proved false. The remaining possibility must be true.
Introduction to Proofs. The use of Reasoning and Logic in proofs Inductive Reasoning- “reasoning from detailed facts to general principles” – Specific.
Lecture 1.5: Proof Techniques CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren 1.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
Notions & Notations - 1ICOM 4075 (Fall 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Fall 2010 ICOM.
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
Proof And Strategies Chapter 2. Lecturer: Amani Mahajoub Omer Department of Computer Science and Software Engineering Discrete Structures Definition Discrete.
1 Proofs by Counterexample & Contradiction There are several ways to prove a theorem:  Counterexample: By providing an example of in which the theorem.
Chapter 1 Logic and Proof.
11.7 – Proof by Mathematical Induction
Chapter 4 (Part 1): Induction & Recursion
CISC 2315 Discrete Structures
Direct Proof by Contraposition Direct Proof by Contradiction
Mathematical Induction II
Induction: One Step At A Time
Induction: One Step At A Time
Visual Basic – Decision Statements
Section 2.1 Proof Techniques Introduce proof techniques:   o        Exhaustive Proof: to prove all possible cases, Only if it is about a.
Geometry.
Direct Proof and Counterexample I
Copyright © Cengage Learning. All rights reserved.
Chapter 5 Parallel Lines and Related Figures
Induction: One Step At A Time
5.1 Indirect Proof Let’s take a Given: Prove: Proof: Either or
Presentation transcript:

CS2420: Lecture 2 Vladimir Kulyukin Computer Science Department Utah State University

Outline Useful Proof Techniques (Sections 1.2.5, 1.3)

Useful Proof Techniques Direct proof Proof by contradiction Proof by counterexample Proof by induction

Direct Proof Need to Show: If P, then Q. (P  Q). Assume that P is true and use the axioms, definitions, and previous theorems to show that Q is true.

Direct Proof: Example

Proof By Contradiction Need to show: If P, then Q. Assume that P is true and Q is false and find a contradiction, i.e., a statement that contradicts another true statement. A contradiction is typically the negation of a statement that is known or assumed to be true. Remember that what is assumed to be true (P) remains true throughout the proof.

Proof By Contradiction: Example 1 You have three classes: P, Q, and R in a software module M. P is loaded automatically. Q must be loaded manually or kept out. You know that R is loaded either by P or by Q but not by both. P must be loaded and R must be loaded for M to run. You need to decide whether to load Q.

Proof By Contradiction: Example 1 Consider the following scenario: –Q is kept out. –P is loaded. –M does not run. Since M does not run, R must have failed to load. The last statement is a contradiction because R must be loaded.

Proof By Contradiction: Example 1 To what do we attribute the failure? To the decision to keep Q out. Thus, if M does not run, Q must be loaded.

Proof By Contradiction: Example 2

Proof By Contradiction: Example 3

Proof By Contradiction: Example 4

Proof By Counterexample Given a statement P, produce an example that contradicts P. Show that All numbers are even. Counterexample: Any odd number.

Proof By Induction: Example 5 We place a set of blocks numbered 1, 2, …, N on the table. We want to be convinced that if we knock the first block down, then all blocks will fall.

The Structure of the Inductive Proof Base Case: We need to show that the first domino will be knocked down. Induction: We need to show that if one domino falls (Inductive Hypothesis), the next one will fall two. If we can show the base case and induction, we will be convinced that all dominos will fall.

Why Does This Code Work? long fact(long n) { if ( n == 0 ) return 1; else return n * fact (n – 1); }

Why Does This Code Work? We can use induction to convince ourselves that it works without running it. We show that the base case, which is f(0), is directly computable. We then argue that if we can compute f(n), we can compute f(n+1).