Download presentation
Presentation is loading. Please wait.
1
Chapter 2 Fundamentals of Mathematical Logic
Discrete Mathematics: A Concept-based Approach
2
What is Logic? The area of mathematical logic is also called mathematics of reasoning and the first study was taken up by the Greek philosopher Aristotle ( BC). The language called PROLOG is built on the foundation of logic. The word PROLOG is an abbreviation for programming in Logic . Logic is used in Natural language processing, theorem proving, Game theory, Automatic answering systems, Ontologies, Control systems and Graphical user interfaces. Discrete Mathematics: A Concept-based Approach
3
Types of Logic? Symbolic logic First order predicate logic
In Symbolic logic , we deal with declarative sentences. The meaning of these sentences can be modified with the use of the words like “NOT”, “AND”, “OR”, “IF-THEN-ELSE”, “IF-AND-ONLY-IF”, and “EXCLUSIVE-OR”. These words are called statement connectives. The declarative statements, which are true or false, but not both is called Proposition. Discrete Mathematics: A Concept-based Approach
4
Examples of statements
2 is not a prime 6 is a composite number Some of the compound statements are: 2 is prime AND 6 is a composite number IF 2 is not a prime THEN 6 is a composite number 2 is not a prime IF-AND-ONLY-IF 6 is a composite number 2 is prime OR 6 is a composite number The AND connective is also called the conjunction operation and OR operation is called the disjunction operation. The symbols used are: Discrete Mathematics: A Concept-based Approach
5
Symbols used AND ( ^ ) , OR (v), IF-THEN (→), IF-AND-ONLY-IF (↔ ), EXCLUSIVE-OR (Θ) and NOT(¬ ). These symbols are used for connectives in logic expressions. All propositions are assertions but vice versa are not always true. In the sentence “The pot is hot or cold” , the connective “or” is used in exclusive sense and is called “Ex-or” connective. Discrete Mathematics: A Concept-based Approach
6
Some sentences Consider the following sentences and define in Logic using the different connectives. I go to school or it is raining today If Mary dances well the Peter is six feet tall Mary dances well if and only if Peter is six feet tall I do not go to school It is raining or it is snowing today. Mary dances well implies that Peter is six feet tall Discrete Mathematics: A Concept-based Approach
7
Symbols used Following are the symbols used for the following sentences I go to school (T) The Sun is shining (S) Peter is six feet tall (P) Mary dances well (M) It is raining today (R) It is snowing today (I) Discrete Mathematics: A Concept-based Approach
8
Symbolic expressions The following are the expressions for the sentences considered. (T v I) (M→P) (M↔P) ¬T (R v I ) Discrete Mathematics: A Concept-based Approach
9
Truth Table for “OR” and “AND”
P Q PVQ F T P Q P^Q F T Discrete Mathematics: A Concept-based Approach
10
Truth Table for “Implication” and “Double Implication”
Q (P → Q) F T P Q (P ↔ Q) F T Discrete Mathematics: A Concept-based Approach
11
Example Consider the sentence “If either the Pirates or the Cubs lose and the Giants win, then the Dodgers will be out of the first place and, moreover, I will lose the bet”. It is an implication. This compound sentence has the elementary sentences and the propositional variables are given in parentheses. The Pirate lose (P), The Clubs lose ( C ), The Giant’s win ( G), Dodger’s will be out of first place (D) and I will lose the bet (B). The expression in symbolic form is of the form (A→B), where the premise A and conclusion B are further rewritten as: ((P v C) ^ G) → (D ^ G) Discrete Mathematics: A Concept-based Approach
12
Tautology, Contradiction and Contingency
In logic, the expression which is always true irrespective of the truth values of the propositional variables is called a Tautology. Exactly the opposite, the expression which is always false irrespective of the truth values of the propositional variables is called Contradiction. If we have the mix of truth values for the given expression, it is called Contingency. Discrete Mathematics: A Concept-based Approach
13
Example for Contingency
Q R ¬R (4) → (1) (2) ^ (5) F T Discrete Mathematics: A Concept-based Approach
14
Laws of Logic Let P , Q and R be the propositional variables. T and F represent the tautology and contradiction respectively. ¬¬P↔ P Law of double negation ¬(P v Q) ↔ ¬P ^ ¬Q DeMorgan’s laws ¬(P ^ Q) ↔ ¬P v ¬Q (P v Q) ↔ (Q v P) Commutative Laws (P ^ Q) ↔ (Q ^ P) P ^ (Q ^ R) ↔ (P ^ Q) ^ R Associative Laws P v (Q v R) ↔ (P v Q) v R P ^ (Q v R) ↔ (P ^ Q) v (P ^ R) Distributive Laws P v (Q ^ R) ↔ (P v Q) ^ (P v R) (P ^ P) ↔ P Idempotent Laws Discrete Mathematics: A Concept-based Approach
15
Laws of Logic (Continued)
(P v P) ↔ P (P v F ) ↔ P Identity Laws (P ^ T ) ↔ P (P v ¬P ) ↔ T Inverse Laws (P ^ ¬P) ↔ F (P v T ) ↔ T Domination Laws (P ^ F) ↔ F P v (P ^ Q) ↔ P Absorption Laws Discrete Mathematics: A Concept-based Approach
16
PRINCIPLE OF DUALITY Consider a statement S containing only the connectives v and ^ . The dual of S denoted by Sd is the new statement obtained by interchanging v by ^ and ^ by v in the given statement. Each occurrence of F is changed to T and vice versa. Let P and Q be two elementary statements or sentences. The dual of P is P. If the elementary sentence is negated (¬P) then its dual is ¬P. The expressions (P ^ ¬Q) and (P v ¬Q) are dual to each other. Consider the following expression: P ^ (Q v ¬R) v (Q ^ F) Its dual is P v (Q ^ ¬R) ^ (Q v T), which is obtained by interchanging ^ and v. The logical constant T by F. Discrete Mathematics: A Concept-based Approach
17
PRINCIPLE OF DUALITY The principle of duality states that for s and t, two statements involving only connectives v and ^, if s↔t then sd ↔ td. Consider the distributive laws and their duals. P ^ (Q v R) ↔ (P ^ Q) v (P ^ R) Let s: P ^ (Q v R) and t: (P ^ Q) v (P ^ R). The duals of s and t are sd : P v (Q ^ R) and td : (P v Q) ^ (P v R). The validity can be examined using truth table approach. Hence sd ↔ td. Discrete Mathematics: A Concept-based Approach
18
Example: Consider the expression (P v Q) ^ (¬ (¬ P ^ Q )) and simplify. The laws are applied as under. (P v Q) ^ (¬ (¬ P ^ Q )) ↔ (P v Q) ^ (¬ ¬ P v ¬Q) : Applied DeMorgan’s law ↔ (P v Q) ^ ( P v ¬Q) : Law of double Negation ↔ [(P v Q) ^ P] v [(P v Q) ^ ¬Q] : Distribution Law ↔ [(P ^ P) v ( P ^ Q)] v [ (P ^ ¬Q) v (Q ^¬Q)] : Expanded terms ↔ [ P v (P ^ Q)] v [(P ^ ¬Q)] : Absorption Law ↔ P v (P ^ ¬Q) : Absorption Law ↔ P Therefore (P v Q) ^ (¬ (¬ P ^ Q )) ↔ P Discrete Mathematics: A Concept-based Approach
19
Example: Consider the expression [(P → Q) ^ (¬Q ^ (R v ¬Q)) ] and the reasons at each step in the simplifications of compound statement. [(P → Q) ^ (¬Q ^ (R v ¬Q)) ] ↔ (P → Q) ^ ¬Q Absorption Law ↔ (¬P v Q) ^ ¬Q Substitution for Implication ↔ ¬Q ^ (¬P v Q) Commutative Law ↔ (¬Q ^ ¬P) v (¬Q ^ Q) Distributive Law ↔ (¬Q ^ ¬P) v F Inverse Law ↔¬ (Q v P) DeMorgan’s Law Discrete Mathematics: A Concept-based Approach
20
RULE OF INFERENCE Modus Ponens
Consider the statement “If I wear a pink shirt then I will pass the examination. I have worn a pink shirt. Therefore, I pass the examination”. Let P be the statement “I wear a pink shirt”, Q be the statement “I will pass the examination”. The compound statement is put in symbolic form as [(P→Q) ^ P] → Q, where the premise is [(P→Q) ^Q] and conclusion is Q. (P→Q) and P Therefore Q Discrete Mathematics: A Concept-based Approach
21
Modus Tollens Consider the expression [(P→Q) ^ ¬Q] → ¬P is called Modus Tollens. The word Modus Tollens means a method of denying. Consider the statement “ If I wear a pink shirt(P) then I pass the examination(Q). I have not worn the pink shirt (¬Q). Therefore, I have not worn the pink shirt (¬ P)”. (P→Q) ¬Q Therefore ¬P Discrete Mathematics: A Concept-based Approach
22
Law of Syllogism Consider the expression ((P→Q) ^ (Q→R)) → (P→R), this is called the law of syllogism. Here P, Q and R are the individual statements. (P→Q) ( Q→R) Therefore (P→R) Discrete Mathematics: A Concept-based Approach
23
Example Consider the following statements and argument based on these statements. Kamala is preparing food (K). If Kamala is preparing food then Kamala is not going to school(¬S). If Kamala is not going to school then her father does not make her take examination(¬E). Therefore, Kamala’s father does not make her take examination. The above argument is put as the following expression. We can use the law of syllogism. (K ^ (K→¬S) ^ (¬S → ¬E)) → ¬E Discrete Mathematics: A Concept-based Approach
24
Continued The sub expression (K→¬S) ^ (¬S → ¬E) is logically equivalent to (K → ¬E ). The above expression reduces to (K ^ (K → ¬E )). Using Modus Ponens, it is logically equivalent to ¬E. The Modus Tollens, Modus Ponens and the law of syllogism are very useful in drawing inference. K (K→¬S) (¬S → ¬E) Therefore, ¬E Discrete Mathematics: A Concept-based Approach
25
Rule of simplification/ Inference
Simplification Rules Sl. No Rule of simplification/ Inference Remarks 1 [(P→Q) ^ P] → Q Modus Ponens or Rule of Detachment 2 [(P→Q) ^ ¬Q] → ¬P Modus Tollens 3 ((P→Q) ^ (Q→R)) → (P→R) Law of Syllogism or Chain Rule 4 ((P v Q) ^ ¬P) → Q Resolution Principle or Rule of Disjunctive Syllogism 5 (P ^ Q) → (P ^ Q) Rule of Conjunction 6 (¬P →F ) →P Rule of Contradiction 7 (P ^ Q ) →P. Rule of Conjunctive Simplification 8 P → (P v Q) Rule of Disjunctive Amplification 9 ((P → R) ^ (Q → R )) → (P v Q) → R Rule of Proof by Cases 10 ((P → Q) ^ (R → S ) ^ (¬Q v ¬S ) ) → (¬P v ¬R) Rule of Destructive Dilemma 11 ((P → Q) ^ (R → S ) ^ (P v R ) ) → (Q vS) Rule of Constructive Dilemma Discrete Mathematics: A Concept-based Approach
26
Predicate logic Consider the statement “ All Americans own a car. John is an American and hence he owns a car”. In symbolizing this sentence, the power of propositional logic becomes inadequate, as we need to use one propositional variable for each citizen of America. We need to use large number of variables. This is impractical. Consider another sentence, “ There exist one wise student in the class”. We need to quantify the words like All, There exist, Every, and Some, which are used in our day to day conversation. Discrete Mathematics: A Concept-based Approach
27
Predicate logic Consider another statement “ x+2 = 4”, whose truth value depends upon the value of x and x is a variable. Consider the statement “ John owns a car”, in which the sub string “owns a car” is called the predicate. Predicate resembles a function and returns either true or false. The statement is symbolized as under. Owns_car(John), Owns_car(x) In the above expression, owns_car is a predicate and John is a constant. The x is a variable, which is assigned the value John. Discrete Mathematics: A Concept-based Approach
28
Some more Examples Every rational number is a real number. For every x, Q(x) → R(x) where Q(x) – x is rational number and R(x) – x is real number. Some real numbers are rational. For some x, Q(x) ^ R(x) x is married to y. Married-to(x, y) or M(x, y) Human beings are mortal. For every x, H(x) → R(x) where H(x) – x is human being and R(x) – x is mortal. All the students are wise. For every y, W(y) There exists a good picnic place. For some x, G(x) x is less than y, L(x, y) Discrete Mathematics: A Concept-based Approach
29
Quantifiers The words All, There exist, Every, and Some quantify things in the world. In predicate logic we use symbols to represent these quantifiers represent universal and represent existential quantifiers respectively is read as “For all x” and “For every x” is read as “For some x” and “There exist x”. The statements (i) to (vii) are further rewritten as under. The quantifiers are said to be bounded by the variable. Q(x) → R(x) Q(x) ^ R(x) H(z) → T(z) W(x) G(x) L(x,y) Discrete Mathematics: A Concept-based Approach
30
Predicate Logic (i) (ii) The expression (i) means For all x there exists a y such that x is married to y. If x is a member from a set of male candidates and y belongs to a set of female candidates then the logical expression means that every male has a counterpart, which makes some sense. On the other hand, the expression(ii) means there is a female for all x such that x is married to y, which does not make any sense. Discrete Mathematics: A Concept-based Approach
31
Some Examples P(x,y) is read as “ for every integer x there exists an integer y such that x + y is equal to 10”. The statement makes a sense as once x is selected, the integer y corresponds to (10 – x). On the other hand, P(x, y) is read as “ there exists an integer y for every x such that x + y is equal to 10”. The state does not make sense and is considered false. This is because once an integer y is selected, the only value that x assumes is (10 – y). If we assume that the statement is true, it means that all x are same and equal to (10 – y). Discrete Mathematics: A Concept-based Approach
32
Negation of statements with quantifiers
Consider the expression W(y), where the predicate W(y) represents the statement “ y is wise in the class”. The expression is read as “everyone in the class is wise”. Consider the negation of the expression W(y). The expression is written as under. W(y) This is equivalent to reading as “not everyone is wise”. This means that “there exists one who is not wise”. i.e., W(y). Therefore, W(y) ↔ W(y). Similarly, consider the following expression. ↔ This is read as “ not there exists one who is wise”. All are unwise. Discrete Mathematics: A Concept-based Approach
33
Negation of Quantifiers
¬ W(y) ↔ ¬W(y) ¬ W(y) ↔ ¬W(y) ¬ [ ¬ W(y)] ↔ ¬ ¬ W(y) ↔ W(y) ¬[ ¬W(y) ] ↔ ¬ ¬ W(y) ↔ W(y) Discrete Mathematics: A Concept-based Approach
34
Proving the logical expressions
Consider the statement “ All Americans own a car. John is an American and therefore he owns a car”. Let A(x) : x is an American and C(x) : x owns a car be the predicates. Let A(J) and C(J) represent the predicates “ John is an American” and “John owns a car” respectively. The statement is symbolized as under: A(x) →C(x) A(J) C(J) The complete symbolic expression is (A(x) )→C(x) ^ A(J)) → C(J). Discrete Mathematics: A Concept-based Approach
35
Continued The validity of this statement can be made as given under. i) A(x) )→C(x) is a premise ii) A(J) is a premise A(J) → C(J) is obtained by the rule of universal specification. Therefore it is C(J) by Modus ponens Hence, the statement is true. Discrete Mathematics: A Concept-based Approach
36
Summary In this chapter, we have tried to give a fair insight of logic to the reader. The limitations of propositional logic and the advantages of first-order predicate logic in computer science are covered. The logic forms the backbone of any knowledge based system or in other words, any intelligent systems. There are other kinds of logic in practice, namely, modal logic, informal logic, temporal logic, philosophical logic and the like. The topic on logic is a foundation course for many fields in mathematics and also courses in computer science. Discrete Mathematics: A Concept-based Approach
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.