Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discrete Mathematics Lecture 2.

Similar presentations


Presentation on theme: "Discrete Mathematics Lecture 2."— Presentation transcript:

1 Discrete Mathematics Lecture 2.
Dr.Bassant Mohamed El-Bagoury Module Logic (part proof methods)

2 Outline 1. Mathematical Reasoning 2. Arguments Examples – Predicate Logic 3. Rules of Inference – Knowledge Engineering 4. Rules of Inference for Quantifiers 4. Methods for Theorem Proving

3 Mathematical Reasoning

4 Mathematical Reasoning
We need mathematical reasoning to determine whether a mathematical argument is correct or incorrect and construct mathematical arguments. Mathematical reasoning is not only important for conducting proofs and program verification, but also for artificial intelligence systems (drawing inferences).

5 Arguments Example: Gary is either intelligent or a good actor.
If Gary is intelligent, then he can count from 1 to 10. Gary can only count from 1 to 2. Therefore, Gary is a good actor. i: “Gary is intelligent.” a: “Gary is a good actor.” c: “Gary can count from 1 to 10.”

6 Arguments i: “Gary is intelligent.” a: “Gary is a good actor.” c: “Gary can count from 1 to 10.” Step 1: c Hypothesis Step 2: i  c Hypothesis Step 3: i Modus Tollens Steps 1 & 2 Step 4: a  i Hypothesis Step 5: a Disjunctive Syllogism Steps 3 & 4 Conclusion: a (“Gary is a good actor.”)

7 Arguments Another example:
“If it rains today, then we will not have a barbeque today. If we do not have a barbeque today, then we will have a barbeque tomorrow. Therefore, if it rains today, then we will have a barbeque tomorrow.” This is a valid argument: If its hypotheses are true, then its conclusion is also true.

8 AI research × Software Engineering
Intelligent Behaviour Requirements Specification Functional Specification Knowledge Level System Implementation System Level Symbol Level

9 A small Expert System ( Inference System ) of rules for analysis of automotive problems.
Rule 1: if the engine is getting gas, and the engine will turn over, then the problem is spark plugs. Rule 2: if the engine does not turn over, and the lights do not come on the problem is battery or cables. Rule 3: if the lights do come on the problem is the starter motor. Rule 4: if there is gas in the fuel tank, and there is gas in the carburetor the engine is getting gas.

10 Fig. The Inference System at the start of a consultation in the car
Fig The Inference System at the start of a consultation in the car diagnostic example.

11 Fig The Inference System after Rule 1 has fired.

12 The and/or graph searched in the car diagnosis example, with the conclusion of Inference Rule 4 matching the first premise of Inference Rule 1.

13 The following dialogue begins with the computer asking the user about the goals present in working memory. Gas in fuel tank? Yes Gas in carburetor? Engine will turn over? Why It has been established that: 1. The engine is getting gas, 2. The engine will turn over, Then the problem is the spark plugs. How the engine is getting gas This follows from rule 4: if gas in fuel tank, and gas in carburetor then engine is getting gas. gas in fuel tank was given by the user gas in carburetor was given by the user

14 Terminology An axiom is a basic assumption about mathematical structures that needs no proof. We can use a proof to demonstrate that a particular statement is true. A proof consists of a sequence of statements that form an argument. The steps that connect the statements in such a sequence are the rules of inference. Cases of incorrect reasoning are called fallacies. A theorem is a statement that can be shown to be true.

15 Terminology A lemma is a simple theorem used as an intermediate result in the proof of another theorem. A corollary is a proposition that follows directly from a theorem that has been proved. A conjecture is a statement whose truth value is unknown. Once it is proven, it becomes a theorem.

16 Arguments Just like a rule of inference, an argument consists of one or more hypotheses and a conclusion. We say that an argument is valid, if whenever all its hypotheses are true, its conclusion is also true. However, if any hypothesis is false, even a valid argument can lead to an incorrect conclusion.

