Sei sulla pagina 1di 53

LOGICAL

STRUCTURES
Discrete Mathematics 1

Discrete Mathematics
is the part of mathematics devoted to the
study of discrete objects
Discrete means consisting of distinct or
unconnected elements.

06/26/12

stat2b@yahoo.com

LOGIC
is the study of reasoning.
is specially concerned with whether
reasoning is correct
focuses on the relationship among
statements as opposed to the content of
any particular statement

06/26/12

stat2b@yahoo.com

PROPOSITION
A proposition is a declarative sentence
that is either true or false, but not both.
Example:

Manila

is the capital of the Philippines.


1 + 1 = 3.
2 < 5.
Today is Friday.

06/26/12

stat2b@yahoo.com

PROPOSITION

Consider the following sentences:


What

time is it?
Read this carefully.
x + 1 = 2.
x + y = z.

Sentences 1&2 are not propositions because


they are not declarative sentences. Sentences
3&4 are not propositions because they are
neither true nor false, since the variables in
these sentences have not been assigned values.

06/26/12

stat2b@yahoo.com

PROPOSITION
An atomic proposition is a proposition
whose truth or falsity is independent of
any other propositions.
A compound proposition is formed from
existing propositions using logical
operators.

06/26/12

stat2b@yahoo.com

PROPOSITION
Conventional letters used to denote
propositions are p, q, r, s,
The truth value of a proposition is true,
denoted by T, if it is true and false,
denoted by F, if it is a false proposition.

06/26/12

stat2b@yahoo.com

Propositional Logic
Operators

NEGATION
Let p be a proposition. The statement
It is not the case that p
is another proposition called the negation
of p.
The negation of p is denoted by p. The
proposition is read not p.

06/26/12

stat2b@yahoo.com

NEGATION

Example:
p: Today is Friday.
p: It is not the case that today is
Friday.
or
Today is not Friday.

06/26/12

stat2b@yahoo.com

10

NEGATION

Truth Table

06/26/12

stat2b@yahoo.com

11

Exercise
Give the negation of the following
propositions:
1. John

missed the final examinations.


2. Mary is a vegetarian.
3. 1 + 5 = 9.
4. 4 > 0.

06/26/12

stat2b@yahoo.com

12

CONJUNCTION

Let p and q be propositions. The


proposition p and q, denoted p q, is the
proposition that is true when both p and q
are true and is false otherwise. The
proposition p q is called the conjunction
of p and q.

06/26/12

stat2b@yahoo.com

13

CONJUNCTION

Example:
p: Today is Friday.
q: It is raining today.
p q: Today is Friday and it is raining
today.

06/26/12

stat2b@yahoo.com

14

CONJUNCTION

Truth Table:

06/26/12

pq

stat2b@yahoo.com

15

Exercise

Let p and q be the propositions


p: It is below freezing.
q: It is snowing.
Write these propositions using p and q and
logical connectives.
a.
b.
c.

06/26/12

It is below freezing and snowing.


It is below freezing but not snowing.
It is not below freezing and it is not snowing.

stat2b@yahoo.com

16

Exercise

Calculate the truth values:


a.
b.

(1>0) (2<1)
(0<1) (1<2)

Write out the truth tables for

06/26/12

p (q)
(p q) r

stat2b@yahoo.com

17

DISJUNCTION

Let p and q be propositions. The


proposition p or q, denoted p q, is the
proposition that is false when p and q are
both false and true otherwise. The
proposition p q is called the disjunction
of p and q.

06/26/12

stat2b@yahoo.com

18

DISJUNCTION

Example 1:
p: Today is Friday.
q: It is raining today.
p q: Today is Friday or it is raining today.
Example 2:
r: I want to eat chicken.
s: I want to eat spaghetti.
r s: I want to eat chicken or spaghetti.

06/26/12

stat2b@yahoo.com

19

DISJUNCTION

Truth Table:

06/26/12

pq

stat2b@yahoo.com

20

Exercise

Let p and q be the propositions


p: The election is decided.
q: The votes have been counted.
Express each of these compound
propositions as an English sentence:

06/26/12

p q
q (p q)
stat2b@yahoo.com

21

Exercise

Calculate the truth values (assuming p =


T, q = F, r = F)

b.

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

Write out the truth tables for


a.
b.

06/26/12

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

stat2b@yahoo.com

22

EXCLUSIVE OR

Let p and q be propositions. The exclusive


or of p and q, denoted by pq, is the
proposition that is true when exactly one
of p and q is true and false otherwise.

06/26/12

stat2b@yahoo.com

23

EXCLUSIVE OR

Example:
p: Students who have taken calculus
can enroll in this class.
q: Students who have taken computer
science can enroll in this class.
p q: Students who have taken
calculus or computer science,
but not both, can enroll in this class.

06/26/12

stat2b@yahoo.com

24

EXCLUSIVE OR

Truth Table:

06/26/12

pq

stat2b@yahoo.com

25

IMPLICATION

Let p and q be propositions. The


implication p q is the proposition that is
false when p is true and q is false, and
true otherwise. In this implication p is
called the hypothesis (or antecedent or
premise) and q is called the conclusion (or
consequent).

06/26/12

stat2b@yahoo.com

26

IMPLICATION

Example:
p: I am elected.
q: I will lower taxes.
p q: If I am elected, then I will
lower taxes.

06/26/12

stat2b@yahoo.com

27

IMPLICATION

Ways to express implication:


if p, then q p implies q
if p, q p only if q
q if p q whenever p
q when p
q is necessary for p
q follows from p
p is sufficient for q
a sufficient condition for q is p
a necessary condition for p is q

