THE LOGIC OF COMPOUND STATEMENTS
All dogs have four legs. All tables have four legs. Therefore, all dogs are tables
LOGIC Logic is a science of the necessary laws of thought, without which no employment of the understanding and the reason takes place. Immanuel Kant, 1785
Aristotle Greek philosopher who wrote the first great treatises on logic. Those he wrote were a collection of rules for deductive reasoning that were intended to serve as a basis for the study of every branch of knowledge.
Gottfried Leibniz German philosopher and mathematician Conceived the idea of using symbols to mechanize the process of deductive reasoning during 17th century
Symbolic Logic Founded by the English mathematicians George Boole and Augustus De Morgan after Leibniz s idea was realized in the nineteenth century
Symbolic Logic With research continuing to the present day, symbolic logic has provided, among other things, the theoretical basis for many areas of computer science such as digital logic circuit design, relational database theory, automata theory and computability and artificial intelligence
Argument An argument is a sequence of statements aimed at demonstrating the truth of an assertion. The assertion at the end of the sequence is called the conclusion, and the preceding statements are called premises.
Example Argument 1 If the program syntax is faulty or if program execution results in division by zero, then the computer will generate an error message. Therefore, if the computer does not generate an error message, then the program syntax is correct and program execution does not result in division by zero.
Example Argument 2 If x is a real number such that x < 2 or x > 2, then x 2 > 4. Therefore, if x 2 4, then x 2 and x 2.
Logical Form of Arguments We use letters of the alphabet (such as p, q, and r) to represent the component sentences and the expression not p to refer to the sentence It is not the case that p. Then the common logical form of both the previous arguments is as follows: If p or q, then r. Therefore, if not r, then not p and not q.
Identifying Logical Form Fill in the blanks below so that argument (b) has the same form as argument (a). Then represent the common form of the arguments using letters to stand for component sentences. a. If Jane is an ECE student or Jane is a computer science major, then Jane will take Math 121. Jane is a. Therefore, Jane will.
Identifying Logical Form b. If logic is easy or (1), then (2). I will study hard. Therefore, I will get an A in this course.
Statement Or Proposition A sentence that is true or false but not both. Example: Two plus two equals four (true statement) Two plus two equals five (false statement) x + y > 0 (not a statement)
Compound Statements Symbols are used to build more complicated logical expressions out of simpler ones. The symbol denotes not, denotes and, and denotes or. Given a statement p, the sentence p is read not p or It is not the case that p and is called the negation of p.
In some computer languages the symbol is used in place of. p q is read p and q and is called the conjunction of p and q. p q is read p or q and is called the disjunction of p and q.
Logical Connectives Operator Symbol Usage Negation not Conjunction and Disjunction or Exclusive or xor Conditional if, then Biconditional iff Lecture 1 17
Translating from English to Symbols Write each of the following sentences symbolically, letting h = It is hot and s = It is sunny. a. It is not hot but it is sunny. b. It is neither hot nor sunny.
Suppose x is a particular real number. Let p, q, and r symbolize 0 < x, x < 3, and x = 3, respectively. Write the following inequalities symbolically: a. x 3 b. 0 < x < 3 c. 0 < x 3
Truth Values If such sentences are to be statements, they must have well-defined truth values they must be either true or false.
Truth table for negation p ~p T F F T 21
Truth table for conjunction p q p q True only if both statements are true T T T T F F F T F F F F 22
Truth table for disjunction p q p q False only if both statements are false T T T T F T F T T F F F 23
Statement form Expression made up of statement variables (such as p, q)and logical connectives becomes a statement when actual statements are substituted for the variables. Example: (Exclusive Or) ( p q) ~ ( p q) p q 24
Truth Table for a Statement Form Ex: Truth table for ~ p ( p q ) p q ~p p q ~ p ( p q) T T F T F T F F T F F T T T T F F T F F 25
Conditional (Implication) English usage of if, then or implies DEF: p q is true if q is true, or if p and q are both false. Semantics: p implies q is true if one can mathematically derive q from p. Lecture 1 26
Conditional -- truth table p q p q T T F F T F T F T F T T Lecture 1 27
Conditional Q: Does this makes sense? Let s try examples for each row of truth table: If pigs like mud then pigs like mud. If pigs like mud then pigs can fly. Lecture 1 28
Activity Q: Does this makes sense? Let s try examples for each row of truth table: If pigs like mud then pigs like mud. If pigs like mud then pigs can fly. If pigs can fly then pigs like mud. If pigs can fly then pigs can fly. Lecture 1 29
Bi-Conditional -- truth table For p q to be true, p and q must have the same truth value. Else, p q is false: p q p q T T F F T F T F T F F T Q : Which operator is the opposite of? 30
Bi-Conditional A : has exactly the opposite truth table as. This means that we could have defined the bi-conditional in terms of other previously defined symbols, so it is redundant. In fact, only really need negation and disjunction to define everything else. Extra operators are for convenience. Lecture 1 31
Logical equivalence Statements P and Q are logically equivalent: P Q if and only if they have identical truth values for each substitution of their component statement variables. Ex: x y y x 32
Verifying logical equivalence Ex: ~ ( p q) ~ p ~ q p q ~p ~q p ~ ( p q) T T F F T F F T F F T T F F F T T F T F F F F T T F T T q ~ p ~ q 33
De Morgan s Laws The negation of an and statement is logically equivalent to the or statement in which each component is negated. The negation of an or statement is logically equivalent to the and statement in which each component is negated.
Applying De Morgan s Laws Write negations for each of the following statements: a. John is 6 feet tall and he weighs at least 200 pounds. b. The bus was late or Tom s watch was slow.
Tautology A tautology is a statement form that is always true regardless of the truth values of the individual statements substituted for its statement variables. A statement whose form is a tautology is a tautological statement.
Contradiction A contradiction is a statement form that is always false regardless of the truth values of the individual statements substituted for its statement variables. A statement whose form is a contradiction is a contradictory statement.
Example Show that the statement form p p is a tautology and that the statement form p p is a contradiction.
Test Yourself 1. An and statement is true if, and only if, both components are. 2. An or statement is false if, and only if, both components are. 3. Two statement forms are logically equivalent if, and only if, they always have.
Test Yourself 4. De Morgan s laws say (1) that the negation of an and statement is logically equivalent to the or statement in which each component is, and (2) that the negation of an or statement is logically equivalent to the and statement in which each component is. 5. A tautology is a statement that is always. 6. A contradiction is a statement that is always.
Valid and Invalid Argument To say that an argument form is valid means that no matter what particular statements are substituted for the statement variables in its premises, if the resulting premises are all true, then the conclusion is also true. To say that an argument is valid means that its form is valid.
Testing an Argument Form for Validity 1. Identify the premises and conclusion of the argument form. 2. Construct a truth table showing the truth values of all the premises and the conclusion.
Testing an Argument Form for Validity 3. A row of the truth table in which all the premises are true is called a critical row. If there is a critical row in which the conclusion is false, then it is possible for an argument of the given form to have true premises and a false conclusion, and so the argument form is invalid. If the conclusion in every critical row is true, then the argument form is valid.
Example p q r q p r p r
Example p q r q p r p r Invalid
Syllogism An argument form consisting of two premises and a conclusion is called a syllogism. The first and second premises are called the major premise and minor premise, respectively.
Modus Ponens The most famous form of syllogism in logic is called modus ponens. It has the following form: If p then q. p q
Here is an argument of this form: If the sum of the digits of 371,487 is divisible by 3, then 371,487 is divisible by 3. The sum of the digits of 371,487 is divisible by 3. 371,487 is divisible by 3. The term modus ponens is Latin meaning method of affirming (the conclusion is an affirmation).
Modus Tollens Now consider another valid argument form called Modus Tollens. It has the following form: If p then q. q p Here is an example of modus tollens: If Zeus is human, then Zeus is mortal. Zeus is not mortal. Zeus is not human.
Here is an example of modus tollens: If Zeus is human, then Zeus is mortal. Zeus is not mortal. Zeus is not human. Modus Tollens is Latin meaning method of denying (the conclusion is a denial).
Recognizing Modus Ponens and Modus Tollens Use modus ponens or modus tollens to fill in the blanks of the following arguments so that they become valid inferences. a. If there are more pigeons than there are pigeonholes, then at least two pigeons roost in the same hole. There are more pigeons than there are pigeonholes..
Recognizing Modus Ponens and Modus Tollens Use modus ponens or modus tollens to fill in the blanks of the following arguments so that they become valid inferences. b. If 870,232 is divisible by 6, then it is divisible by 3. 870,232 is not divisible by 3..