17 Arguments Example: “If 101 is divisible by 3, then 1012 is divisible by is divisible by 3. Consequently, 1012 is divisible by 9.” Although the argument is valid, its conclusion is incorrect, because one of the hypotheses is false (“101 is divisible by 3.”). If in the above argument we replace 101 with 102, we could correctly conclude that 1022 is divisible by 9.

18 Theorems, proofs, and rules of inference
When is a mathematical argument (or “proof”) correct? What techniques can we use to construct a mathematical argument? Theorem – statement that can be shown to be true. Axioms or postulates or premises – statements which are given and assumed to be true. Proof – sequence of statements, a valid Argument, to show that a theorem is true. Rules of Inference – rules used in a proof to draw conclusions from assertions known to be true.

19 Valid Arguments (reminder) Show that
Recall: An argument is a sequence of propositions. The final proposition is called the conclusion of the argument while the other propositions are called the premises or hypotheses of the argument. An Argument is valid whenever the truth of all its premises implies the truth of its conclusion. How to show that q logically follows from the hypotheses (p1  p2  …pn)? Show that (p1  p2  …pn)  q is a tautology One can use the rules of inference to show the validity of an argument. Vacuous proof - if one of the premises is false then (p1  p2  …pn)  q is vacuously True, since False implies anything.

20 Methods for Proving Theorems

21 Methods of Proof 1) Direct Proof 2) Proof by Contraposition
3) Proof by Contradiction 4) Proof of Equivalences 5) Proof by Cases 6) Existence Proofs 7) Counterexamples

22 1) Direct Proof Proof statement : p  q by: Assume p From p derive q.

23 Direct proof --- Example 1
Here’s what you know: Mary is a Math major or a CS major. If Mary does not like discrete math, she is not a CS major. If Mary likes discrete math, she is smart. Mary is not a math major. Can you conclude Mary is smart? Let M - Mary is a Math major C – Mary is a CS major D – Mary likes discrete math S – Mary is smart Informally, what’s the inference chain of reasoning? M  C D  C D  S M ((M  C)  (D  C)  (D  S)  (M))  S ?

24 ((M  C)  (D  C)  (D  S)  (M))  S
In general, to prove p  q, assume p and show that q follows. ((M  C)  (D  C)  (D  S)  (M))  S ?

25 Reminder: Propositional logic Rules of Inference or Method of Proof
See Table 1, p. 66, Rosen. Rule of Inference Tautology (Deduction Theorem) Name P  P  Q P  (P  Q) Addition P  Q  P (P  Q)  P Simplification Q  P  Q [(P)  (Q)]  (P  Q) Conjunction PQ  Q [(P)  (P Q)]  P Modus Ponens  Q P  Q  P [(Q)  (P Q)]  P Modus Tollens Q  R  P R [(PQ)  (Q  R)]  (PR) Hypothetical Syllogism (“chaining”) P  Q P [(P  Q)  (P)]  Q Disjunctive syllogism P  R  Q  R [(P  Q)  (P  R)]  (Q  R) Resolution Subsumes MP

26 Example 1 - direct proof QED Mary is smart!
1. M  C Given (premise) 2. D  C Given 3. D  S Given 4. M Given 5. C 6. D 7. S DS (disjunctive syllogism; 1,4) MT (modus tollens; 2,5) MP (modus ponens; 3,6) QED Mary is smart! QED or Q.E.D. --- quod erat demonstrandum

27 Direct Proof --- Example 2
Theorem: If n is odd integer, then n2 is odd. Looks plausible, but… How do we proceed? How do we prove this? Start with Definition: An integer is even if there exists an integer k such that n = 2k, and n is odd if there exists an integer k such that n = 2k+1. Properties: An integer is even or odd; and no integer is both even and odd. (aside: would require proof.)

28 Example 2: Direct Proof Theorem: (n) P(n)  Q(n),
where P(n) is “n is an odd integer” and Q(n) is “n2 is odd.” We will show P(n)  Q(n)