06/26/12

stat2b@yahoo.com

28

Exercise

State each statement in the form if p, then


q in English:
a.
b.
c.
d.
e.

06/26/12

It snows whenever the wind blows from the


northeast.
The apple trees will bloom if it stays warm for a
week.
It is necessary to walk 8 miles to get to the top
of Longs Peak.
To get tenure as a professor, it is sufficient to be
world-famous.
Your guarantee is good only if you bought your
CD player less than 90 days ago.
stat2b@yahoo.com

29

IMPLICATION

Truth Table:

06/26/12

pq

stat2b@yahoo.com

30

IMPLICATION

q p is called the converse of p q.

q p is called the contrapositive of


pq.

p q is called the inverse of pq

06/26/12

stat2b@yahoo.com

31

IMPLICATION

What is the contrapositive, converse, and


inverse of the ff. propositions
a.
b.
c.
d.

06/26/12

The home team wins whenever it is raining.


That you get a job implies that you had the best
credentials.
To be a citizen of this country, it is sufficient that
you were born in the Philippines.
I will remember to send you the address only if
you send me an e-mail message.

stat2b@yahoo.com

32

IMPLICATION
The contrapositive, q p, of an
implication p q has the same truth value
(or equivalent) as p q.
Neither the converse nor the inverse have
the same truth value as p q for all
possible truth values of p and q.

06/26/12

stat2b@yahoo.com

33

Exercise

Determine whether these implications


are true or false:
a.
b.
c.
d.

06/26/12

If 1+1=2, then 2+2=5.


If 1+1=3, then 2+2=4.
If pigs can fly, then 1+1=3.
If 1+1=3, then pigs can fly.

stat2b@yahoo.com

34

Exercise

Construct the truth table for each of


these compound propositions:
a.
b.

d.

06/26/12

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

stat2b@yahoo.com

35

BICONDITIONAL

Let p and q be propositions. The


biconditional p q is the proposition that
is true when p and q have the same truth
values, and is false otherwise.

06/26/12

stat2b@yahoo.com

36

BICONDITIONAL

Example:
p: You can take the flight.
q: You buy a ticket.
p q: You can take the flight if and
only if you buy a ticket.

06/26/12

stat2b@yahoo.com

37

BICONDITIONAL

Ways to express biconditional statement:


p if and only if q
p is necessary and sufficient for q
if p then q, and conversely
p if q

06/26/12

stat2b@yahoo.com

38

BICONDITIONAL

Truth Table:

06/26/12

pq

stat2b@yahoo.com

39

Exercise

Express each proposition in the form p if


and only if q in English.
a.

b.
c.

06/26/12

For you to get a 5.0 in this course, it is


necessary and sufficient that you learn how to
solve discrete mathematics problems.
It rains if it is a weekend day, and it is a
weekend day if it rains.
You can see the wizard only if the wizard is not
in, and the wizard is not in only if you can see
him.

stat2b@yahoo.com

40

Precedence of Logical Operators


Operator

Precedence

2
3

06/26/12

stat2b@yahoo.com

4
5

41

PROPOSITIONAL
EQUIVALENCES

Definitions
A compound proposition that is always
true, no matter what the truth values of the
propositions that occur in it, is called a
tautology.
A compound proposition that is always
false is called a contradiction.
A proposition that is neither a tautology
nor a contradiction is called a contingency.

06/26/12

stat2b@yahoo.com

43

Tautologies and Contradictions

Examples of Tautology and Contradiction:


p p and p p

06/26/12

p p

p p

T
F

F
T

T
T

F
F

stat2b@yahoo.com

44

LOGICAL EQUIVALENCES

The propositions p and q are called


logically equivalent if p q is a tautology.
The notation p q denotes that p and q
are logically equivalent.

06/26/12

stat2b@yahoo.com

45

LOGICAL EQUIVALENCES

Example: Show that (p q) and p q are


logically equivalent. (one of De Morgans
laws)
p q
T
T
F
F

06/26/12

T
F
T
F

p q (p q)
T
T
T
F

F
F
F
T
stat2b@yahoo.com

p q

F
F
T
T

F
T
F
T

F
F
F
T
46

Exercise

Show that p q and p q are logically


equivalent.

Show that p (q r) and (p q)(p r)


are logically equivalent.

06/26/12

stat2b@yahoo.com

47

Logical Equivalences
Equivalence
pTp
pFp
pTT
pFF
ppp
ppp
(p) p
06/26/12

Name
Identity laws
Domination laws
Idempotent laws
Double negation law

stat2b@yahoo.com

48

Logical Equivalences
Equivalence
pqqp
pqqp
(p q) r p (q r)
(p q) r p (q r)
p (q r) (p q) (p r)
p (q r) (p q) (p r)
(p q) p q
(p q) p q
06/26/12

stat2b@yahoo.com

Name
Commutative laws
Associative laws
Distributive laws
De Morgans laws
49

Logical Equivalences
Absorption laws

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

06/26/12

Negation laws

stat2b@yahoo.com

50

Logical Equivalences Involving


Implications

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

06/26/12

stat2b@yahoo.com

51

Logical Equivalences Involving


Biconditionals
p q (p q) (q p)
p q p q
p q (p q) (p q)
(p q) p q

06/26/12

stat2b@yahoo.com

52

Equational Reasoning
Show that (p q) (p q) is a tautology.
Show that (p (p q)) and p q are
logically equivalent.
Show that (p q) ( p q) is a
tautology.
Show that (p q) p and (q p) are
logically equivalent.

06/26/12

stat2b@yahoo.com

53

Potrebbero piacerti anche