150 likes | 490 Views
2013 Fall. CSCI 3190 Tutorial 1 Propositional Calculus. Cai Wenzan Email: wzcai@cse.cuhk.edu.hk Office: Room 913 SHB Department of Computer Science & Engineering Sep. 9 2013. Propositions . A declarative sentence Fundamental Property - either true or false Logical operators
E N D
2013 Fall CSCI 3190 Tutorial 1Propositional Calculus CaiWenzan Email: wzcai@cse.cuhk.edu.hk Office: Room 913 SHB Department of Computer Science & Engineering Sep. 9 2013
Propositions • A declarative sentence • Fundamental Property - either true or false • Logical operators • Negation (not) • Conjunction (i.e., and) • Disjunction (i.e., or) • Exclusive-or • Implication • Bi-conditional implication
Exercises • Let p denotes the proposition “You do all the exercises”, q denotes the proposition “You attend all the tutorials”, r denotes the proposition “You get an A in this course”. Write down the following statements in symbolic form. 1. Either you do all the exercises or you attend all the tutorials, or both. 2. Either you do all the exercises or you attend all the tutorials, not both. 3. If you do all the exercises and attend all the tutorials, you will get an A in this course. 4. The only way to get an A in this course is to do all the exercises and attend all the tutorials.
Exercises • What’s the truth value of the following propositions when p = T, q = F and r = T ? 1. p qr 2. p q r 3. p (qr)
Basic Transformation Rules p T p ( p) p p F p p p T p F F p p F p T T p p p p p p
Basic Transformation Rules Commutative rules: Distributive rules: p q q p (pq) r (p r) (q r) p q q p (pq) r (p r) (q r) Associative rules: (pq) r p (q r) (pq) r p (q r)
Basic Transformation Rules De Morgan’s laws: Others: (p q) p q p q p q (p q) p q p q (p q) (q p) Absorption laws: p (p q) p p (p q) p
Exercises Prove the following statements: 1. (p r) (q r) (p q) r 2. (p q) (p q) p 3. (p q) ( p q) (p q) (p q)
Exercises Determine whether each of the following is a tautology, a contradiction or neither: 1. (p q) p q 2. (p (p q)) r 3. p (((p q) p) q)
Tips 1. Use truth table. 2. Use transformation rules: Apply implication equivalence, distributive, De Morgan, absorption rules. 3. Start from both sides. 4. Apply rules/laws and get a simplified form. It’s a tautology. 5. Be careful about the precedence.
Predicate • P(x): x is the president of U.S.A., where the domain of x is the set of all human beings. • We call P( ) a predicate and x a variable • The proposition is either true or false, but the propositional function P(x) has no true or false value until x is assigned P(Obama) is true P(Bush) is false
Quantifier • Universal quantifier means ‘for every’ e.g.: x RP(x): x - 1< x • Existential quantifier means ‘there exists’ e.g.: x RP(x): x+ 1< x • Transformations with Quantifiers xP(x) x P(x) xP(x) x P(x)
Nested Quantifier • Nested Quantifier: Two quantifiers are nested if one is within the scope of the other P(x, y): x is the grandson of y, wherethe domain of x and y is the set of all human beings. x yP(x, y) y xP(x, y)
Exercises 1.The statement x y(x = y3) is true or false? The domain of x and y is R. What about yx(x = y3)? 2.The statement x y(x < y2) is true or false? The domain of x and y is R. 3. Use the generalized De Morgan’s law for logic to write the negation of x y(xy < 1)