Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007 Suprakash Datta datta@cs.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cs.yorku.ca/course/1019 1/10/2006 1 Administrivia Textbook: Lectures: Tu-Th 10:00-11:30 am (CLH E) Exams: 2 tests (40%), final (40%) Homework (20%): equally divided between 3 or 4 assignments. Slides: should be available the previous evening Office hours: Tuesday 12-2 pm, Wed 1-2 pm or by appointment at CSEB 3043. 1/10/2006 Kenneth H. Rosen. Discrete Mathematics and Its Applications, Sixth Edition. McGraw Hill, 2007. 2 Administrivia – contd. • Cheating will not be tolerated. Visit the webpage for more details on policies. • TA: Tutorials/office hours TBA. • I will have some extra-credit quizzes. These will be announced beforehand. • HW submitted late will not be graded. 1/10/2006 3 Course objectives We will focus on two major goals: • Basic tools and techniques in discrete mathematics – – – – – – Propositional logic Set Theory Simple algorithms Induction, recursion Counting techniques (Combinatorics) Introductory graph theory • Precise and rigorous mathematical reasoning – Writing proofs 1/10/2006 4 To do well you should: • • • • • • • Study with pen and paper Ask for help immediately Practice, practice, practice… Follow along in class rather than take notes Ask questions in class Keep up with the class Read the book, not just the slides 1/10/2006 5 Today Ch. 1: Introduction to Propositional Logic • Truth values, truth tables • Boolean logic: • Implications: 1/10/2006 6 Why study propositional logic? • A formal mathematical “language” for precise reasoning. • Start with propositions. • Add other constructs like negation, conjunction, disjunction, implication etc. • All of these are based on ideas we use daily to reason about things. 1/10/2006 7 Propositions • Declarative sentence • Must be either True or False. Propositions: • York University is in Toronto • York University is in downtown Toronto • All students at York are Computer Sc. majors. Not propositions: • Do you like this class? • There are x students in this class. 1/10/2006 8 Propositions - 2 • • • • • Truth value: True or False Variables: p,q,r,s,… Negation: p (“not p”) Truth tables 1/10/2006 p p T F F T 9 Conjunction, Disjunction • Conjunction: p q [“and”] • Disjunction: p q [“or”] 1/10/2006 p q p q pq T T T T T F F T F T F T F F F F 10 Exclusive OR (XOR) • p q – T if p and q have different truth values, F otherwise • Colloquially, we often use OR ambiguously – “an entrée comes with soup or salad” implies XOR, but “students can take MATH XXXX if they gave taken MATH 2320 or MATH 1019” usually means the normal OR (so a student who has taken both is still eligible for MATH XXXX). 1/10/2006 11 Conditional • p q [“if p then q”] • p: hypothesis, q: conclusion • E.g.: “If you turn in a homework late, it will not be graded”; “If you get 100% in this course, you will get an A+”. • TRICKY: Is p q TRUE if p is FALSE? YES!! • Think of “If you get 100% in this course, you will get an A+” as a promise – is the promise violated if someone gets 50% and does not receive an A+? 1/10/2006 12 Conditional - 2 • p q [“if p then q”] • Truth table: p q p q pq T T T T T F F F F T T T F F T T Note the truth table of p q 1/10/2006 13 Logical Equivalence • p q and p q are logically equivalent • Truth tables are the simplest way to prove such facts. • We will learn other ways later. 1/10/2006 14 Contrapositive • Contrapositive of p q is q p • Any conditional and its contrapositive are logically equivalent (have the same truth table) – Check by writing down the truth table. • E.g. The contrapositive of “If you get 100% in this course, you will get an A+” is “If you do not get an A+ in this course, you did not get 100%”. 1/10/2006 15 Converse • Converse of p q is q p • Not logically equivalent to conditional • Ex 1: “If you get 100% in this course, you will get an A+” and “If you get an A+ in this course, you scored 100%” are not equivalent. • Ex 2: If you won the lottery, you are rich. 1/10/2006 16 Other conditionals Inverse: • inverse of p q is p q • How is this related to the converse? Biconditional: • “If and only if” • True if p,q have same truth values, flase otherwise. Q: How is this related to XOR? • Can also be defined as (p q) (q p) 1/10/2006 17 Readings and notes • Read pages 1-12. • Think about the notion of truth tables. • Master the rationale behind the definition of conditionals. • Practice translating English sentences to propositional logic statements. 1/10/2006 18