Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Logic What is Logic? ο logic is a process people use to infer one thing from another ο logic is the root of all mathematics and is the root of all rational thought (truth) Symbolic Logic ο Symbolic logic, also known as mathematical logic, is a subfield of mathematics. Example π β¨ π πππππππ‘ππ q or r π β§ π πππππππ‘ππ π πππ π Worded Expressions ο Translating ο from English to symbols. But and neither-Nor Example Dogs bark and cats meow. Symbols ο ο ο ο ο ο ο ο The symbol ~ denotes not pΞq denotes βp and qβ pVq denotes βp or qβ β denotes βfor allβ β denotes βthere existsβ pβq denotes βp or q but not both p and qβ Pβ‘Q denotes βP is logically equivalent to Qβ pβq denotes βif p then qβ Symbolic Logical Expressions ο 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. Example ο π΄ β¨ π΅ β§ ~πΆ β π· ο ο It ο ο If A or B and if not C, Then D is not hot and it is sunny. Letting h=βit is hotβ and s=βit is sunnyβ ~β β§ π Practice ο Translate the symbolic expression to a worded expression. ο (~π΄ β¨ ~π΅) β§ πΆ β π· Practice ο Translate the worded expression to a symbolic expression. ο ο Let h=βit is hotβ and s=βit is sunnyβ It is neither hot nor sunny. 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. Example ο Write the negation for the following statement. ο ο John is 6 feet tall and he weighs at least 200 pounds. John is not 6 feet tall or he weighs less than 200 pounds. Example ο Write the negation for the following statement. ο The bust late or Tomβs watch was slow. ο The bus was not late and Tomβs watch was not slow. Individual Practice ο Use De Morganβs laws to write the negations for the statements. ο ο ο Sam is an orange belt and Kate is a red belt. The connector is loose or the machine is unplugged. Hal is a math major and Halβs sister is a computer science major. Conjunction of p and q ο The sentence βpΞqβ is read βp and gβ and is called conjunction of p and q. ο It is true when, and only when, both p and q are true. ο If either p or q is false, or if both are false, p and q is false. Disjunction of p and q ο The sentence βpVqβ is read βp or qβ and is called the disjunction of p and q. ο It is true when either p is true, or q is true, or both p and q are true; it is false only when both p and q are false. Example ο Letting h = βIt is hotβ and s = βIt is sunnyβ write each of the following sentences symbolically. ο It is not hot but it is sunny. ο ~hΞs. ο It is not hot and it is not sunny. ο ~h Ξ~s. Practice ο Let s = βstocks are increasingβ and i=βinterest rates are steady.β ο ο Stocks are increasing but interest rates are steady Neither are stocks increasing nor are interest rates steady. Practice ο Juan is a math major but not a computer science major. (m=Juan is a math major, c= Juan is a computer science major) Principles of Logic ο Objective: SWBAT establish logical consequences through the use of truth tables, syllogism, and deductive reasoning. Logical Consequences ο Logical consequence is a fundamental concept in logic. It is the relation that holds between a set of sentences (or propositions) and a sentence (proposition) when the former "entails" the latter. Example ο 'Kermit is green' is said to be a logical consequence of 'All frogs are green' and 'Kermit is a frog', because it would be "selfcontradictory" to affirm the latter and deny the former. ο "If it isn't obvious, it isn't logical." -Nelsen Truth Tables ο Truth tables can be used to tell whether a propositional expression is true for all legitimate input values, that is, logically valid. Example ο Conjunction P q pΞq T T T T F F F T F F F F Example ο Disjunction P q pVq T T T T F T F T T F F F Syllogism οA syllogism or logical appeal is a kind of logical argument in which one proposition (the conclusion) is inferred from two others (the premises) of a certain form. Syllogism Continued ο Syllogisms are arguments that take several parts, normally with two statements which are assumed to be true that lead to a conclusion. ο Major premise: A general statement. Minor premise: A specific statement. Conclusion: based on the two premises Example ο Aristotle's Syllogism If all humans are mortal, and all Greeks are humans, then all Greeks are mortal. Deductive Argument οA deductive argument is an argument in which it is thought that the premises provide a guarantee of the truth of the conclusion. Deductive Argument Continued ο In a deductive argument, the premises are intended to provide support for the conclusion that is so strong that, if the premises are true, it would be impossible for the conclusion to be false. Example ο All men are mortal. Joe is a man. Therefore Joe is mortal. ο If the first two statements are true, then the conclusion must be true. Statement Composition οA statement (or proposition) is a sentence that is true or false but not both. Inverse οA conditional statement and its inverse are not logically equivalent. ο Suppose a conditional statement of the form βIf p then qβ is given. ο The inverse is βIf ~p then ~q.β Example ο If Howard can swim across the lake, then Howard can swim to the island. ο Inverse: If Howard cannot swim across the lake, then Howard cannot swim to the island. Practice ο Write the inverse of the following statement. ο If today is Easter, then tomorrow is Monday. Converse οA conditional statement and its converse are not logically equivalent. ο ο Suppose a conditional statement of the form βIf p then qβ is given. The converse is βIf q then p.β Example ο If Howard can swim across the lake, then Howard can swim to the island. ο If Howard can swim to the island, then Howard can swim across the lake. Practice ο Write the converse of the following statement. ο If today is Easter, then tomorrow is Monday. Contrapositive ο The contrapositive of a conditional statement of the form βIf p then qβ is If ~q then ~p. ο Symbolically, The contrapositive of π β π is ~π β ~π. Example ο If Howard can swim across the lake, then Howard can swim to the island. ο Contrapositive: If Howard cannot swim to the island, then Howard cannot swim across the lake. Practice ο Write the contrapositive of the following statement. ο If today is Easter, then tomorrow is Monday. Logically Equivalent ο Two statement forms are called logically equivalent if, and only if, they have identical truth values for each possible substitution of statements for their statement variables. The logical equivalence of statement forms P and Q is denoted by writing P β‘ Q. Testing ο Step 1: Construct a truth table for P with one column for the truth values of P and another column for the truth values of Q. ο Step 2: Check each combination of truth values of the statement variables to see whether the truth value of P is the same as the truth value of Q. Step 2 Continued ο If in each row the truth value of P is the same as the truth value of Q, then P and Q are logically equivalent. ο If in some row P has a different truth value from Q, then P and Q are not logically equivalent. Wrap-up