COEN231-lect1

download COEN231-lect1

of 78

  • date post

    10-Sep-2014
  • Category

    Documents

  • view

    104
  • download

    0

Embed Size (px)

Transcript of COEN231-lect1

COEN231: Discrete MathematicsProf. Chadi Assi assi@ciise.concordia.ca EV7.635 COEN231: General Information Course Description: Foundations Sets, Logic and Algorithms, Integers and Mathematical Induction, Relations and Posets, Matrices and Closures of Relations, Functions, Counting Principles, Recurrence Relations,Graph Theory, Trees and Networks Office hours: Thursdays from 11:00to 13:00 or by appointment Course page: ENCS Moodle COEN231: General Information Textbook : Kenneth H. Rosen Discrete Mathematics and Its Applications 7th (or 6th Edition), McGraw Hill publisher Tutorials: Three sections (Mina Yazdanpaneh mina_yaz@ece.concordia.ca) (verify rooms!) UA:Wednesday 16:15-17:05 H625 UB:Monday 16:15-17:05 H427 UC:Friday16:15-17:05 FG-B055 Assignments: 4-5 assignments in total; 50% penalty on late assignments; no assignments are accepted once solutions are posted. COEN231: General Information Two in-class midterms and one final (closed book and notes, no calculators) Final will cover material from the entire course Weight distribution Assignments: 20% Midterms (2): 30% Final: 50% There will be no makeup if you miss the midterms; the corresponding weight is added to that of the final The Foundations: Logic and Poofs Objectives Learn about statements (propositions) Learn how to use logical connectives to combine statements Explore how to draw conclusions using various argument forms Become familiar with quantifiers and predicates Learn various proof techniques Propositional Logic Definition: Mathematical logic provides methods for reasoning, rules and techniques to determine whether a statement or argument is valid Example of a statement: If x is an even integer, then x + 1 is an odd integer One needs to reason about this statement to determine whether it is true or false Such a statement is called Theorem (defined later) NOTE: the above statement is true under the condition that x is an integer is true Propositional Logic A proposition, or a statement, is a declarative sentence that is either true or false, but not both Examples: 2 is an even number (true) Toronto is not the capital of Canada (true) A is a consonant (false) The following are not propositions: What time is it? (not a declarative sentence) x+1 = 2 (neither true nor false) Propositional Logic Variables (usually lower case letters) are used to represent propositions. A statement has usually a truth value: T if it is a true proposition and F if it is false. Definition: Let p be a proposition. The negation of p isdenoted as p(or ~p) and is the statement: It is not the case that p or not p. The truth values of p and ~ p are opposite. Propositional Logic Find the negations of: Today is Friday At least 10 inches of rain fell today in Miami Truth Table: Propositional Logic Definition Let p and q be statements. The conjunction of p and q, written p q , is the statement formed by joining statements p and q using the word and. The statement p q is true if both p and q are true; otherwise p q is false. Truth Table Propositional Logic Definition Let p and q be statements. The disjunction of p and q, written pV q , is the statement formed by joining statements p and q using the word or. The statement p V q is false when both p and q are false; otherwise it is true. Truth Table Propositional Logic Example 1 p is the statement Today is Friday q is the statement It is raining today, then the conjunction of p and q is: Today is Friday and it is raining today Statement is true only on rainy Fridays. Example 2 The disjunction of p and q is: Today is Friday or it is raining today This statement is true on any day that is either Friday or a rainy day (including rainy Fridays); it is false when it is not Friday and it does not rain. Propositional Logic Definition Let p and q be statements. The exclusive or of p and q, written p q , is the statement that is true when exactly one of p and q is true and false otherwise. Propositional Logic Definition Let p and q be statements. The statement if p then q is called an implication or a conditional statement and is denoted as p q. It is false when (p is true and q is false) and true otherwise. p q is read: If p, then q p is sufficient for q q if p q whenever p p implies q p only if q p is called the hypothesis, q is called the conclusion Propositional Logic Example: Let p: Today is Sunday and q: I will wash the car. The implication p q is the statement: p q : If today is Sunday, then I will wash the car The converse of this implication is written q p If I wash the car, then today is Sunday The inverse of this implication is p q If today is not Sunday, then I will not wash the car The contrapositive of this implication is q p If I do not wash the car, then today is not Sunday Propositional Logic Definition Let p and q be statements. The statement p if and only if q is called the bi-implication or biconditional statement of p and q The biconditional p if and only if q is written p q p q is read: p is necessary and sufficient for q q iff p q when and only when p Propositional Logic Definition p q has the same truth table as: (p q) (q p) Example: p: You can take the flight, q: You buy a ticket p q is: You an take the flight iff you buy a ticket. Propositional Logic Definitions Symbols p ,q ,r ,...,called statement variables Symbols , , v, ,and are called logical connectives Propositional Logic Compound Propositions (or statement formula) Truth table of the compound proposition(p v q) (p q) Propositional Logic Precedence of logical connectives is: highest second highest v third highest fourth highest fifth highest Examples p v qis ( p) v q and NOT (p v q) p q v r is (p q ) v r and not (p (q v r) Propositional Logic Translating English sentences into expressions: Example: You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16 years old Define the following statements: p: You can ride the roller coaster q: You are under 4 feet tall r: You are older than 16 years old Then the sentence can be written as If you are NOT under 4 feet tall AND you are older than 16 years old, then you can ride the roller coaster or q r p Propositional Logic Translating English sentences into expressions: Example: You can access the Internet from campus only if you are a computer science major or you are not freshman Define the following statements: p: You are a computer science major q: You are a freshman r: You can access the Internet from campus Then the sentence can be written as If you can access the Internet from campus, then you are a computer science major or you are not a freshman p V q r Propositional Equivalence Definition: A compound proposition is said to be a tautology if its truth value is always T for any assignment of the truth values to the statement variables occurring in it Example: (p q ) ((q p )) Propositional Equivalence Definition: A compound proposition is said to be a contradiction if its truth value is F for any assignment of the truth values to the statement variables occurring in it Example: p and not p Propositional Equivalence Definition: Logical Equivalence Two compound propositions p and q are said to be logically equivalent if the statement formula p q is a tautology. The notation p q (or p q) is used to denote logical equivalence. Example: Show that (p v q ) and p qare logically equivalent: To show whether two compound propositions are logically equivalent, we may use the truth table. Propositional Equivalence Definition: Logical Equivalence Example: Show that (p v q ) and p qare logically equivalent: To show whether two compound propositions are logically equivalent, we may use the truth table. Logical Equivalences Table 1 Table 2 Table 3 Propositional Equivalence Example: Show that (p q ) and p qare logically equivalent We can use the truth table to show this. We can also use the rules listed before. p q p v q(from Table 2), therefore (p q) ( p v q ) ( p) q(De Morgans law) p q(Double negation law) Propositional Equivalence Example: Show that (p v ( p q )) and p q are logically equivalent. (p v ( p q )) p ( p q ))(De Morgan law) p [( p) v (q )] (De Morgan law) p (p v q ) (Double negation) ( p p ) v ( p q ) (Distributive law) F v ( p q ) ( p q ) v F (commutative law) p q (identity law for F) Predicates and Quantifiers Predicates and Quantifiers Predicate logic: is a powerful type of logic which may be used to express the meaning of a wide range of statements. Consider the statements: x is greater than 3 Computer x is working properly The truth of such statements depend on the value assigned tothe variable x The statement x is greater than 3 has two parts: the variable x which is the subject of the statement and the predicate which refers to a property the subject can have. Predicates and Quantifiers x is greater than 3 may be denoted by P(x) where P denotes the predicate and x is the variable. P(x) is the value of the propositional function P at x. Upon assigning a value to x, P(x) becomes a proposition with a T or F value. P(4) is True and P(2) is False. Statements may also involve more than one variable. Statement x = y + 3 may be denoted by Q(x, y) where x and y are the variables and Q is the predicate. Q(3, 0) is T and Q(0, 2) is false. Predicates and Quantifiers A statement involving n variables x1, x2, xn is denoted by P(x1, x2, xn) where P is called n-ary predicate Predicates and Quantifiers Some mathematical statements assert that a property is true or false for all values of a variable in a particular domain, called domain or universe of discourse Such Statements are expressed using universal quantifications. Definitions: The universal quantification of P(x) is the statement: P(x) for all values of x in the domain The notation