Lecture for Week 6 2012 Spring. Introduction to Propositional Logic Types of Proposition ...

33
Lecture for Week 6 Lecture for Week 6 2012 Spring 2012 Spring

Transcript of Lecture for Week 6 2012 Spring. Introduction to Propositional Logic Types of Proposition ...

Page 1: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Lecture for Week 6Lecture for Week 6

2012 Spring 2012 Spring

Page 2: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Introduction to Propositional Logic Types of Proposition Operator and Truth table

Agenda

Page 3: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Logic is the discipline which is concerned with reasoning. It provides rules and methods for determining the validity of a given argument. The argument itself is a sequence of statements, or propositions, one of which is the conclusion and the others, called premises, are intended to justify the conclusion. All English people are Europeans.George Boole was English.Therefore George Boole was a European.

This is an argument in which the two premises “all English people are European” and “George Boole was English” are intended to support the conclusion “George Boole was a European”.

Hence, logical reasoning concludes based on certain statements.The fundamental objects in logic are propositions.

Logic

Page 4: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

A proposition is a sentence which is either true or false but not both.True (T) or false (F) is called the truth value of the proposition.For example:

1. Kathmandu is a city.

2. Java is a programming language.

3. Paper is made of glass.

Proposition

Page 5: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Consider the following sentences: i)Everest is the highest mountain in the world. ii)The Thames is the longest river in the world. iii)A B = B A.iv)2 + 3 = 4.v)It will rain on the first day of the new millennium. vi)He is thirty years old.vii)1 + x = 7. viii)Newton contributed more to our understanding of science than Einstein did. ix)How old are you?x)Take the key with you.

Proposition

Page 6: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

The first four are clearly propositions. They evaluate without ambiguity to T, F, T, F respectively. We can accept v) as a proposition since eventually we will be able to assign a unique truth value to it. As it stands vi) is not a proposition since its truth value depends on who ‘he’ is. Taken in the context of a conversation amongst people who clearly understood the identity of ‘he’ it would be acceptable. The truth value of vii) depends on the value of x. It would be true if x = 6 but false it x = 2. Consequently, vii) is not proposition.

Proposition

Page 7: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Sentences for which the truth value is a matter of opinion (as in viii) are not acceptable as propositions. Questions and commands cannot be given a truth value and so ix) and x) are not propositions.

Sentences that are “Questions”, “Commands” and “Opinions” are not valid propositions because they will/may not have a true or false value.

Proposition

Page 8: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Examples:1. How old are you?2. Go to School.3. He is tall.

Some examples of valid propositions1. Kathmandu is the capital of Nepal.2. There are 8 days in a week.3. Isaac Newton was born in 1642.4. 5 is greater than 7.

Proposition

Page 9: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

In mathematics x, y, z, … denote numerical variables. They represent numbers (let x=3) and can be combined using addition, multiplication and division to form expressions and equations.

In logic we use lower case letters p, q, r, … to denote propositional variables, which represent propositions. 

For example: p: C++ is a high-level language means let p represent the proposition “C++ is a high-level language”.

Notation

Page 10: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

p: Kathmandu is in either Nepal or UK.

This proposition is made up of two simpler propositions.

This evaluates unambiguously to true and so is a proposition.

However it is made up of two ‘simpler’ propositions

q: Kathmandu is in Nepal.

r: Kathmandu is in UK.

Joined together by the word “or”

Primitive and compound propositions

Page 11: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

The propositions q and r cannot themselves be broken down into simpler ones. Such propositions are called primitive. Propositions like p which are combinations of two or more simpler ones are called compound, while the linking word ‘or’ is an example of what we will call a connective.

Primitive and compound propositions

Page 12: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Three operations on prepositions are:1.Conjunction/ AND2.Disjunction/OR and3.Negation/NOT/Complement

Operations on propositions

Page 13: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

When two simple statement are combined by the word “and” the compound statement so formed is called the conjunction of the original statement. Let p and q be given propositions. The proposition ‘p and q’ is called the conjunction of the given propositions. It is written p q and read “p and q”. p q is true if both proposition p is true and proposition q is true. Otherwise p q is false.

Conjunction/AND

Page 14: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Example.

p: Kathmandu is the capital of Nepal.

q: Delhi is the capital of India.

p and q: Kathmandu is the capital of Nepal and Delhi is the capital of India.

p ∧ q is called the conjunction of two propositions.

Conjunction/AND

Page 15: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

This is called the conjunction of the two propositions p, q. It is written p q and read as “p and q”.

 “and” is called a logical connective.

The word “and” which links the two propositions is called a logical connective.

Conjunction/AND

