Adam Blank Spring 2017 CSE 311. Foundations of Computing I

Similar documents
CSE 311: Foundations of Computing I. Spring 2015 Lecture 1: Propositional Logic

CSE 311: Foundations of Computing I

CSE 311: Foundations of Computing I. Lecture 1: Propositional Logic

CSE 311: Foundations of Computing I. Lecture 1: Propositional Logic

Introduction Propositional Logic

Course Staff. Textbook

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

Consider the following propositions: p: lecture has started q: If I have a banana, then I have a pear r: I finished this problem

CSE 240 Logic and Discrete Mathematics

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

DISCRETE STRUCTURES WEEK5 LECTURE1

Math.3336: Discrete Mathematics. Propositional Equivalences

Math.3336: Discrete Mathematics. Applications of Propositional Logic

Lecture 02: Propositional Logic

An Introduction to Logic 1.1 ~ 1.4 6/21/04 ~ 6/23/04

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

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall

Logic and Proofs. (A brief summary)

2/13/2012. Logic: Truth Tables. CS160 Rosen Chapter 1. Logic?

CS 340: Discrete Structures for Engineers

Discrete Structures for Computer Science

MA103 STATEMENTS, PROOF, LOGIC

TRUTH TABLES LOGIC (CONTINUED) Philosophical Methods

Propositional Logic. Spring Propositional Logic Spring / 32

ICS141: Discrete Mathematics for Computer Science I

Overview. 1. Introduction to Propositional Logic. 2. Operations on Propositions. 3. Truth Tables. 4. Translating Sentences into Logical Expressions

EECS 1028 M: Discrete Mathematics for Engineers

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

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

CSE507. Course Introduction. Computer-Aided Reasoning for Software. Emina Torlak

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

Compound Propositions

Sec$on Summary. Propositions Connectives. Truth Tables. Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional

Chapter 1: The Logic of Compound Statements. January 7, 2008

Today s Topic: Propositional Logic

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

CSC Discrete Math I, Spring Propositional Logic

Section A (not in the text) Which of the following are statements? Explain. 3. The President of the United States in 2089 will be a woman.

Discrete Mathematics

CSE 20 DISCRETE MATH. Fall

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

About the course. CSE 321 Discrete Structures. Why this material is important. Topic List. Propositional Logic. Administration. From the CSE catalog:

Logic. Def. A Proposition is a statement that is either true or false.

Logic and Proofs. (A brief summary)

Section 1.2: Conditional Statements

CSE 20: Discrete Mathematics

Introduction Propositional Logic. Discrete Mathematics Andrei Bulatov

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

1.1 Language and Logic

A Statement; Logical Operations

Propositional Logic. Fall () Propositional Logic Fall / 30

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

Deduction by Daniel Bonevac. Chapter 3 Truth Trees

1.1 Language and Logic

Box. Turn in your e xam to Kathy Stackhouse in Chem 303 by noon on Thursday, March 30.

Mat 243 Exam 1 Review

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

Introducing Proof 1. hsn.uk.net. Contents

Mathematical Logic Part One

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

LOGIC CONNECTIVES. Students who have an ACT score of at least 30 OR a GPA of at least 3.5 can receive a college scholarship.

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

Definition 2. Conjunction of p and q

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

PROPOSITIONAL CALCULUS

Self-reproducing programs. And Introduction to logic. COS 116, Spring 2012 Adam Finkelstein

Proposition/Statement. Boolean Logic. Boolean variables. Logical operators: And. Logical operators: Not 9/3/13. Introduction to Logical Operators

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

Mathematical Logic Part One

2.1 Start Thinking. 2.1 Warm Up. 2.1 Cumulative Review Warm Up

CSE507. Introduction. Computer-Aided Reasoning for Software. Emina Torlak courses.cs.washington.edu/courses/cse507/17wi/

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

MAT2345 Discrete Math

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

15414/614 Optional Lecture 1: Propositional Logic

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

CSE 20: Discrete Mathematics

LECTURE 1. Logic and Proofs

Logic and Propositional Calculus

Mathematical Reasoning (Part I) 1

Note: The area of logic that deals with propositions is called the propositional calculus or propositional logic.

Overview, cont. Overview, cont. Logistics. Optional Reference #1. Optional Reference #2. Workload and Grading

CSE 311: Foundations of Computing. Lecture 2: More Logic, Equivalence & Digital Circuits

CS Module 1. Ben Harsha Apr 12, 2017

Boolean Logic. CS 231 Dianna Xu

The Foundations: Logic and Proofs. Part I

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

Today s Topics. Methods of proof Relationships to logical equivalences. Important definitions Relationships to sets, relations Special functions

PHIL 422 Advanced Logic Inductive Proof

Propositional Logic 1

~ p is always false. Based on the basic truth table for disjunction, if q is true then p ~

Logic and Propositional Calculus

Numbers that are divisible by 2 are even. The above statement could also be written in other logically equivalent ways, such as:

Introduction to Theoretical Computer Science

Chapter 5: Section 5-1 Mathematical Logic

The statement calculus and logic

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

A statement is a sentence that is definitely either true or false but not both.

Transcription:

Adam Blank Spring 2017 CSE 311 Foundations of Computing I

CSE 311: Foundations of Computing I Lecture 1: Propositional Logic

Some Perspective Computer Science and Engineering Programming CSE 14x Theory Hardware CSE 311

About the Course We will study the theory needed for CSE: Logic:" How"can"we"describe"ideas"precisely? Formal Proofs: How"can"we"be"positive,we re"correct? Number2Theory: How"do"we"keep"data"secure? Relations/Relational2Algebra: How"do"we"store"information? Finite2State2Machines: How"do"we"design"hardware"and"software? Turing2Machines: Are"there"problems"computers"can t solve?