29 Proof strategy hint: Go back to definitions of concepts
Theorem: If n is odd integer, then n2 is odd. Proof: Let P --- “n is odd integer” Q --- “n2 is odd” we want to show that P  Q Assume P, i.e., n is odd. By definition n = 2k + 1, where k is some integer. Therefore n2 = (2k + 1)2 = 4k2 + 4k + 1 = 2 (2k2 + 2k ) + 1, which is by definition is an odd number (use k’ = (2k2 + 2k ) ). QED Proof strategy hint: Go back to definitions of concepts and start by trying direct proof.

30 More Explaination

31 The Foundations: Logic and Proofs
Chapter 1

32 Propositional Logic Proposition is a declarative statement that
is either true of false Baton Rouge is the capital of Louisiana True Toronto is the capital of Canada False 1+1= True 2+2= False Statements which are not propositions: What time is it? x+1 = 2

33 Negation: truth table T F

34 Conjunction: truth table T F

35 Disjunction: truth table T F

36 one or the other but not both
Exclusive-or: one or the other but not both truth table T F

37 Conditional statement:
(hypothesis) (conclusion) Conditional statement: if p then q p implies q q follows from p p only if q p is sufficient for q truth table T F

38 Conditional statement:
equivalent (same truth table) Contrapositive: Converse: equivalent Inverse:

39 Biconditional statement:
p if and only if q p iff q If p then q and conversely p is necessary and sufficient for q truth table T F

40 Compound propositions
F Precedence of operators higher lower

41 Translating English into propositions

42 Propositional Equivalences
Compound proposition Tautology: always true Contradiction: always false tautology contradiction T F Contingency: not a tautology and not a contradiction

43 Rules of Inference Modus Ponens Valid argument: if premises are true
If you have a current password, then you can log onto the network You have a current password Therefore, you can log onto the network Modus Ponens Valid argument: if premises are true then conclusion is true

44 Modus Ponens If and then

45 Rules of Inference Modus Ponens Modus Tollens Hypothetical Syllogism Disjunctive Syllogism

46 Rules of Inference Addition Simplification Conjunction Resolution

47 It is below freezing now
Therefore, it is either below freezing or raining now Addition

48 It is below freezing and raining now Therefore, it is below freezing now Simplification

49 Hypothetical Syllogism If it rains today
then we will not have a barbecue today If we do not have a barbecue today then we will have a barbecue tomorrow Therefore, if it rains today then we will have a barbecue tomorrow Hypothetical Syllogism

50 Resolution it is not snowing or Jasmine is skiing It is snowing
or Bart is playing hockey Therefore, Jasmine is skiing or Bart is playing hockey Resolution

51 Hypothesis: Conclusion: It is not sunny this afternoon
and it is colder than yesterday We will go swimming only if it is sunny If we do not go swimming, then we will take a canoe trip If we take a canoe trip, then we will be home by sunset Conclusion: We will be home by sunset

52 Hypothesis Simplification from 1 Hypothesis Modus tollens from 2,3 Hypothesis Modus ponens from 4,5 Hypothesis Modus ponens from 6,7

53 Chapter 1: Foundations: Logic and Proofs
Discrete Mathematics and its Applications 2017/4/21 Chapter 1: Foundations: Logic and Proofs In Spring 2003 I spent 7 fifty-minute lecture periods on this material, but two half-lectures were taken up by team selection and a quiz, so it really only took 6 lectures. (c) , Michael P. Frank

54 Foundations of Logic (§1.1-1.3)
Discrete Mathematics and its Applications 2017/4/21 Foundations of Logic (§ ) Mathematical Logic is a tool for working with complicated compound statements. It includes: A language for expressing them. A concise notation for writing them. A methodology for objectively reasoning about their truth or falsity. It is the foundation for expressing formal proofs in all branches of mathematics. (c) , Michael P. Frank

55 Universes of Discourse (U.D.s)
The power of distinguishing objects from predicates is that it lets you state things about many objects at once. E.g., let P(x)=“x+1>x”. We can then say, “For any number x, P(x) is true” instead of (0+1>0)  (1+1>1)  (2+1>2)  ... The collection of values that a variable x can take is called x’s universe of discourse.

