Review for Midterm 1. Andreas Klappenecker

Similar documents
Review 1. Andreas Klappenecker

Predicate Logic. Andreas Klappenecker

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

Review 3. Andreas Klappenecker

CSCE 222 Discrete Structures for Computing. Predicate Logic. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

CSCE 222 Discrete Structures for Computing. Review for the Final. Hyunyoung Lee

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

software design & management Gachon University Chulyun Kim

Steinhardt School of Culture, Education, and Human Development Department of Teaching and Learning. Mathematical Proof and Proving (MPP)

Logic Overview, I. and T T T T F F F T F F F F

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Rules Build Arguments Rules Building Arguments

1 The Foundation: Logic and Proofs

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

CSCE 222 Discrete Structures for Computing. Propositional Logic. Dr. Hyunyoung Lee. !!!!!! Based on slides by Andreas Klappenecker

PROPOSITIONAL CALCULUS

Discrete Structures for Computer Science

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

1 The Foundation: Logic and Proofs

CSC Discrete Math I, Spring Propositional Logic

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

CPSC 121: Models of Computation

Review: Potential stumbling blocks

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Outline. Rules of Inferences Discrete Mathematics I MATH/COSC 1056E. Example: Existence of Superman. Outline

cse 311: foundations of computing Fall 2015 Lecture 6: Predicate Logic, Logical Inference

Math.3336: Discrete Mathematics. Nested Quantifiers/Rules of Inference

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

2-4: The Use of Quantifiers

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

Logic and Proof. Aiichiro Nakano

The Logic of Compound Statements cont.

1.1 Statements and Compound Statements

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Do not start until you are given the green signal

Introduction to Decision Sciences Lecture 2

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

1.1 Language and Logic

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

Chapter 1 Elementary Logic

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

Readings: Conjecture. Theorem. Rosen Section 1.5

It rains now. (true) The followings are not propositions.

CSE 20 DISCRETE MATH. Winter

Supplementary Logic Notes CSE 321 Winter 2009

2. Use quantifiers to express the associative law for multiplication of real numbers.

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

Chapter 3. The Logic of Quantified Statements

Logic, Sets, and Proofs

Discrete Mathematics Logics and Proofs. Liangfeng Zhang School of Information Science and Technology ShanghaiTech University

Propositional Logic. Spring Propositional Logic Spring / 32

DISCRETE MATHEMATICS BA202

3 The Semantics of the Propositional Calculus

Přednáška 12. Důkazové kalkuly Kalkul Hilbertova typu. 11/29/2006 Hilbertův kalkul 1

Section 1.2: Propositional Logic

Rules of Inference. Arguments and Validity

ICS141: Discrete Mathematics for Computer Science I

Propositional Logic. Fall () Propositional Logic Fall / 30

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

CSE 20 DISCRETE MATH. Fall

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Proofs. Example of an axiom in this system: Given two distinct points, there is exactly one line that contains them.

COMP 2600: Formal Methods for Software Engineeing

Mat 243 Exam 1 Review

Chapter 2: The Logic of Quantified Statements

Discrete Mathematical Structures: Theory and Applications

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Logic and Proofs. (A brief summary)

Math 3336: Discrete Mathematics Practice Problems for Exam I

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

HANDOUT AND SET THEORY. Ariyadi Wijaya

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction.

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

Introduction to Sets and Logic (MATH 1190)

Chapter 4, Logic using Propositional Calculus Handout

Manual of Logical Style

Section 1.1 Propositions

Intro to Logic and Proofs

PHIL 50 - Introduction to Logic

MATH 2001 MIDTERM EXAM 1 SOLUTION

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE

Boolean Algebra and Proof. Notes. Proving Propositions. Propositional Equivalences. Notes. Notes. Notes. Notes. March 5, 2012

ICS141: Discrete Mathematics for Computer Science I

1.1 Language and Logic

MACM 101 Discrete Mathematics I. Exercises on Propositional Logic. Due: Tuesday, September 29th (at the beginning of the class)

Mathematical Reasoning Rules of Inference & Mathematical Induction. 1. Assign propositional variables to the component propositional argument.

A. Propositional Logic

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007)

Logic and Proof. On my first day of school my parents dropped me off at the wrong nursery. There I was...surrounded by trees and bushes!

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

THE LOGIC OF COMPOUND STATEMENTS

Transcription:

Review for Midterm 1 Andreas Klappenecker

Topics Chapter 1: Propositional Logic, Predicate Logic, and Inferences Rules Chapter 2: Sets, Functions (Sequences), Sums Chapter 3: Asymptotic Notations and Complexity of Algorithms Ruby - but it will not be on the test

Chapter 1 Propositional Logic (true, false; and, or, not, conditional, biconditional; logical equivalence, tautology, satisfiability) Predicate Logic (all of the above plus predicates and quantifiers) Rules of Inference (modus ponens, modus tollens, etc.)

Grammar of Prop formula ::= formula ( formula formula ) ( formula formula ) ( formula formula ) ( formula formula ) ( formula formula ) symbol

Propositional Logic