About the Course It s about perspective! Example: Sudoku Given one, solve it by hand Given most, solve them with a program Given any, solve it with computer science Tools for reasoning about difficult problems Tools for communicating ideas, methods, objectives Tools for automating difficult problems Fundamental structures for computer science This is NOT a programming course!

Administrivia Instructor: Adam Blank Teaching Assistants: Christopher Choi Michael Lee Halden Lin Elizabeth Moore Nicole Riley Logan Weber Jefferson Van Wagenen (Optional) Books: Rosen, Velleman, MIT Book Don t buy new copies! Aaron Johnston Andrew Li Karishma Mandyam Andrew Murray Forrest Timour Christine Wolf Homework: Due 11:30pm Write up individually Section: Thursdays Grading (roughly): 50% Homework 20% Midterm 30% Final Exam All Course Information @ cs.uw.edu/311

Logic: The Language of Reasoning Why not use English? Turn right here Does right mean the direction or now? Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo This means Bison from Buffalo, that bison from Buffalo bully, themselves bully bison from Buffalo. We saw her duck Does duck mean the animal or crouch down? Language of Reasoning like Java or English Words, sentences, paragraphs, arguments Today is about words and sentences

Why Learn A New Language? Logic, as the language of reasoning, will help us Be more precise Be more concise Figure out what a statement means more quickly

Propositions A proposition is a statement that has a truth value, and is well-formed

Are These Propositions? 2 + 2 = 5 The home page renders correctly in IE. Turn in your homework on Wednesday. This statement is false. Akjsdf! Who are you? Every positive even integer can be written as the sum of two primes.

Are These Propositions? 2 + 2 = 5 This is a proposition. It s okay for propositions to be false. The home page renders correctly in IE. This is a proposition. It s okay for propositions to be false. Turn in your homework on Wednesday. This is a command which means it doesn t have a truth value. This statement is false. This statement does not have a truth value! (If it s true, it s false, and vice versa.) Akjsdf! This is not a proposition because it s gibberish. Who are you? This is a question which means it doesn t have a truth value. Every positive even integer can be written as the sum of two primes. This is a proposition. We don t know if it s true or false, but we know it s one of them!

Propositions A proposition is a statement that has a truth value, and is well-formed We need a way of talking about arbitrary ideas Propositional Variables:!, #, $, %, Truth Values: T for true F for false

A Proposition Roger is an orange elephant who has toenails if he has tusks, and has toenails, tusks, or both. We d like to understand what this proposition means. This is where logic comes in. There are pieces that appear multiple times in the phrase (e.g., Roger has tusks ). These are called atomic propositions. Let s list them: RElephant: Roger is an orange elephant RTusks: Roger has tusks RToenails: Roger has toenails

Putting Them Together Roger is an orange elephant who has toenails if he has tusks, and has toenails, tusks, or both. RElephant: Roger is an orange elephant RTusks: RToenails: Roger has tusks Roger has toenails Now, we put these together to make the sentence: RElephant and (RToenails if RTusks) and (RToenails or RTusks or (RToenails and RTusks)) This is the general idea, but now, let s define our formal language.

Logical Connectives Negation (not)! Conjunction (and)!( (# Disjunction (or)!( (# Exclusive Or! # Implication! # Biconditional! # RElephant: Roger is an orange elephant RTusks: Roger has tusks RToenails: Roger has toenails Roger is an orange elephant who has toenails if he has tusks, and has toenails, tusks, or both. RElephant and (RToenails if RTusks) and (RToenails or RTusks or (RToenails and RTusks))

Logical Connectives Negation (not)! Conjunction (and)!( (# Disjunction (or)!( (# Exclusive Or! # Implication! # Biconditional! # RElephant: Roger is an orange elephant RTusks: Roger has tusks RToenails: Roger has toenails Roger is an orange elephant who has toenails if he has tusks, and has toenails, tusks, or both. RElephant and (RToenails if RTusks) and (RToenails or RTusks or (RToenails and RTusks)) RElephant (RToenails if RTusks ) (RToenails RTusks (RToenails RTusks))

Some Truth Tables p p p q p# q p q p# q p q p# q

Some Truth Tables p p T F F T p q p# q T T T T F F F T F F F F p q p# q T T T T F T F T T F F F p q p# q T T F T F T F T T F F F

Implication If it s raining, then I have my umbrella It s useful to think of implications as promises. That is Did I lie? p q p q T T T T F F F T T F F T I"have"my" umbrella I"do"not"have" my"umbrella It s"raining It s"not"raining

Implication If it s raining, then I have my umbrella It s useful to think of implications as promises. That is Did I lie? p q p q T T T T F F F T T F F T I"have"my" umbrella I"do"not"have" my"umbrella It s"raining No Yes It s"not"raining No No The only lie is when: (a) It s raining AND (b) I don t have my umbrella

Implication If it s raining, then I have my umbrella Are these true? 2 + 2 = 4 earth is a planet p q p q T T T T F F F T T F F T 2 + 2 = 5 bears are commonly found near seals

!( (# (1) I have collected all 151 Pokémon if I am a Pokémon master (2) I have collected all 151 Pokémon only if I am a Pokémon master These sentences are duals of each other: (1) (2)

!( (# Implication: p implies q whenever p is true q must be true if p then q q if p p is sufficient for q p only if q p q p q T T T T F F F T T F F T

Biconditional:!( (# p iff q p is equivalent to q p implies q and q implies p p q p( q T T T T F F F T F F F T