56 Quantifier Expressions
Quantifiers provide a notation that allows us to quantify (count) how many objects in the univ. of disc. satisfy a given predicate. “” is the FORLL or universal quantifier. x P(x) means for all x in the u.d., P holds. “” is the XISTS or existential quantifier. x P(x) means there exists an x in the u.d. (that is, 1 or more) such that P(x) is true.

57 The Universal Quantifier 
Discrete Mathematics and its Applications 2017/4/21 The Universal Quantifier  Example: Let the u.d. of x be parking spaces at UF. Let P(x) be the predicate “x is full.” Then the universal quantification of P(x), x P(x), is the proposition: “All parking spaces at UF are full.” i.e., “Every parking space at UF is full.” i.e., “For each parking space at UF, that space is full.” Instructors: You can substitute your favorite overly-crowded destination in place of the University of Florida in this example. (c) , Michael P. Frank

58 The Existential Quantifier 
Example: Let the u.d. of x be parking spaces at UF. Let P(x) be the predicate “x is full.” Then the existential quantification of P(x), x P(x), is the proposition: “Some parking space at UF is full.” “There is a parking space at UF that is full.” “At least one parking space at UF is full.”

59 Review: Predicate Logic (§1.3)
Objects x, y, z, … Predicates P, Q, R, … are functions mapping objects x to propositions P(x). Multi-argument predicates P(x, y). Quantifiers: [x P(x)] :≡ “For all x’s, P(x).” [x P(x)] :≡ “There is an x such that P(x).” Universes of discourse, bound & free vars.

60 Foundations of Logic: Overview
Propositional logic (§ ): Basic definitions. (§1.1) Equivalence rules & derivations. (§1.2) Predicate logic (§ ) Predicates. Quantified predicate expressions. Equivalences & derivations.

61 Propositional Logic (§1.1)
Discrete Mathematics and its Applications 2017/4/21 Propositional Logic (§1.1) Propositional Logic is the logic of compound statements built from simpler statements using so-called Boolean connectives. Some applications in computer science: Design of digital electronic circuits. Expressing conditions in programs. Queries to databases & search engines. George Boole ( ) We normally attribute propositional logic to George Boole, who first formalized it. Actually the particular formal notation we will present is not precisely Boole’s; he originally spoke of logic in terms of sets, not propositions, and he also used Boolean algebra notation such as AB, A+B, rather than the A /\ B, A \/ B notation we will use. But, he was the first to mathematically formalize these kinds of concepts in preserved writings. Boole’s formalization of logic was developed further by the philosopher Frege. However, even though logic was not formalized as such until the 1800’s, the basic ideas of it go all the way back to the ancient Greeks. Aristotle (ca B.C.) developed a detailed system of logic (though one that was not quite as convenient and powerful as the modern one), and Chrysippus of Soli (ca B.C.) introduced a logic centered around logic AND, inclusive and exclusive OR, NOT, and implication, similarly to Boole’s. Chrysippus’ logic apparently included all of the key rules that Boole’s logic had. However, his original works were unfortunately lost; we only have fragments quoted by other authors. Chrysippus of Soli (ca. 281 B.C. – 205 B.C.) (c) , Michael P. Frank

62 Definition of a Proposition
A proposition (p, q, r, …) is simply a statement (i.e., a declarative sentence) with a definite meaning, having a truth value that’s either true (T) or false (F) (never both, neither, or somewhere in between). (However, you might not know the actual truth value, and it might be situation-dependent.) [Later we will study probability theory, in which we assign degrees of certainty to propositions. But for now: think True/False only!]

63 Examples of Propositions
“It is raining.” (In a given situation.) “Beijing is the capital of China.” • “1 + 2 = 3” But, the following are NOT propositions: “Who’s there?” (interrogative, question) “La la la la la.” (meaningless interjection) “Just do it!” (imperative, command) “Yeah, I sorta dunno, whatever...” (vague) “1 + 2” (expression with a non-true/false value)

