You are on page 1of 6

CS201: Discrete Mathematical Structures

Sem. 3: May-July 2011

Instructor: Narendra S. Chaudhari

Topic 1.1: Propositional Logic - I

A puzzle
If I am a student in School of Biological Sciences, I am not a student in School of Computer Science. I am student in School of Computer Science or I am not a student in School of Biological Sciences.

Propositional / Boolean Logic

Chrysippus of Soli (ca. 281 B.C. 205 B.C.)

George Boole (1815-1864)

Reading : Epp: 1.1, Grimaldi: 2.1, Rosen: 1.1

CS201: Discrete Mathematical Structures

Logic
Logic is a system based on propositions. A proposition is a (declarative) statement that is either true or false (not both). We say that the truth value of a proposition is either true (T) or false (F). Corresponds to 1 and 0 in digital circuits
Examples of non-statements: a. (Question): Why are you late? b. (Command): Open the door. c. (Wish): If only I had studied a little harder d. (Something Vague): (d-i) x + y = 4. (d-ii) x>y.
CS201: Discrete Mathematical Structures 3

The Statement/Proposition
Elephants are bigger than mice.

Is this a statement? Is this a proposition? What is the truth value of the proposition?

yes yes

true Or, 1

CS201: Discrete Mathematical Structures

The Statement/Proposition
520 < 111

The Statement/Proposition
Elephants are bigger than mice and ants are smaller than mice.

Is this a statement? Is this a proposition? What is the truth value of the proposition?

yes yes

Is this a statement? Is this a proposition? What is the truth value of the proposition?

yes yes

false

true Or, 1

CS201: Discrete Mathematical Structures

CS201: Discrete Mathematical Structures

Topic 1.1: Propositional Logic - Introduction

CS201: Discrete Mathematical Structures

Sem. 3: May-July 2011

Instructor: Narendra S. Chaudhari

The Statement/Proposition
Elephants are bigger than mice or ants are bigger than mice.

The Statement/Proposition
y > 5

Is this a statement? Is this a proposition? What is the truth value of the proposition?

yes yes

Is this a statement? Is this a proposition?

yes no

true Or, 1

Its truth value depends on the value of y, but this value is not specified. specified. We call this type of statement a predicate, or an open sentence or a predicate, propositional function. function.
7 CS201: Discrete Mathematical Structures 8

CS201: Discrete Mathematical Structures

The Statement/Proposition
Today is 27th July and 99 < 5.

The Statement/Proposition
Please do not fall asleep.

Is this a statement? Is this a proposition? What is the truth value of the proposition?

yes yes

Is this a statement? Its a request. It Is this a proposition?

no

no

false

Only statements can be propositions.

CS201: Discrete Mathematical Structures

CS201: Discrete Mathematical Structures

10

The Statement/Proposition
If the moon is made of cheese, then I will be rich.

The Statement/Proposition
x < y if and only if y > x.

Is this a statement? Is this a proposition? What is the truth value of the proposition?
*(we
CS201: Discrete Mathematical Structures

yes yes

Is this a statement? yes Is this a proposition? yes because its truth value does not depend on specific values of x and y. What is the truth value of the proposition?
11 CS201: Discrete Mathematical Structures

True*

shall see the justification based on vacuous truth of conditional later.) truth

true
12

Topic 1.1: Propositional Logic - Introduction

CS201: Discrete Mathematical Structures

Sem. 3: May-July 2011

Instructor: Narendra S. Chaudhari

Combining Propositions
As we have seen in the previous examples, one or more propositions can be combined to form a single compound proposition. We formalize this by denoting propositions with letters such as p, q, r, s, and introducing several logical operators or logical connectives.

Logical Operators (Connectives)


We will examine the following logical operators: Negation (NOT, ~ ; other notation ) (AND, ) (OR, )
(if then, ) (if and only if, )

Conjunction Disjunction Two more :


Conditional Biconditional

Truth tables are used to show how these operators can combine propositions to compound propositions.
13 CS201: Discrete Mathematical Structures 14

CS201: Discrete Mathematical Structures

Negation (NOT)
Unary Operator, Symbol: ~ (also ) p false (F) true (T) ~ p true (T) false (F)

Conjunction (AND)
Binary Operator, Symbol:
p F F T T q F T F T p q F F F T

CS201: Discrete Mathematical Structures

15

CS201: Discrete Mathematical Structures

16

Disjunction (OR)
Binary Operator, Symbol:
p F F T T q F T F T pq F T T T

Conditional (if - then)


Binary Operator, Symbol:
p F F T T q F T F T pq T T F T

CS201: Discrete Mathematical Structures

17

CS201: Discrete Mathematical Structures

18

Topic 1.1: Propositional Logic - Introduction

CS201: Discrete Mathematical Structures

Sem. 3: May-July 2011

Instructor: Narendra S. Chaudhari

Biconditional (if and only if)


Binary Operator, Symbol:
p F F T T q F T F T pq T F F T

Statements and Operators


Statements and operators can be combined in any way to form new statements.

p F F T T

q F T F T

~p T T F F

~q T F T F

(~p)(~ q) T T T F

