23
PROPOSITIONAL LOGIC Prepared by : 1) Drishti Bhalla − 1838 2) Dimpy Chugh − 1831

Propositions - Discrete Structures

Embed Size (px)

Citation preview

Page 1: Propositions - Discrete Structures

PROPOSITIONAL

LOGICPrepared by : 1) Drishti Bhalla − 18382) Dimpy Chugh − 1831

Page 2: Propositions - Discrete Structures

A PROPOSITION is a statement which has truth value: it is either true (T) or false (F).Example 1Which of the following are propositions?(a)17 + 25 = 42(b) July 4 occurs in the winter in the Northern Hemisphere.(c) The population of the United States is less than 250 million.(d) Is the moon round?(e) 7 is greater than 12.(f) x is greater than y.Answers(b)is a proposition; and of course it has the 'truth value' true.(b) is a proposition. Of course, it's false, but it's still a proposition.(c) is a proposition, but we may not actually know whether

it's true or false. Nevertheless, the fact is that the statement itself is a proposition, because it is definitely either true or false.

(d) is not a proposition. It's a question.(e) is a proposition. It's false again, of course 7>12.(f) is a bit more debatable! It's certainly a potential proposition, but

until we know the values of x and y, we can't actually say whether it is true or false. Note that this isn't quite the same as (c), where we may not know the truth value because we aren't well-enough informed.

Page 3: Propositions - Discrete Structures

RULES OF INFERENCE FOR PROPOSITIONAL

LOGIC

Page 4: Propositions - Discrete Structures

Modus PonensExample:Let p be “It is snowing.”Let q be “I will study discrete math.”“If it is snowing, then I will study discrete math.”“It is snowing.”“Therefore , I will study discrete math.”

Corresponding Tautology: (p ∧ (p →q)) → q

Modus TollensExample:Let p be “it is snowing.”Let q be “I will study discrete math.”“If it is snowing, then I will study discrete math.”“I will not study discrete math.”“Therefore , it is not snowing.”

Corresponding Tautology: (¬p∧(p →q))→¬q

Page 5: Propositions - Discrete Structures

Hypothetical SyllogismExample:Let p be “it snows.”Let q be “I will study discrete math.”Let r be “I will get an A.”“If it snows, then I will study

discrete math.”“If I study discrete math, I will get

an A.”“Therefore , If it snows, I will get an

A.” Disjunctive SyllogismExample:Let p be “I will study discrete

math.”Let q be “I will study English

literature.”“I will study discrete math or I will

study English literature.”“I will not study discrete math.”“Therefore , I will study English

literature.”

Corresponding Tautology:((p →q) ∧ (q→r))→(p→ r)

Corresponding Tautology:(¬p∧(p ∨q))→q

Page 6: Propositions - Discrete Structures

AdditionExample:Let p be “I will study discrete math.”Let q be “I will visit Las Vegas.”“I will study discrete math.”“Therefore, I will study discrete

math or I will visit Las Vegas.”

SimplificationExample:Let p be “I will study discrete math.”Let q be “I will study English

literature.”“I will study discrete math and

English literature”“Therefore, I will study discrete

math.”

Corresponding Tautology: (p∧q) →p

Corresponding Tautology: p →(p ∨q)

Page 7: Propositions - Discrete Structures

ResolutionExample:Let p be “I will study discrete math.”Let r be “I will study English

literature.”Let q be “I will study databases.”“I will not study discrete math or I will

study English literature.”“I will study discrete math or I will

study databases.”“Therefore, I will study databases or I

will English literature.”

Corresponding Tautology:((¬p ∨ r ) ∧ (p ∨ q)) →(q ∨

r)

Page 8: Propositions - Discrete Structures

SOLVING PUZZLES USING PROPOSITIONAL

LOGIC

Page 9: Propositions - Discrete Structures

A detective has interviewed for witnesses to a crime: the butler, the cook, the gardener, and the handyman. From their stories the detective has concluded that:•If the butler is telling the truth, then so is the cook.•The cook and the gardener cannot both be telling the truth.•The gardener and the handyman are not both lying•If the handyman is telling the truth, then the cook is lying.For each of the four witnesses, can the detective determine who person is telling a lying?

SOL: •If the butler is telling the truth, then by (a) the cook is telling the truth.•If the cook is telling the truth, then by (b) the gardener is lying.•If the gardener is lying, then by (c) the handyman is telling the truth.•If the handyman is telling the truth, they by (d) the cook is lying.This leads to a contradiction (the cook can not be both telling the truth and lying)! Therefore the butler and cook must be lying.

But this can also be solved by using the rules of inference

Page 10: Propositions - Discrete Structures