64 Operators / Connectives
Discrete Mathematics and its Applications 2017/4/21 Operators / Connectives An operator or connective combines one or more operand expressions into a larger expression. (E.g., “+” in numeric exprs.) Unary operators take 1 operand (e.g., −3); Binary operators take 2 operands (eg 3  4). Propositional or Boolean operators operate on propositions or truth values instead of on numbers. Later in the course, we will see that operators can themselves be defined in terms of functions. This slide doesn’t define them that way because we haven’t defined functions yet. But for your reference, when you come back to study this section after learning about functions, in general, an n-ary operator O on any set S (the domain of the operator) is a function O:S^n->S mapping n-tuples of members of S (the operands) to members of S. “S^n” here denotes S with n as a superscript, that is, the nth Cartesian power of S. All this will be defined later when we talk about set theory. For Boolean operators, the set we are dealing with is B={True,False}. A unary Boolean operator U is a function U:B->B, while a binary Boolean operator T is a function T:(B,B)->B. Binary operators are conventionally written in between their operands, while unary operators are usually written in front of their operands. (One exception is the post-increment and post-decrement operators in C/C++/Java, which are written after their operands.) (c) , Michael P. Frank

65 Some Popular Boolean Operators
Formal Name Nickname Arity Symbol Negation operator NOT Unary Conjunction operator AND Binary Disjunction operator OR Exclusive-OR operator XOR Implication operator IMPLIES Biconditional operator IFF

66 The Negation Operator The unary negation operator “¬” (NOT) transforms a prop. into its logical negation. E.g. If p = “I have brown hair.” then ¬p = “I do not have brown hair.” Truth table for NOT: T :≡ True; F :≡ False “:≡” means “is defined as” Operand column Result column

67 The Conjunction Operator
The binary conjunction operator “” (AND) combines two propositions to form their logical conjunction. E.g. If p=“I will have salad for lunch.” and q=“I will have steak for dinner.”, then pq=“I will have salad for lunch and I will have steak for dinner.” ND Remember: “” points up like an “A”, and it means “ND”

68 Conjunction Truth Table
Discrete Mathematics and its Applications 2017/4/21 Conjunction Truth Table Operand columns Note that a conjunction p1  p2  …  pn of n propositions will have 2n rows in its truth table. Also: ¬ and  operations together are suffi-cient to express any Boolean truth table! Note that AND is commutative and associative, which means that we can write a long conjunction (like in the first bullet on the left) without parenthesizing it. It also doesn’t matter what order the n propositions are in. The fact that an n-operand operator has 2^n rows in its truth table is an easy consequence of the product rule of combinatorics. Here is a proof. Note that for the table to be complete, we must have 1 row for every possible assignment of truth values to the n operands. Thus, there is 1 row for every function f:V->B, where V is the set of operand columns {p,q,…} and B={T,F}. Here, |V|=n and |B|=2. The number of functions from a set of size n to a set of size m is m^n. This is because of the product rule, as we will see in a moment. In this case, m=2 so we get 2^n such functions. In terms of the product rule: There are 2 possible values for p. For each of these, there are 2 possible values for q, since the choice of q is independent of the choice of p. And so on. So there are 2x2x…(n repetitions)…x2 possible rows, thus 2^n. Of course, we haven’t defined the product rule, set cardinality, or functions yet, so don’t worry if the above argument doesn’t quite make sense to you yet. In the second bullet, we would say, {NOT,AND} is a universal set of Boolean operators, but we haven’t even defined sets yet. If you already know what a set is, a universal set of operators over a given domain is a set of operators such that nested expressions involving those operators are sufficient to express any possible operator over that domain. In this case, the domain is B={T,F}. The proof that {NOT,AND} is universal is as follows: OR can be defined by p OR q = NOT(NOT(p) AND NOT(q)) (easily verified; this is one of DeMorgan’s Laws, which we will get to later). Now, armed with OR, AND, and NOT, we can show how to express any Boolean truth table, with any number of columns, as follows. Look for the cases where the last (result) column is T. For each such row in the truth table, include a corresponding term in a disjunctive expression for the whole truth table. The term should be a conjunction of terms, one for each input operand in that row. Each of these terms should be p if the entry in that position is “T”, and NOT(p) if the entry in that position is “F”. So, the entire expression basically says, “the value of the operator is T if and only if the pattern of truth values of the input operands exactly matches one of the rows in the truth table that ends in a ‘T’ result.” Thus, the expression directly encodes the content of the truth table. (c) , Michael P. Frank