CS201: Discrete Mathematical Structures

19

CS201: Discrete Mathematical Structures

20

Statements and Operations


Statements and operators can be combined in any way to form new statements.

Truth Table
Construct the truth table for p or q but not both p and q called p exclusive or q, abbreviated as p q, or p XOR q. pq

p F F T T

q F T F T

pq F F F T

~ (pq) T T T F

(~p)(~ q) T T T F

p q
F F T T F T F T

pq pq ~(pq)
F T T T F F F T T T T F

(pq)~(pq)
F T T F
22

CS201: Discrete Mathematical Structures

21

CS201: Discrete Mathematical Structures

Exercises
Express the following statements in their propositional logic form: It rains and your sister has not loaned you an umbrella. You help me in my homework, otherwise I play football. If you work hard, then you will do well in your studies.

Puzzle Revisited
If I am a student in School of Biological Sciences, I am not a student in School of Computer Science. I am student in School of Computer Science or I am not a student in School of Biological Sciences.
Let p = I am a student in School of Biological Sciences. Let q = I am a student in School of Computer Science. We model the given sentences as: (p ~q)(q ~p).

CS201: Discrete Mathematical Structures

23

CS201: Discrete Mathematical Structures

24

Topic 1.1: Propositional Logic - Introduction

CS201: Discrete Mathematical Structures

Sem. 3: May-July 2011

Instructor: Narendra S. Chaudhari

Equivalent Statements
p q ~ (pq) (~p)(~q)

Tautologies and Contradictions


~(pq) (~p)(~q) A tautology is a statement form that is always true. Examples:

F F T T

F T F T

T T T F

T T T F

T T T T

r (~r) ~(pq) (~p)(~q)


A contradiction is a statement form that is always false. Examples:

The statement forms ~ (pq) and (~p)(~q) are logically equivalent, since they have the same truth table, or,
the statement form ~ (pq) (~p)(~q) is always true, irrespective of whether its constituents (p, q) are true or false.
CS201: Discrete Mathematical Structures 25

r (~r) ~[~(pq)(~p)(~q)]
The negation of any tautology is a contradiction, and the negation of any contradiction is a tautology.

CS201: Discrete Mathematical Structures

26

Equivalence
Definition: two proposition forms S1 and S2 are said to be (logically) equivalent, denoted S1 S2 if
They have the same truth table, or S1 S2 is a tautology

Logical Equivalence
Q: Is ~(p q) equivalent to ~p ~q ? p T T F F q p q ~(p q) T T F F T F T T F F F T ~p ~q ~p ~q F F F F T T T F T T T T

Equivalence can be established by


Constructing truth tables Using equivalence laws

A: NO.
CS201: Discrete Mathematical Structures 27 CS201: Discrete Mathematical Structures 28

Logical Equivalence
De Morgans Law: ~(p q) ~p ~q ~(p q) ~p ~q p T T F F q p q ~(p q) T T F F F T T F T F F T ~p ~q ~p ~q F F F F T T T F T T T T
29

Logical Equivalence Laws


De Morgans laws

~ ( p q ) ~ p ~ q
~ ( p q ) ~ p ~ q

Commutative

pq q p
pq q p
CS201: Discrete Mathematical Structures 30

CS201: Discrete Mathematical Structures

Topic 1.1: Propositional Logic - Introduction

CS201: Discrete Mathematical Structures

Sem. 3: May-July 2011

Instructor: Narendra S. Chaudhari

Logical Equivalence Laws


Associative
( p q) r p (q r )
( p q ) r p (q r )

Logical Equivalence Laws


Identity (T is tautology, F is contradiction)
p T p

p F p

Domination
pT T
pF F

Distributive p (q r ) ( p q ) ( p r ) p (q r ) ( p q ) ( p r ) [Remember?
CS201: Discrete Mathematical Structures

Inverse
p ~ p F

p ~ p T

a(b+c)=ab+ac ]
31 CS201: Discrete Mathematical Structures 32

Logical Equivalence Laws


Double Negation

Exercises
Show that p q ~ p q by truth table. Show that (p q) (p r) p (q r) by equivalence laws (Use the result p q ~ p q, distributivity, and, other laws )

~ (~ p) p
Idempotent

p p p
Absorption
p ( p q) p

p p p
p ( p q) p

CS201: Discrete Mathematical Structures

33

CS201: Discrete Mathematical Structures

34

Puzzle Revisited .. 2
If I am a student in School of Biological Sciences, I am not a student in School of Computer Science. I am student in School of Computer Science or I am not a student in School of Biological Sciences.
Let p = I am a student in School of Biological Sciences. Let q = I am a student in School of Computer Science. We model the given sentences as: (p ~q)(q ~p). (p ~q)(q ~p) (~p ~q)(q ~p) (~p~q)(~p q)
CS201: Discrete Mathematical Structures 35

Summary
Proposition Truth value Truth table Operators and their truth tables Equivalence of propositional statements
Definition Proving equivalence (by truth table or equivalence laws)
CS201: Discrete Mathematical Structures 36

Topic 1.1: Propositional Logic - Introduction

You might also like