CSC165. Larry Zhang, September 23, 2014

Similar documents
Chapter 2. Logical Notation. Bahar Aameri. Department of Computer Science University of Toronto. Jan 09, Mathematical Expression and Reasoning 1

Chapter 2. Logical Notation. Bahar Aameri. Department of Computer Science University of Toronto. Jan 09, Mathematical Expression and Reasoning 1

CSC165 Mathematical Expression and Reasoning for Computer Science

Introduction to Sets and Logic (MATH 1190)

CSC165. Larry Zhang, October 7, 2014

CSC Discrete Math I, Spring Propositional Logic

3.1 Universal quantification and implication again. Claim 1: If an employee is male, then he makes less than 55,000.

Compound Propositions

Math 10850, fall 2017, University of Notre Dame

Section 1.1: Logical Form and Logical Equivalence

Announcements CompSci 102 Discrete Math for Computer Science

Predicate Logic & Quantification

Propositional Logic and Semantics

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

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

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Chapter 1 Elementary Logic

MAT2345 Discrete Math

A Little Deductive Logic

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

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

Preparing for the CS 173 (A) Fall 2018 Midterm 1

Logic, Sets, and Proofs

A Little Deductive Logic

Math.3336: Discrete Mathematics. Propositional Equivalences

PHIL12A Section answers, 16 February 2011

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

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

CSE 20: Discrete Mathematics

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

Today s Lecture. ICS 6B Boolean Algebra & Logic. Predicates. Chapter 1: Section 1.3. Propositions. For Example. Socrates is Mortal

2.2: Logical Equivalence: The Laws of Logic

Predicates, Quantifiers and Nested Quantifiers

THE LOGIC OF COMPOUND STATEMENTS

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

AN INTRODUCTION TO MATHEMATICAL PROOFS NOTES FOR MATH Jimmy T. Arnold

EECS 1028 M: Discrete Mathematics for Engineers

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Transparencies to accompany Rosen, Discrete Mathematics and Its Applications Section 1.3. Section 1.3 Predicates and Quantifiers

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

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

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

Propositional Logic: Semantics

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

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

Definition 2. Conjunction of p and q

Announcements Monday, September 18

PROBLEM SET 3: PROOF TECHNIQUES

CS70: Discrete Math and Probability. Slides adopted from Satish Rao, CS70 Spring 2016 June 20, 2016

Discrete Mathematics and Its Applications

We last time we began introducing equivalency laws.

Functions. Lecture 4: Truth functions, evaluating compound statements. Arithmetic Functions. x y x+y

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Discrete Mathematics and Its Applications

Mat 243 Exam 1 Review

Tautologies, Contradictions, and Contingencies

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

Logic and Proofs. (A brief summary)

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

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010)

Announcement. Homework 1

Logic and Proof. Aiichiro Nakano

LIN1032 Formal Foundations for Linguistics

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Group 5. Jeremy Gutierrez. Jesus Ochoa Perez. Alvaro Gonzalez. MATH 170: Discrete Mathematics. Dr. Lipika Deka. March 14, 2014.

3.4 Set Operations Given a set A, the complement (in the Universal set U) A c is the set of all elements of U that are not in A. So A c = {x x / A}.

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

Proving logical equivalencies (1.3)

Welcome to MAT 137! Course website:

Math 13, Spring 2013, Lecture B: Midterm

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