Let B be ‘the butler is telling the truth’, C be ‘the cook is telling the truth’, G be ‘the gardener is telling the truth’, H be ‘the handyman is telling the truth’The given premises are:(1) B C(2) ~ (C G) = ~C V ~G(3) ~ (~G ~H) = G V H(4) H ~CAssume that C is true.(5) CFrom (5) and (2) by Disjunctive Syllogism we conclude(6) ~GFrom (6) and (3) by Disjunctive Syllogism we conclude(7) HFrom (7) and (4) by Modus Ponens we conclude(8) ~CThis conclusion contradicts the assumption that C is true, therefore C is false, i.e. ~C is true.Therefore, we can conclude that the cook is lyingNext, we use ~C in conjunction with the given premises to derive new conclusions.(9) ~CFrom (9) and (1) by Modus Tollens we conclude(10) ~BTherefore the butler is lying

Page 11: Propositions - Discrete Structures

Smullyan posed many puzzles about an island that has two kinds of inhabitants,knights, who always tell the truth, and their opposites, knaves, who always lie. You encounter two people A and B. What are A and B if A says “B is a knight” and B says “The two of us are opposite types”?SOL: Let p and q be the statements that A is a knight and B is a knight, respectively, so that ¬ p and ¬ q are the statements that A is a knave and B is a knave, respectively.Case 1: A is a knight this is the statement that p is true. If A is a knight, then he is telling the truth when he says that B is a knight, so that q is true, and A and B are the same type. However, if B is a knight, then B’s statement that A and B are of opposite types, the statement (p ∧¬ q) ∨ (¬ p ∧ q), would have to be true, which it is not, because A and B are both knights. Consequently, we can conclude that A is not a knight, that is, that p is false.Case 2: A is a knave Then because everything a knave says is false, A’s statement that B is a knight, that is, that q is true, is a lie. This means that q is false and B is also a knave.Furthermore, if B is a knave, then B’s statement that A and B are opposite types is a lie, which is consistent with both A and B being knaves. We can conclude that both A and B are knaves.

Page 12: Propositions - Discrete Structures

FUZZY LOGICAPPLICATION OF PROPOSITIONS

Page 13: Propositions - Discrete Structures

A fuzzy logic proposition, P , is a statement involving some concept without clearly defined boundaries .

Fuzzy logic is a form of many-valued logic ; it deals with reasoning that is approximate rather than fixed and exact. Fuzzy logic variables may have a truth value that ranges in degree between 0 and 1 rather than usual true(1) or false(0).

Main difference between classical propositions and fuzzy propositions: – The range of their truth values : [0, 1] .bool speed;

get the speed if ( speed == 0) {

// speed is slow} else {

// speed is fast}

float speed; get the speed if ((speed >= 0.0)&&(speed < 0.25)) {

// speed is slowest} else if ((speed >= 0.25)&&(speed < 0.5)) {

// speed is slow}else if ((speed >= 0.5)&&(speed < 0.75)) {

// speed is fast}else // speed >= 0.75 && speed < 1.0 {

// speed is fastest}

Page 14: Propositions - Discrete Structures

Suppose we wish to divide height into three classes : short , average and tall .A Boolean representation would look something like this :

A fuzzy representation on the other hand would look something like this :

Page 15: Propositions - Discrete Structures

Suppose height is 182cm . Find the value on horizontal axis and see where it intersects the membership functions for the three variables .

182cm is outside the range of “SHORT” , so short->0. It intersects average at 0.4 and tall at 0.08 .

Page 16: Propositions - Discrete Structures

BASIC RULES OR : MAX(A,B)

AND : MIN(A,B)NOT : ¬A=1-A

Page 17: Propositions - Discrete Structures

Let Height=165 and Weight=100.Consider “ Height is short or Weight is heavy ”.

Page 18: Propositions - Discrete Structures
Page 19: Propositions - Discrete Structures

Suppose we want to design A risk-assessment system for some form of project . We wish to determine the risk depending on project funding and staffing. 1. The first step is to design fuzzy variables , which are funding ,

staffing, and risk .For each of these variables, we define the membership functions :

Page 20: Propositions - Discrete Structures

The next step is to define the rules for the system , using these variables. For instance , we have :1. If funding is adequate or staffing is small , then risk is low.2. If funding is marginal and staffing is large then risk is normal.3. If funding is inadequate then risk is high.

Suppose we have a funding of f0 and a staffing of s0 people. What would the risk r0 be ?

Page 21: Propositions - Discrete Structures

We have mapped the ‘crisp’ (i.e. raw values ) f0 and s0 to the membership functions and found (for instance) that f0 has a 0.5 membership degree of “inadequate” and a 0.2 membership degree of “marginal”. The same way s0 has a 0.1 membership degree of “small” and a 0.7 membership degree of “large”.

The next step is to evaluate the basic rules we defined :

Page 22: Propositions - Discrete Structures

Now we need to aggregate the results to a single output area :

The output area is then defuzzified to get a crisp output r0. A common solution is to take the center of mass of the result output area .

Page 23: Propositions - Discrete Structures

THANK YOU !!!