69 The Disjunction Operator
The binary disjunction operator “” (OR) combines two propositions to form their logical disjunction. p=“My car has a bad engine.” q=“My car has a bad carburetor.” pq=“Either my car has a bad engine, or my car has a bad carburetor.” After the downward- pointing “axe” of “” splits the wood, you can take 1 piece OR the other, or both. Meaning is like “and/or” in English.

70 Disjunction Truth Table
Note that pq means that p is true, or q is true, or both are true! So, this operation is also called inclusive or, because it includes the possibility that both p and q are true. “¬” and “” together are also universal.

71 Nested Propositional Expressions
Discrete Mathematics and its Applications 2017/4/21 Nested Propositional Expressions Use parentheses to group sub-expressions: “I just saw my old friend, and either he’s grown or I’ve shrunk.” = f  (g  s) (f  g)  s would mean something different f  g  s would be ambiguous By convention, “¬” takes precedence over both “” and “”. ¬s  f means (¬s)  f , not ¬ (s  f) As an exercise, drop the truth tables for f /\ (g \/ s) and (f /\ g) \/ s to see that they’re different, and thus the parentheses are necessary. Precedence conventions such as the one in the second bullet help to reduce the number of parentheses needed in expressions. Note that negation, with its tight binding (high precedence), and with its position to the left of its operand, behaves similarly to a negative sign in arithmetic. There is also a precedence convention that you see sometimes (for example, in the C programming language) that AND takes precedence over OR. However, this convention is not quite universally accepted, not all systems adopt it. Therefore, to be safe, you should always include parentheses whenever you are mixing ANDs and ORs in a single sequence of binary operators. (c) , Michael P. Frank

72 Discrete Mathematics and its Applications
2017/4/21 A Simple Exercise Let p=“It rained last night”, q=“The sprinklers came on last night,” r=“The lawn was wet this morning.” Translate each of the following into English: ¬p = r  ¬p = ¬ r  p  q = “It didn’t rain last night.” For slides that have interactive exercises, it may be a good idea to stop the class for a minute to allow the students to discuss the problem with their neighbors, then call on someone to answer. This will help keep the students engaged in the lecture activity. “The lawn was wet this morning, and it didn’t rain last night.” “Either the lawn wasn’t wet this morning, or it rained last night, or the sprinklers came on last night.” (c) , Michael P. Frank

73 The Exclusive Or Operator
The binary exclusive-or operator “” (XOR) combines two propositions to form their logical “exclusive or” (exjunction?). p = “I will earn an A in this course,” q = “I will drop this course,” p  q = “I will either earn an A for this course, or I will drop it (but not both!)”

74 Exclusive-Or Truth Table
Discrete Mathematics and its Applications 2017/4/21 Exclusive-Or Truth Table Note that pq means that p is true, or q is true, but not both! This operation is called exclusive or, because it excludes the possibility that both p and q are true. “¬” and “” together are not universal. A good way to remember the symbol for XOR, a plus sign inside an O, is to think of XOR as adding the bit-values of its inputs (mod 2). E.g., 0+0=0, 1+0=0, 1+1=0 (mod 2). Thus XOR is basically an addition, and we put it inside an “O” to remind ourselves that it is a type of “Or”. XOR together with unary operators do not form a universal set of operators over the Booleans. However, it turns out that they are a universal set for quantum logic! However we do not have time to cover quantum computing in this class, interesting though it is. (c) , Michael P. Frank