Semantics Let B={t,f}. Assign to each connective a function M: B->B that determines its semantics. y if P M (P ) f t t f is false. P Q M (P, Q) M (P, Q) M (P, Q) M (P, Q) M (P, Q) f f f f f t t f t f t t t f t f f t t f f t t t t f t t

Summary Summary. Informally, we can summarize the meaning of the connectives as follows: 1) The and connective (a b) is true if and only if both a and b are true. 2) The or connective (a b) is true if and only if at least one of a, b is true. 3) The exclusive or (a b) is true if and only if precisely one of a, b is true. 4) The implication (a b) is false if and only if the premise a is true and the conclusion b is false. 5) The biconditional connective (a b) is true if and only if the truth values of a and b are the same. An interpretation of a subset S of Prop is an assignment of truth values to all variables that occur in the propositions contained in S. We showed that there exist a unique valuation extending an interpretation of all propositions.

Valuations A valuation v : Prop B is a function that assigns a truth value to each proposition in Prop such that V1. v a = M (va) V2. v(a b) = M (va,vb) V3. v(a b) = M (va,vb) V4. v(a b) = M (va,vb) V5. v(a b) = M (va,vb) V6. v(a b) = M (va,vb) holds for all propositions a and b in Prop. The properties V1 V6 ensure that the valuation respects the meaning of the connectives. We can restrict a valuation v to a subset of the set of proposition. If A and B are subsets of Prop such that A B, and v A : A B and v B : B B are valuations, then v B is called an extension of the valuation v A if and only if v B coincides with v A when restricted to A. The consistency conditions V1-V6 are quite stringent, as the next theorem

Tautology, Satisfiability,... Two predicates p and q are logically equivalent if and only if v[[p]] = v[[q]] holds for all valuations v. A predicate p is called a tautology if and only if v[[p]]=t holds for all valuations v A predicate p is called satisfiable if and only if v[[q]]=t for some valuation v.

Predicate Logic

Predicates A function P from a set D to the set Prop of propositions is called a predicate. The set D is called the domain of P. Example: Let D=Z be the set of integers. Let a predicate P: Z -> Prop be given by P(x) = x>3. The predicate itself is neither true or false. However, for any given integer the predicate evaluates to a truth value. P(4) is true P(2) is false

Universal Quantifier (1) Let P be a predicate with domain D. The statement P(x) holds for all x in D can be written shortly as xp(x)

Existential Quantifier The statement P(x) holds for some x in the domain D can be written as x P(x) Example: x (x>0 x 2 = 2) is true if the domain is the real numbers but false if the domain is the rational numbers.

Logical Equivalence (1) Two statements involving quantifiers and predicates are logically equivalent if and only if they have the same truth values no matter which predicates are substituted into these statements and which domain is used. We write A B for logically equivalent A and B.

De Morgan s Laws xp (x) x P (x) xp (x) x P (x) (p q) p q (p q) p q

Example x(p (x) Q(x)) x(p (x) Q(x)) Proof: x(p (x) Q(x)) x (P (x) Q(x)) x ( P (x) Q(x)) x( P (x) Q(x) x(p (x) Q(x))

Rules of Inference

Valid Arguments An argument in propositional logic is a sequence of propositions that end with a proposition called conclusion. The argument is called valid if the conclusion follows from the preceding statements (called premises). In other words, in a valid argument it is impossible that all premises are true but the conclusion is false.

Modus Ponens The tautology (p (p->q)) -> q is the basis for the rule of inference called modus ponens. p p -> q ------- q

Modus Tollens q p -> q ------ p The University will not close on Wednesday. If it snows on Wednesday, then the University will close. Therefore, It will not snow on Wednesday

Simplification p q ------ p

Formal Argument p q r p r s s t t

Formal Argument Argument p q r p r s s t t 1) p q Hypothesis 2) p Simplification of 1) 3) r p Hypothesis 4) r Modus tollens using 2) and 3) 5) r s Hyposthesis 6) s Modus ponens using 4), 5) 7) s t Hypothesis 8) t Modus ponens using 6), 7)

Functions, Sets, Sums

<< Work out on board >> Example

Big Oh, etc.

Big Oh Notation Let f,g: N -> R be functions from the natural numbers to the set of real numbers. We write f O(g) if and only if there exists some real number n 0 and a positive real constant U such that f(n) <= U g(n) for all n satisfying n >= n 0

Big Ω We define f(n) = Ω(g(n)) if and only if there exists a constant L and a natural number n 0 such that L g(n) <= f(n) holds for all n >= n 0. In other words, f(n) = Ω(g(n)) if and only if g(n) = O(f(n)).

Example In Analysis of Algorithms, you will learn that any comparison based sorting algorithm needs at least Ω(n log n) comparisons. Mergesort needs O(n log n) comparisons, so this is essentially an optimal sorting algorithm.

Big Θ We define f(n) = Θ(g(n)) if and only if there exist constants L and U and a natural number n 0 such that L g(n) <= f(n) <= U g(n) holds for all n >= n 0. In other words, f(n) = Θ(g(n)) if and only if f(n) = Ω(g(n)) and f(n) = O(g(n)).