Page 16: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Conjunction/AND

The truth table for conjunction is

p q pq

T T T

T F F

F T F

F F F

Page 17: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Let p and q be given propositions. The proposition ‘p or q’ is called the disjunction of the given propositions. It is written p q and read “p or q”. If p q is true if either p is true or q is true or both p and q are true. Otherwise p q is false.

Disjunction/OR

Page 18: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Example

p: Kathmandu is the capital of Nepal.q: Delhi is the capital of China.p or q: Kathmandu is the capital of Nepal or Delhi is the capital of

China.p ∨ q is called the disjunction of the two propositions p and q.

It is written p q and read “p or q”.

In this case the connective linking the two propositions is “or”.

Disjunction/OR

Page 19: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

There is no difficulty with the truth value of p q.This evaluates to true since one of the propositions, p, is true. Similarly, for p r, q s and r s are all true as in each case, one and only one, of the individual propositions is true. Equally, since both q and r are false, so too is q r.

Disjunction/OR

Page 20: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

The truth table for disjunction is

Disjunction/OR

p q pq

T T T

T F T

F T T

F F F

Page 21: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Notes: i)The definition of p q uses the connective ‘or’ in the inclusive sense. That is,p q is true if either of the propositions p, q are true or both are.

 ii) An alternative equivalent definition of the disjunctive p q is : p q is false if both p is false and q is false. Otherwise p q is true.

Disjunction/OR

Page 22: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Let p be any proposition. 

The proposition ‘not p’ or ‘it is not true that p’ is called the negation of p. It is written ¬ p and read “not p”. ¬ p is true if p is false¬ p is false if p is true.

The Negation of a Proposition

Page 23: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

If p is any proposition we can form a new proposition called the negation of p, or not p, by writing “it is not true that” or “it is not the case that” (or something similar) in front of p. This new proposition is written ¬ p and read “not p”.Example: p : Stockholm is the capital of Sweden.The negation of the given statement is ¬ p : Stockholm is not the capital of Sweden.

The Negation of a Proposition

Page 24: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

The truth table for Negation is

The Negation of a Proposition

p p

T F

F T

Page 25: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

1. The propositions p, q, r and s have truth

values T, F, F and T respectively. Find the truth value for the following

1. p ¬ q 2. q ¬ r

3. ¬ s q4. ¬ p r 5. ¬ q ¬ r

Practice problem

Page 26: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

1. “and”, “or” and “¬” are referred to as connectives. 2. In formal logic, even if there is no relationship between the primitive propositions, it will make up a compound proposition.

Example: if p : 3 + 6 = 5 and q : Delhi is the capital of Nepal then

p ∧ q : 3 + 6 = 5 and Delhi is the capital of Nepalp V ¬ q : 3 + 6 = 5 or Delhi is not the capital of Nepalare both valid propositions.

They evaluate to “F” and “T” respectively.

Notes…

Page 27: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

What is the truth value of each of the following propositions?a)2 is even and 3 is even. b)2 is even or 3 is even. c)2 is even or 3 is odd. d)2 is not even or 3 is even. e)(1<0) ∨(2<1)f)(0<1) ∨(2<1)g)p ∧(false ∧q)

Practice problem..

Page 28: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

A compound proposition is an expression P(p, q, r, ...), which consists of propositional variables p, q, r, ... joined together by the logical connectives ∧, V and ¬.

The propositional variables p, q, ... are sometimes called the arguments of P.

Compound Propositions

Page 29: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

When there are more than one logical connectives, their operation can be determined by using braces.

For example:

(p ∨ q) ∧ r means first evaluate w = (p ∨ q) and then evaluate w ∧ r.

Compound Propositions

Page 30: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Example:p: Kathmandu is the capital of Nepal. T

q: Delhi is the capital of China. F

r: Tokyo is the capital of Pakistan. F

Then (p ∨ q) ∧ r is false but p ∨ (q ∧ r) is true.

Compound Propositions

Page 31: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

To minimize the number of brackets in expressions we will adopt the following order of precedence in which connectives are applied.

1. Apply connectives within brackets first.

2. The ¬ connective next.

3. “and” and “or”.

Using this convention ¬ p∧q will mean (¬ p) ∧ q rather than ¬ (p ∧ q)

Rules..

Page 32: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

Example 3 Suppose p : Stockholm is the capital of Sweden. Tq : London is the capital of France. Fr : Paris is the capital of England. F 

Then find the truth value of 1. w = p q and w r. 2. z = q r and p z.  

Thus find the truth value of (p q) r and p (q r).

Practice problem..

Page 33: Lecture for Week 6 2012 Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.

?Happy Sunday

Any Questions…