75 Natural Language is Ambiguous
Note that English “or” can be ambiguous regarding the “both” case! “Pat is a singer or Pat is a writer.” - “Pat is a man or Pat is a woman.” - Need context to disambiguate the meaning! For this class, assume “or” means inclusive.

76 The Implication Operator
Discrete Mathematics and its Applications 2017/4/21 The Implication Operator antecedent consequent The implication p  q states that p implies q. I.e., If p is true, then q is true; but if p is not true, then q could be either true or false. E.g., let p = “You study hard.” q = “You will get a good grade.” p  q = “If you study hard, then you will get a good grade.” (else, it could go either way) Note that the definition of “p implies q” says: “If p is true, then q is true, and if p is not true, then q is either true or false.” Well, saying that q is either true or false is not saying anything, since any proposition is, by the very definition of a proposition, either true or false. So, the last part of that sentence (covering the case where p is not true) is not really saying anything. So we may as well say the definition is, “If p is true, then q is true.” (c) , Michael P. Frank

77 Examples of Implications
Discrete Mathematics and its Applications 2017/4/21 Examples of Implications “If this lecture ends, then the sun will rise tomorrow.” True or False? “If Tuesday is a day of the week, then I am a penguin.” True or False? “If 1+1=6, then Bush is president.” True or False? “If the moon is made of green cheese, then I am richer than Bill Gates.” True or False? The first one is true because T->T is True. It doesn’t matter that my lecture ending is not the cause of the sun rising tomorrow. The second one is false for me, because although Tuesday is a day of the week, I am most certainly NOT a penguin. (But, if a penguin were to say this statement, then it would be true for him.) The third one is true, because 1+1 is not equal to 6. F->T is True. The last one is true, because the moon is not made of green cheese. F->F is True. In other words, anything that’s false implies anything at all. p->q if p is false. Why? If p is false, then if p is true, then p is both false and true at the same time, and so truth and falsity are the same thing. So if q is false then q is true. (c) , Michael P. Frank

78 English Phrases Meaning p  q
“p implies q” “if p, then q” “if p, q” “when p, q” “whenever p, q” “p only if q” “ p is sufficient for q” “q if p” “q when p” “q whenever p” “q is necessary for p” “q follows from p” “q is implied by p” We will see some equivalent logic expressions later.

79 The biconditional operator
Discrete Mathematics and its Applications 2017/4/21 The biconditional operator The biconditional p  q states that p is true if and only if (IFF) q is true. p = “Bush wins the 2004 election.” q = “Bush will be president for all of 2005.” p  q = “If, and only if, Bush wins the 2004 election, Bush will be president for all of 2005.” I’m still here! 2004 2005 (c) , Michael P. Frank

80 Boolean Operations Summary
Discrete Mathematics and its Applications 2017/4/21 Boolean Operations Summary We have seen 1 unary operator (out of the 4 possible) and 5 binary operators (out of the 16 possible). Their truth tables are below. For fun, try writing down the truth tables for each of the 4 possible unary operators, and each of the 16 possible binary operators. For each one, try to come up with an English description of the operator that conveys its meaning. Also, figure out a way to define it in terms of other operators we already introduced. (c) , Michael P. Frank

81 Some Alternative Notations

82 End of §1.1 You have learned about: Propositions: What they are.
Propositional logic operators’ Symbolic notations. English equivalents. Logical meaning. Truth tables. Atomic vs. compound propositions. Alternative notations. Bits and bit-strings. Next section: §1.2 Propositional equivalences. How to prove them.

83 Propositional Equivalence (§1.2)
Two syntactically (i.e., textually) different compound propositions may be the semantically identical (i.e., have the same meaning). We call them equivalent. Learn: Various equivalence rules or laws. How to prove equivalences using symbolic derivations.

84 Tautologies and Contradictions
A tautology is a compound proposition that is true no matter what the truth values of its atomic propositions are! Ex. p  p [What is its truth table?] A contradiction is a compound proposition that is false no matter what! Ex. p  p [Truth table?] Other compound props. are contingencies.