Variable Names. Some Ques(ons about Quan(fiers (but answers are not proven just stated here!) x ( z Q(z) y P(x,y) )

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

CA320 - Computability & Complexity


Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Propositional Logic Not Enough

Logic and Boolean algebra

ANS: If you are in Kwangju then you are in South Korea but not in Seoul.

CSE 20 DISCRETE MATH WINTER

MACM 101 Discrete Mathematics I. Exercises on Predicates and Quantifiers. Due: Tuesday, October 13th (at the beginning of the class)

Logic and Propositional Calculus

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

Some Review Problems for Exam 1: Solutions

CISC-102 Winter 2016 Lecture 17

CS Module 1. Ben Harsha Apr 12, 2017

Intro to Logic and Proofs

Propositional Equivalence

Propositional logic (revision) & semantic entailment. p. 1/34

Section 2.3: Statements Containing Multiple Quantifiers

Discrete Mathematics

For all For every For each For any There exists at least one There exists There is Some

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

Intermediate Logic. Natural Deduction for TFL

Final Exam Theory Quiz Answer Page

The statement calculus and logic

CSC236 Week 2. Larry Zhang

FOUNDATION OF COMPUTER SCIENCE ETCS-203

Theorem. For every positive integer n, the sum of the positive integers from 1 to n is n(n+1)

Completeness in the Monadic Predicate Calculus. We have a system of eight rules of proof. Let's list them:

Transcription:

CSC165 Larry Zhang, September 23, 2014

Tutorial classrooms T0101, Tuesday 9:10am~10:30am: BA3102 A-F (Jason/Jason) BA3116 G-L (Eleni/Eleni) BA2185 M-T (Madina/Madina) BA2175 V-Z (Siamak/Siamak) T0201: Monday 7:10~8:30pm BA2175* A-D (Ekaterina/Ekaterina) BA1240* E-Li (Gal/Gal) BA2185* Liang-S (Yana/Adam) BA3116 T-Z (Christina/Nadira) T5101: Thursday 7:10~8:30pm BA3116 A-F (Christine/Christine) BA2135 G-Li (Elias/Elias) BA1200* Lin-U (Yiyan/Yiyan) GB244* V-Z (Natalie/Natalie)

slogurl.txt 393 / 447 submitted can still submit on MarkUS if you haven t. can still fix it if you did it wrong a plain TXT file: slogurl.txt NOT slogurl.pdf, slogurl.doc, slogurl.txt.pdf, slogurl.txt. doc, or PDF/DOC renamed to TXT Submit individually If you formed a group with more than one person, email Danny and me with both of your URLs.

Assignment 1 is out http://www.cdf.toronto.edu/~heap/165/f14/assignments/a1.pdf Due on October 3rd, 10:00pm. May work in groups of up to 3 people. Submit on MarkUs: a1.pdf Prefer to use LaTeX, try the following tools www.writelatex.com www.sharelatex.com

Today s agenda More elements of the language of Math Conjunctions Disjunctions Negations Truth tables Manipulation laws

Lecture 3.1 Conjunctions, Disjunctions Course Notes: Chapter 2

Conjunction (AND, ) noun the action or an instance of two or more events or things occurring at the same point in time or space. Synonyms: co-occurrence, coexistence, simultaneity.

Conjunction (AND, ) Combine two statements by claiming they are both true. R(x): Car x is red. F(x): Car x is a Ferrari. predicates! R(x) and F(x): Car x is red and a Ferrari. R(x) F(x)

Which ones are R(x) F(x)

Conjunction (AND, ) As sets (instead of predicates): R: the set of red cars F: the set of Ferrari cars Intersection

What are R, F, R F

Using predicates: R(x) F(x) Using sets: R F

Be careful with English and There is a pen, and a telephone. O: the set of all objects P(x): x is a pen. T(x): x is a telephone. There is a pen-phone!

Be careful with English and There is a pen, and a telephone. O: the set of all objects P(x): x is a pen. T(x): x is a telephone.

Be careful, even in math The solutions are x < 20 and x > 10. A B A B The solutions are x > 20 and x < 10. A B A B

Disjunction

Disjunction (OR, ) Combine two statements by claiming that at least one of them is true. R(x): Car x is red. F(x): Car x is a Ferrari. R(x) or F(x): Car x is red or a Ferrari. R(x) F(x)

Which ones are R(x) F(x)

Disjunction (OR, ) As sets (instead of predicates): R: the set of red cars F: the set of Ferrari cars Union

What are R, F, R F

Using predicates: R(x) F(x) Using sets: R F

Be careful with English or Either we play the game my way, or I m taking my ball and going home. exclusive or, not or!

Summary Conjunction: AND,, Disjunction: OR,,

Quick test A logician s wife is having a baby. The doctor immediately hands the newborn to the dad. His wife asks impatiently: So, is it a boy or a girl? The logician replies: Yes. Source: 21 jokes for super smart people. http://www.buzzfeed.com/tabathaleggett/jokes-youll-only-get-if-youre-really-smart#1ml5j1x

Lecture 3.2 Negations Course Notes: Chapter 2

Negation (NOT, ) All red cars are Ferrari. negation Not all red cars are Ferrari. C: set of all cars

Negation (NOT, ) Not all red cars are Ferrari. equivalent There exists a car that is red and not Ferrari.

Exercise: Negate-it!

Exercise: Negate-it! Rule: the negation sign should apply to the smallest possible part of the expression. NO GOOD! GOOD!

Exercise: Negate-it! All cars are red. NEG Not all cars are red. There exists a car that is not red.

Exercise: Negate-it! There exists a car that is red. NEG There does not exists a car that is red. All cars are not red.

Exercise: Negate-it! Every red car is a Ferrari. NEG Not every red car is a Ferrari. There is a car that is red and not a Ferrari.

Exercise: Negate-it! There exists a car that is red and Ferrari. NEG There does not exists a car that is red and Ferrari. For all cars, if it is red, then it is not Ferrari.

Exercise: Negate-it! There exists a car that is red and Ferrari. NEG There does not exists a car that is red and Ferrari. For all cars, it is red, then it is not Ferrari. For all cars, it is Ferrari, then it is not red.

Some tips The negation of a universal quantification is an existential quantification ( not all... means there is one that is not... ). The negation of a existential quantification is an universal quantification ( there does not exist... means all...are not... ) Push the negation sign inside layer by layer (like peeling an onion).

Exercise: Negate-it! NEG

Scope

Parentheses are important! NO GOOD! GOOD! GOOD!

Scope inside parentheses is the same as Everything happens in parentheses stays in parentheses.

Summary Negations understand them in human language practice is the key! Parentheses use them properly to avoid ambiguity

Lecture 3.3 Truth tables, and some laws Course Notes: Chapter 2

About visualization... P Q Venn diagram works pretty well... for TWO predicates.

What if we have 3 predicates? P Q R

What if we have 4 predicates?

What if we have 5 predicates?

What if we have 20 predicates? There must be a better way!

It s called the truth table

Truth table with 2 predicates INPUTS OUTPUTS Enumerate the outputs over all possible combinations of input values of P and Q. How many rows are there? 2² = 4

Truth table with 3 predicates How many rows are there? 2³ = 8

Truth table with 20 predicates 2²⁰ rows It s not a mess, it just a larger table, which computers can process easily!

What can truth tables be used for?

for evaluating expressions

It s a boy and it s not a boy. It s a boy or it s not a boy. for determining satisfiability satisfiable unsatisfiable (contradiction) tautology (universal truth) P Q P Q P P P P T T T F T T F F F T F T F F T F F F F T

for proving equivalence P Q P Q P => Q T T T T T F F F F T T T F F T T

for proving equivalence P Q (P Q) P Q T T F F T F F F F T F F F F T T We just proved De Morgan s Law!

De Morgan s Law

Augustus De Morgan (1806-1871) De Morgan s Law Mathematical Induction

there are more laws...

Other laws Commutative laws

Other laws Associative laws

Other laws Distributive laws

Other laws Identity laws always true always false

Other laws Idempotent laws

Other laws For a full list of laws to be used in CSC165, read Chapter 2.17 of Course Notes.

About these laws... Similar to those for arithmetics. Only use when you are sure. Understand them, be able to verify them, rather than memorizing them. Practice is the key!

Summary for today Conjunctions Disjunctions Negations Truth tables Manipulation laws We are almost done with learning the language of math.

Next week finish learning the language start learning proofs