Florida State University Course Notes MAD 2104 Discrete Mathematics I Florida State University

Total Page:16

File Type:pdf, Size:1020Kb

Florida State University Course Notes MAD 2104 Discrete Mathematics I Florida State University Florida State University Course Notes MAD 2104 Discrete Mathematics I Florida State University Tallahassee, Florida 32306-4510 Copyright c 2004 Florida State University Written by Dr. John Bryant and Dr. Penelope Kirby All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means without permission from the authors or a license from Florida State University. Contents Chapter 1. Introduction to Sets and Functions 9 1. Introduction to Sets 9 1.1. Basic Terminology 9 1.2. Notation for Describing a Set 9 1.3. Common Universal Sets 10 1.4. Complements and Subsets 10 1.5. Element v.s. Subsets 11 1.6. Cardinality 12 1.7. Set Operations 12 1.8. Example 1.8.1 13 1.9. Product 13 2. Introduction to Functions 15 2.1. Function 15 2.2. Terminology Related to Functions 16 2.3. Example 2.3.1 16 2.4. Floor and Ceiling Functions 17 2.5. Characteristic Function 18 Chapter 2. Logic 20 1. Logic Definitions 20 1.1. Propositions 20 1.2. Examples 20 1.3. Logical Operators 21 1.4. Negation 22 1.5. Conjunction 23 1.6. Disjunction 23 1.7. Exclusive Or 24 1.8. Implications 24 1.9. Terminology 25 1.10. Example 26 1.11. Biconditional 26 1.12. NAND and NOR Operators 27 1.13. Example 28 1.14. Bit Strings 30 2. Propositional Equivalences 31 2.1. Tautology/Contradiction/Contingency 31 3 CONTENTS 4 2.2. Logically Equivalent 32 2.3. Examples 33 2.4. Important Logical Equivalences 35 2.5. Simplifying Propositions 36 2.6. Implication 38 2.7. Normal or Canonical Forms 38 2.8. Examples 38 2.9. Constructing Disjunctive Normal Forms 39 2.10. Conjunctive Normal Form 40 3. Predicates and Quantifiers 42 3.1. Predicates and Quantifiers 42 3.2. Example of a Propositional Function 42 3.3. Quantifiers 43 3.4. Example 3.4.1 44 3.5. Converting from English 44 3.6. Additional Definitions 45 3.7. Examples 45 3.8. Multiple Quantifiers 45 3.9. Ordering Quantifiers 46 3.10. Unique Existential 47 3.11. De Morgan’s Laws for Quantifiers 48 3.12. Distributing Quantifiers over Operators 50 Chapter 3. Methods of Proofs 51 1. Logical Arguments and Formal Proofs 51 1.1. Basic Terminology 51 1.2. More Terminology 51 1.3. Formal Proofs 53 1.4. Rules of Inference 54 1.5. Example 1.5.1 55 1.6. Rules of Inference for Quantifiers 57 1.7. Example 1.7.1 58 1.8. Fallacies 59 2. Methods of Proof 63 2.1. Types of Proofs 63 2.2. Trivial Proof/Vacuous Proof 63 2.3. Direct Proof 64 2.4. Proof by Contrapositive 66 2.5. Proof by Contradiction 67 2.6. Proof by Cases 69 2.7. Existence Proofs 71 2.8. Constructive Proof 71 2.9. Nonconstructive Proof 72 2.10. Nonexistence Proofs 73 CONTENTS 5 2.11. The Halting Problem 74 2.12. Counterexample 74 2.13. Biconditional 75 3. Mathematical Induction 76 3.1. First Principle of Mathematical Induction 76 3.2. Using Mathematical Induction 77 3.3. Example 3.3.1 78 3.4. Example 3.4.1 81 3.5. Example 3.5.1 83 3.6. The Second Principle of Mathematical Induction 85 3.7. Well-Ordered Sets 87 Chapter 4. Applications of Methods of Proof 89 1. Set Operations 89 1.1. Set Operations 89 1.2. Equality and Containment 89 1.3. Union and Intersection 90 1.4. Complement 90 1.5. Difference 90 1.6. Product 91 1.7. Power Set 91 1.8. Examples 91 1.9. Venn Diagrams 92 1.10. Examples 93 1.11. Set Identities 94 1.12. Union and Intersection of Indexed Collections 98 1.13. Infinite Unions and Intersections 99 1.14. Example 1.14.1 100 1.15. Computer Representation of a Set 101 2. Properties of Functions 104 2.1. Injections, Surjections, and Bijections 104 2.2. Examples 104 2.3. Example 2.3.1 106 2.4. Example 2.4.1 107 2.5. Example 2.5.1 107 2.6. Example 2.6.1 108 2.7. Inverse Functions 108 2.8. Inverse Image 110 2.9. Composition 111 2.10. Example 2.10.1 112 3. Recurrence 113 3.1. Recursive Definitions 113 3.2. Recursive definition of the function f(n) = n! 114 3.3. Recursive definition of the natural numbers 114 CONTENTS 6 3.4. Proving assertions about recursively defined objects 115 3.5. Definition of f n 118 3.6. Example 3.6.1 119 3.7. Fibonacci Sequence 120 3.8. Strings 123 3.9. Bit Strings 124 4. Growth of Functions 128 4.1. Growth of Functions 128 4.2. The Big-O Notation 128 4.3. Proofs of Theorems 4.2.1 and 4.2.2 130 4.4. Example 4.4.1 131 4.5. Calculus Definition 132 4.6. Basic Properties of Big-O 134 4.7. Proof of Theorem 4.6.3 135 4.8. Example 4.8.1 135 4.9. Big-Omega 136 4.10. Big-Theta 136 4.11. Summary 137 4.12. Appendix. Proof of the Triangle Inequality 138 Chapter 5. Number Theory 139 1. Integers and Division 139 1.1. Divisibility 139 1.2. Basic Properties of Divisibility 139 1.3. Theorem 1.3.1 - The Division Algorithm 140 1.4. Proof of Division Algorithm 140 1.5. Prime Numbers, Composites 141 1.6. Fundamental Theorem of Arithmetic 142 1.7. Factoring 142 1.8. Mersenne Primes 143 1.9. Greatest Common Divisor and Least Common Multiple 143 1.10. Modular Arithmetic 144 1.11. Applications of Modular Arithmetic 146 2. Integers and Algorithms 148 2.1. Euclidean Algorithm 148 2.2. GCD’s and Linear Combinations 149 2.3. Uniqueness of Prime Factorization 152 3. Applications of Number Theory 156 3.1. Representation of Integers 156 3.2. Constructing Base b Expansion of n 156 3.3. Cancellation in Congruences 157 3.4. Inverses mod m 158 3.5. Linear Congruence 159 3.6. Criterion for Invertibility mod m 159 CONTENTS 7 3.7. Example 3.7.1 160 3.8. Fermat’s Little Theorem 160 3.9. RSA System 162 4. Matrices 163 4.1. Definitions 163 4.2. Matrix Arithmetic 164 4.3. Example 4.3.1 164 4.4. Special Matrices 166 4.5. Boolean Arithmetic 168 4.6. Example 4.6.1 169 Chapter 6. Introduction to Graph Theory 171 1. Introduction to Graphs 171 1.1. Simple Graphs 171 1.2. Examples 171 1.3. Multigraphs 172 1.4. Pseudograph 173 1.5. Directed Graph 174 1.6. Directed Multigraph 175 1.7. Graph Isomorphism 176 2. Graph Terminology 179 2.1. Undirected Graphs 179 2.2. The Handshaking Theorem 180 2.3. Example 2.3.1 180 2.4. Directed Graphs 181 2.5. The Handshaking Theorem for Directed Graphs 182 2.6. Underlying Undirected Graph 182 2.7. New Graphs from Old 182 2.8. Complete Graphs 183 2.9. Cycles 184 2.10. Wheels 184 2.11. n-Cubes 185 2.12. Bipartite Graphs 186 2.13. Examples 186 3. Representing Graphs and Graph Isomorphism 188 3.1. Adjacency Matrix 188 3.2. Example 3.2.1 188 3.3. Incidence Matrices 190 3.4. Degree Sequence 191 3.5. Graph Invariants 191 3.6. Example 3.6.1 192 3.7. Example 193 3.8. Proof of Theorem 3.5.1 Part 3 for finite simple graphs 196 Chapter 7. Introduction to Relations 197 CONTENTS 8 1. Relations and Their Properties 197 1.1. Definition of a Relation 197 1.2. Examples 198 1.3. Directed Graphs 199 1.4. Inverse Relation 200 1.5. Special Properties of Binary Relations 201 1.6. Examples of Relations and their Properties 201 1.7. Proving or disproving relations have a property 202 1.8. Combining Relations 204 1.9. Example of Combining Relations 205 1.10. Composition 205 1.11. Example of Composition 206 1.12. Characterization of Transitive Relations 208 CHAPTER 1 Introduction to Sets and Functions 1. Introduction to Sets 1.1. Basic Terminology. We begin with a refresher in the basics of set theory. Our treatment will be an informal one rather than taking an axiomatic approach at this time. Later in the semester we will revisit sets with a more formal approach. A set is a collection or group of objects or elements or members. (Cantor 1895) • A set is said to contain its elements. • In each situation or context, there must be an underlying universal set U, either specifically stated or understood. Notation: • If x is a member or element of the set S, we write x ∈ S. • If x is not an element of S we write x 6∈ S. 1.2. Notation for Describing a Set. Example 1.2.1. List the elements between braces: • S = {a, b, c, d} = {b, c, a, d, d} Specify by attributes: • S = {x|x ≥ 5 or x < 0}, where the universe is the set of real numbers. Use brace notation with ellipses: • S = {..., −3, −2, −1}, the set of negative integers. Discussion 9 1. INTRODUCTION TO SETS 10 Sets can be written in a variety of ways. One can, of course, simply list the elements if there are only a few. Another way is to use set builder notation, which specifies the sets using a predicate to indicate the attributes of the elements of the set.
Recommended publications
  • Lecture 1: Informal Logic
    Lecture 1: Informal Logic 1 Sentential/Propositional Logic Definition 1.1 (Statement). A statement is anything we can say, write, or otherwise express that can be either true or false. Remark 1. Veracity of a statement doesn't depend on one's ability to verify it's truth or falsity. Example 1.2. The expression \Venkatesh is twenty years old" is a statement, because it is either true or false. We will be making following two assumptions when dealing with statements. Assumptions 1.3 (Bivalence). Every statement is either true or false. Assumptions 1.4. No statement is both true and false. One of the consequences of the bivalence assumption is that if a statement is not true, then it must be false. Hence, to prove that something is true, it would suffice to prove that it is not false. 1.1 Combination of Statements In this subsection, we would look at five basic ways of combining two statements P and Q to form new statements. We can form more complicated compound statements by using combinations of these basic operations. Definition 1.5 (Conjunction). We define conjunction of statements P and Q to be the statement that is true if both P and Q are true, and is false otherwise. Conjunction of of P and Q is denoted P ^ Q, and read \P and Q." Remark 2. Logical and is different from it's colloquial usages for therefore or for relations. 1 Definition 1.6 (Disjunction). We define disjunction of statements P and Q to be the statement that is true if either P is true or Q is true or both are true, and is false otherwise.
    [Show full text]
  • Chapter 5: Methods of Proof for Boolean Logic
    Chapter 5: Methods of Proof for Boolean Logic § 5.1 Valid inference steps Conjunction elimination Sometimes called simplification. From a conjunction, infer any of the conjuncts. • From P ∧ Q, infer P (or infer Q). Conjunction introduction Sometimes called conjunction. From a pair of sentences, infer their conjunction. • From P and Q, infer P ∧ Q. § 5.2 Proof by cases This is another valid inference step (it will form the rule of disjunction elimination in our formal deductive system and in Fitch), but it is also a powerful proof strategy. In a proof by cases, one begins with a disjunction (as a premise, or as an intermediate conclusion already proved). One then shows that a certain consequence may be deduced from each of the disjuncts taken separately. One concludes that that same sentence is a consequence of the entire disjunction. • From P ∨ Q, and from the fact that S follows from P and S also follows from Q, infer S. The general proof strategy looks like this: if you have a disjunction, then you know that at least one of the disjuncts is true—you just don’t know which one. So you consider the individual “cases” (i.e., disjuncts), one at a time. You assume the first disjunct, and then derive your conclusion from it. You repeat this process for each disjunct. So it doesn’t matter which disjunct is true—you get the same conclusion in any case. Hence you may infer that it follows from the entire disjunction. In practice, this method of proof requires the use of “subproofs”—we will take these up in the next chapter when we look at formal proofs.
    [Show full text]
  • Section 1.4: Predicate Logic
    Section 1.4: Predicate Logic January 22, 2021 Abstract We now consider the logic associated with predicate wffs, including a new set of derivation rules for demonstrating validity (the analogue of tautology in the propositional calculus) – that is, for proving theorems! 1 Derivation rules • First of all, all the rules of propositional logic still hold. Whew! Propositional wffs are simply boring, variable-less predicate wffs. • Our author suggests the following “general plan of attack”: – strip off the quantifiers – work with the separate wffs – insert quantifiers as necessary Now, how may we legitimately do so? Consider the classic syllo- gism: a. (All) Humans are mortal. b. Socrates is human. Therefore Socrates is mortal. The way we reason is that the rule “Humans are mortal” applies to the specific example “Socrates”; hence this Socrates is mortal. We might write this as a. (∀x)(H(x) → M(x)) b. H(s) Therefore M(s). It seems so obvious! But how do we justify that in a proof se- quence? • New rules for predicate logic: in the following, you should un- derstand by the symbol x in P (x) an expression with free variable x, possibly containing other (quantified) variables: e.g. P (x) ≡ (∀y)(∃z)Q(x,y,z) (1) – Universal Instantiation: from (∀x)P (x) deduce P (t). Caveat: t must not already appear as a variable in the ex- pression for P (x): in the equation above, (1), it would not do to deduce P (y) or P (z), as those variables appear in the expression (in a quantified fashion) already.
    [Show full text]
  • 7.1 Rules of Implication I
    Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic. The method consists of using sets of Rules of Inference (valid argument forms) to derive either a conclusion or a series of intermediate conclusions that link the premises of an argument with the stated conclusion. The First Four Rules of Inference: ◦ Modus Ponens (MP): p q p q ◦ Modus Tollens (MT): p q ~q ~p ◦ Pure Hypothetical Syllogism (HS): p q q r p r ◦ Disjunctive Syllogism (DS): p v q ~p q Common strategies for constructing a proof involving the first four rules: ◦ Always begin by attempting to find the conclusion in the premises. If the conclusion is not present in its entirely in the premises, look at the main operator of the conclusion. This will provide a clue as to how the conclusion should be derived. ◦ If the conclusion contains a letter that appears in the consequent of a conditional statement in the premises, consider obtaining that letter via modus ponens. ◦ If the conclusion contains a negated letter and that letter appears in the antecedent of a conditional statement in the premises, consider obtaining the negated letter via modus tollens. ◦ If the conclusion is a conditional statement, consider obtaining it via pure hypothetical syllogism. ◦ If the conclusion contains a letter that appears in a disjunctive statement in the premises, consider obtaining that letter via disjunctive syllogism. Four Additional Rules of Inference: ◦ Constructive Dilemma (CD): (p q) • (r s) p v r q v s ◦ Simplification (Simp): p • q p ◦ Conjunction (Conj): p q p • q ◦ Addition (Add): p p v q Common Misapplications Common strategies involving the additional rules of inference: ◦ If the conclusion contains a letter that appears in a conjunctive statement in the premises, consider obtaining that letter via simplification.
    [Show full text]
  • 1 Lecture 13: Quantifier Laws1 1. Laws of Quantifier Negation There
    Ling 409 lecture notes, Lecture 13 Ling 409 lecture notes, Lecture 13 October 19, 2005 October 19, 2005 Lecture 13: Quantifier Laws1 true or there is at least one individual that makes φ(x) true (or both). Those are also equivalent statements. 1. Laws of Quantifier Negation Laws 2 and 3 suggest a fundamental connection between universal quantification and There are a number of equivalences based on the set-theoretic semantics of predicate logic. conjunction and existential quantification and disjunction: Take for instance a statement of the form (∃x)~ φ(x)2. It asserts that there is at least one individual d which makes ~φ(x) true. That means that d makes ϕ(x) false. That, in turn, (∀x) ψ(x) is true iff ψ(a) and ψ(b) and ψ(c) … (where a, b, c … are the names of the means that (∀x) φ(x) is false, which means that ~(∀x) φ(x) is true. The same reasoning individuals in the domain.) can be applied in the reverse direction and the result is the first quantifier law: ∃ ψ ψ ψ ψ ( x) (x) is true iff (a) or (b) or c) … (where a, b, c … are the names of the (1) Laws of Quantifier Negation individuals in the domain.) Law 1: ~(∀x) φ(x) ⇐⇒ (∃x)~ φ(x) From that point of view, Law 1 resembles a generalized DeMorgan’s Law: (Possible English correspondents: Not everyone passed the test and Someone did not pass (4) ~(ϕ(a) & ϕ(b) & ϕ(c) … ) ⇐⇒ ~ϕ(a) v ~ϕ(b) v ϕ(c) … the test.) (5) Law 4: (∀x) ψ(x) v (∀x)φ(x) ⇒ (∀x)( ψ(x) v φ(x)) ϕ ⇐ ϕ Because of the Law of Double Negation (~~ (x) ⇒ (x)), Law 1 could also be written (6) Law 5: (∃x)( ψ(x) & φ(x)) ⇒ (∃x) ψ(x) & (∃x)φ(x) as follows: These two laws are one-way entailments, NOT equivalences.
    [Show full text]
  • Notes on Proof Theory
    Notes on Proof Theory Master 1 “Informatique”, Univ. Paris 13 Master 2 “Logique Mathématique et Fondements de l’Informatique”, Univ. Paris 7 Damiano Mazza November 2016 1Last edit: March 29, 2021 Contents 1 Propositional Classical Logic 5 1.1 Formulas and truth semantics . 5 1.2 Atomic negation . 8 2 Sequent Calculus 10 2.1 Two-sided formulation . 10 2.2 One-sided formulation . 13 3 First-order Quantification 16 3.1 Formulas and truth semantics . 16 3.2 Sequent calculus . 19 3.3 Ultrafilters . 21 4 Completeness 24 4.1 Exhaustive search . 25 4.2 The completeness proof . 30 5 Undecidability and Incompleteness 33 5.1 Informal computability . 33 5.2 Incompleteness: a road map . 35 5.3 Logical theories . 38 5.4 Arithmetical theories . 40 5.5 The incompleteness theorems . 44 6 Cut Elimination 47 7 Intuitionistic Logic 53 7.1 Sequent calculus . 55 7.2 The relationship between intuitionistic and classical logic . 60 7.3 Minimal logic . 65 8 Natural Deduction 67 8.1 Sequent presentation . 68 8.2 Natural deduction and sequent calculus . 70 8.3 Proof tree presentation . 73 8.3.1 Minimal natural deduction . 73 8.3.2 Intuitionistic natural deduction . 75 1 8.3.3 Classical natural deduction . 75 8.4 Normalization (cut-elimination in natural deduction) . 76 9 The Curry-Howard Correspondence 80 9.1 The simply typed l-calculus . 80 9.2 Product and sum types . 81 10 System F 83 10.1 Intuitionistic second-order propositional logic . 83 10.2 Polymorphic types . 84 10.3 Programming in system F ...................... 85 10.3.1 Free structures .
    [Show full text]
  • Relevant and Substructural Logics
    Relevant and Substructural Logics GREG RESTALL∗ PHILOSOPHY DEPARTMENT, MACQUARIE UNIVERSITY [email protected] June 23, 2001 http://www.phil.mq.edu.au/staff/grestall/ Abstract: This is a history of relevant and substructural logics, written for the Hand- book of the History and Philosophy of Logic, edited by Dov Gabbay and John Woods.1 1 Introduction Logics tend to be viewed of in one of two ways — with an eye to proofs, or with an eye to models.2 Relevant and substructural logics are no different: you can focus on notions of proof, inference rules and structural features of deduction in these logics, or you can focus on interpretations of the language in other structures. This essay is structured around the bifurcation between proofs and mod- els: The first section discusses Proof Theory of relevant and substructural log- ics, and the second covers the Model Theory of these logics. This order is a natural one for a history of relevant and substructural logics, because much of the initial work — especially in the Anderson–Belnap tradition of relevant logics — started by developing proof theory. The model theory of relevant logic came some time later. As we will see, Dunn's algebraic models [76, 77] Urquhart's operational semantics [267, 268] and Routley and Meyer's rela- tional semantics [239, 240, 241] arrived decades after the initial burst of ac- tivity from Alan Anderson and Nuel Belnap. The same goes for work on the Lambek calculus: although inspired by a very particular application in lin- guistic typing, it was developed first proof-theoretically, and only later did model theory come to the fore.
    [Show full text]
  • Qvp) P :: ~~Pp :: (Pvp) ~(P → Q
    TEN BASIC RULES OF INFERENCE Negation Introduction (~I – indirect proof IP) Disjunction Introduction (vI – addition ADD) Assume p p Get q & ~q ˫ p v q ˫ ~p Disjunction Elimination (vE – version of CD) Negation Elimination (~E – version of DN) p v q ~~p → p p → r Conditional Introduction (→I – conditional proof CP) q → r Assume p ˫ r Get q Biconditional Introduction (↔I – version of ME) ˫ p → q p → q Conditional Elimination (→E – modus ponens MP) q → p p → q ˫ p ↔ q p Biconditional Elimination (↔E – version of ME) ˫ q p ↔ q Conjunction Introduction (&I – conjunction CONJ) ˫ p → q p or q ˫ q → p ˫ p & q Conjunction Elimination (&E – simplification SIMP) p & q ˫ p IMPORTANT DERIVED RULES OF INFERENCE Modus Tollens (MT) Constructive Dilemma (CD) p → q p v q ~q p → r ˫ ~P q → s Hypothetical Syllogism (HS) ˫ r v s p → q Repeat (RE) q → r p ˫ p → r ˫ p Disjunctive Syllogism (DS) Contradiction (CON) p v q p ~p ~p ˫ q ˫ Any wff Absorption (ABS) Theorem Introduction (TI) p → q Introduce any tautology, e.g., ~(P & ~P) ˫ p → (p & q) EQUIVALENCES De Morgan’s Law (DM) (p → q) :: (~q→~p) ~(p & q) :: (~p v ~q) Material implication (MI) ~(p v q) :: (~p & ~q) (p → q) :: (~p v q) Commutation (COM) Material Equivalence (ME) (p v q) :: (q v p) (p ↔ q) :: [(p & q ) v (~p & ~q)] (p & q) :: (q & p) (p ↔ q) :: [(p → q ) & (q → p)] Association (ASSOC) Exportation (EXP) [p v (q v r)] :: [(p v q) v r] [(p & q) → r] :: [p → (q → r)] [p & (q & r)] :: [(p & q) & r] Tautology (TAUT) Distribution (DIST) p :: (p & p) [p & (q v r)] :: [(p & q) v (p & r)] p :: (p v p) [p v (q & r)] :: [(p v q) & (p v r)] Conditional-Biconditional Refutation Tree Rules Double Negation (DN) ~(p → q) :: (p & ~q) p :: ~~p ~(p ↔ q) :: [(p & ~q) v (~p & q)] Transposition (TRANS) CATEGORICAL SYLLOGISM RULES (e.g., Ǝx(Fx) / ˫ Fy).
    [Show full text]
  • Lexical Scoping As Universal Quantification
    University of Pennsylvania ScholarlyCommons Technical Reports (CIS) Department of Computer & Information Science March 1989 Lexical Scoping as Universal Quantification Dale Miller University of Pennsylvania Follow this and additional works at: https://repository.upenn.edu/cis_reports Recommended Citation Dale Miller, "Lexical Scoping as Universal Quantification", . March 1989. University of Pennsylvania Department of Computer and Information Science Technical Report No. MS-CIS-89-23. This paper is posted at ScholarlyCommons. https://repository.upenn.edu/cis_reports/785 For more information, please contact [email protected]. Lexical Scoping as Universal Quantification Abstract A universally quantified goal can be interpreted intensionally, that is, the goal ∀x.G(x) succeeds if for some new constant c, the goal G(c) succeeds. The constant c is, in a sense, given a scope: it is introduced to solve this goal and is "discharged" after the goal succeeds or fails. This interpretation is similar to the interpretation of implicational goals: the goal D ⊃ G should succeed if when D is assumed, the goal G succeeds. The assumption D is discharged after G succeeds or fails. An interpreter for a logic programming language containing both universal quantifiers and implications in goals and the body of clauses is described. In its non-deterministic form, this interpreter is sound and complete for intuitionistic logic. Universal quantification can provide lexical scoping of individual, function, and predicate constants. Several examples are presented to show how such scoping can be used to provide a Prolog-like language with facilities for local definition of programs, local declarations in modules, abstract data types, and encapsulation of state.
    [Show full text]
  • Sets, Propositional Logic, Predicates, and Quantifiers
    COMP 182 Algorithmic Thinking Sets, Propositional Logic, Luay Nakhleh Computer Science Predicates, and Quantifiers Rice University !1 Reading Material ❖ Chapter 1, Sections 1, 4, 5 ❖ Chapter 2, Sections 1, 2 !2 ❖ Mathematics is about statements that are either true or false. ❖ Such statements are called propositions. ❖ We use logic to describe them, and proof techniques to prove whether they are true or false. !3 Propositions ❖ 5>7 ❖ The square root of 2 is irrational. ❖ A graph is bipartite if and only if it doesn’t have a cycle of odd length. ❖ For n>1, the sum of the numbers 1,2,3,…,n is n2. !4 Propositions? ❖ E=mc2 ❖ The sun rises from the East every day. ❖ All species on Earth evolved from a common ancestor. ❖ God does not exist. ❖ Everyone eventually dies. !5 ❖ And some of you might already be wondering: “If I wanted to study mathematics, I would have majored in Math. I came here to study computer science.” !6 ❖ Computer Science is mathematics, but we almost exclusively focus on aspects of mathematics that relate to computation (that can be implemented in software and/or hardware). !7 ❖Logic is the language of computer science and, mathematics is the computer scientist’s most essential toolbox. !8 Examples of “CS-relevant” Math ❖ Algorithm A correctly solves problem P. ❖ Algorithm A has a worst-case running time of O(n3). ❖ Problem P has no solution. ❖ Using comparison between two elements as the basic operation, we cannot sort a list of n elements in less than O(n log n) time. ❖ Problem A is NP-Complete.
    [Show full text]
  • Logic and Proof
    CS2209A 2017 Applied Logic for Computer Science Lecture 11, 12 Logic and Proof Instructor: Yu Zhen Xie 1 Proofs • What is a theorem? – Lemma, claim, etc • What is a proof? – Where do we start? – Where do we stop? – What steps do we take? – How much detail is needed? 2 The truth 3 Theories and theorems • Theory: axioms + everything derived from them using rules of inference – Euclidean geometry, set theory, theory of reals, theory of integers, Boolean algebra… – In verification: theory of arrays. • Theorem: a true statement in a theory – Proved from axioms (usually, from already proven theorems) Pythagorean theorem • A statement can be a theorem in one theory and false in another! – Between any two numbers there is another number. • A theorem for real numbers. False for integers! 4 Axioms example: Euclid’s postulates I. Through 2 points a line segment can be drawn II. A line segment can be extended to a straight line indefinitely III. Given a line segment, a circle can be drawn with it as a radius and one endpoint as a centre IV. All right angles are congruent V. Parallel postulate 5 Some axioms for propositional logic • For any formulas A, B, C: – A ∨ ¬ – . – . – A • Also, like in arithmetic (with as +, as *) – , – Same holds for ∧. – Also, • And unlike arithmetic – ( ) 6 Counterexamples • To disprove a statement, enough to give a counterexample: a scenario where it is false – To disprove that • Take = ", = #, • Then is false, but B is true. – To disprove that if %& '( ) &, ( , then '( %& ) &, ( , • Set the domain of x and y to be {0,1} • Set P(0,0) and P(1,1) to true, and P(0,1), P(1,0) to false.
    [Show full text]
  • Propositional Logic
    Chapter 3 Propositional Logic 3.1 ARGUMENT FORMS This chapter begins our treatment of formal logic. Formal logic is the study of argument forms, abstract patterns of reasoning shared by many different arguments. The study of argument forms facilitates broad and illuminating generalizations about validity and related topics. We shall initially focus on the notion of deductive validity, leaving inductive arguments to a later treatment (Chapters 8 to 10). Specifically, our concern in this chapter will be with the idea that a valid deductive argument is one whose conclusion cannot be false while the premises are all true (see Section 2.3). By studying argument forms, we shall be able to give this idea a very precise and rigorous characterization. We begin with three arguments which all have the same form: (1) Today is either Monday or Tuesday. Today is not Monday. Today is Tuesday. (2) Either Rembrandt painted the Mona Lisa or Michelangelo did. Rembrandt didn't do it. :. Michelangelo did. (3) Either he's at least 18 or he's a juvenile. He's not at least 18. :. He's a juvenile. It is easy to see that these three arguments are all deductively valid. Their common form is known by logicians as disjunctive syllogism, and can be represented as follows: Either P or Q. It is not the case that P :. Q. The letters 'P' and 'Q' function here as placeholders for declarative' sentences. We shall call such letters sentence letters. Each argument which has this form is obtainable from the form by replacing the sentence letters with sentences, each occurrence of the same letter being replaced by the same sentence.
    [Show full text]