85 Predicate Logic (§1.3) Predicate logic is an extension of propositional logic that permits concisely reasoning about whole classes of entities. Propositional logic (recall) treats simple propositions (sentences) as atomic entities. In contrast, predicate logic distinguishes the subject of a sentence from its predicate. Remember these English grammar terms?

86 Applications of Predicate Logic
It is the formal notation for writing perfectly clear, concise, and unambiguous mathematical definitions, axioms, and theorems (more on these in chapter 3) for any branch of mathematics. Predicate logic with function symbols, the “=” operator, and a few proof-building rules is sufficient for defining any conceivable mathematical system, and for proving anything that can be proved within that system!

87 Discrete Mathematics and its Applications
2017/4/21 Other Applications Predicate logic is the foundation of the field of mathematical logic, which culminated in Gödel’s incompleteness theorem, which revealed the ultimate limits of mathematical thought: Given any finitely describable, consistent proof procedure, there will still be some true statements that can never be proven by that procedure. I.e., we can’t discover all mathematical truths, unless we sometimes resort to making guesses. Kurt Gödel A note on pronunciation: The guy’s name is Austrian. The o with the double dot over it is called an “o umlaut.” It is also sometimes written “oe” in languages without umlauts, thus, “Goedel” is also a correct way to write his name in English. An o umlaut is pronounced something between “uh” and “ur”. So, “Goedel” is pronounced something like “girdle.” One way of saying Godel’s theorem is that there are infinitely many finite mathematical statements that are true, but that are not provable from earlier statements by any finite argument following a fixed set of logical inference rules. Thus, the only way to really expand the scope of mathematics is to make guesses (through intuition or inspiration) about additional statements being true (or equivalently, additional inference rules being valid). When one makes such guesses, since they have not been proven, one should always keep in mind the possibility that they may be false (inconsistent with earlier statements), and thus may eventually be disproven. Thus, in general, we can never really know whether a given mathematical system we are using is really logically self-consistent. (Except for some very simple systems of limited power can be proven to be consistent.) Later, we will see that the mathematical world was badly shaken up when it was discovered that the simple form of set theory that everyone had been using was actually inconsistent! To restore consistency, the theory had to be modified, and the new set theory is consistent, as far as anyone knows. Goedel was also a close colleague and friend of Albert Einstein, and he discovered (among other things) that Einstein’s theory of General Relativity (the modern theory of gravity) had some theoretical solutions in which time travel into the past was possible! (c) , Michael P. Frank

88 Subjects and Predicates
In the sentence “The dog is sleeping”: The phrase “the dog” denotes the subject - the object or entity that the sentence is about. The phrase “is sleeping” denotes the predicate- a property that is true of the subject. In predicate logic, a predicate is modeled as a function P(·) from objects to propositions. P(x) = “x is sleeping” (where x is any object).

89 Review: Propositional Logic (§1.1-1.2)
Atomic propositions: p, q, r, … Boolean operators:       Compound propositions: s : (p  q)  r Equivalences: pq  (p  q) Proving equivalences using: Truth tables. Symbolic derivations. p  q  r …

90 Predicates and Quantifiers
variable predicate Propositional functions

91 Predicate logic

92 Universal quantifier: for all it holds
(for every element in domain) is true for every real number (for every element in domain) is not true for every real number Counterexample:

93 Existential quantifier:
there is such that is true because is not true

94 For finite domain

95 Quantifiers with restricted domain
Precedence of operators higher lower

96 Logical equivalences with quantifiers
False False

97 De Morgan’s Laws for Quantifiers

98 Example Recall that:

99 Translating English into Logical Expressions
“All hummingbirds are richly colored” “No large birds live on honey” “Birds that do not live on honey are dull in color” “Hummingbirds are small”

100 Universal Modus Ponens
For all positive integers , if then Therefore,


Download ppt "Discrete Mathematics Lecture 2."

Similar presentations


Ads by Google