0% found this document useful (0 votes)
104 views128 pages

02 Propositional Logic Equiv PDF

Here is the truth table for the conjunction p ∧ q: p q p ∧ q T T T T F F F T F F F F

Uploaded by

Nguyen Vo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views128 pages

02 Propositional Logic Equiv PDF

Here is the truth table for the conjunction p ∧ q: p q p ∧ q T T T T F F F T F F F F

Uploaded by

Nguyen Vo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 128

Propositional

Logic
CS A262: Discrete Structures
Propositions and Logical
Operations

2
Logic

▶ Logic gives precise meaning to mathematical


statements.

▶ Logic has numerous applications in Computer Science


▶ To design computer circuits
▶ To create computer applications
▶ To verify the correctness of these applications
▶ and more…

3
Propositional Logic

▶ A proposition is a statement that is either true (T) or


false (F), but not both.

▶ Example:
1 + 2 = 3 (T)
2 + 4 = 5 (F)

4
Propositions
▶ A fact-based declaration is a proposition.
▶ It does not matter if we know whether it is true or false.

▶ Examples:
2143 is a prime number.
Ouagadougou is the capital of Burkina Faso.
Louis XIII of France started the trend for men to wear wigs.

5
Propositions (cont.)

▶ Since a proposition must be either true or false, any


statement that is not declarative cannot be a
proposition
▶ Therefore, commands and questions are excluded.

▶ Examples:
▶ Read this carefully. (not a proposition)
▶ What time is it? (not a proposition)

6
Propositions (cont.)

▶ Declarations that include non-constant values cannot


be propositions, because there are multiple possibilities

▶ Example:
x+3=5
We don’t know what x is.
This statement is neither true or false.

7
Propositional Variables

▶ We use letters to denote statements that represent


variables
▶ Conventional letters used are:

p, q, r, s…

▶ Propositional variables are also called


statement variables.

8
Negation

▶  

9
Negation (cont.)

▶ What is the negation of the following proposition?


“Today is Friday.”

10
Negation (cont.)

▶ What is the negation of the following proposition?


“Today is Friday.”

▶ Solution:
“It is not the case that today is Friday.”
“Today is not Friday.”
“It is not Friday today.”

11
Negation (cont.)

▶ What is the negation of the following proposition?


“At least 2 inches of snow fell today.”

12
Negation (cont.)

▶ What is the negation of the following proposition?


“At least 2 inches of snow fell today.”

▶ Solution:
“It is not the case that at least 2 inches of snow fell today.”

“Less than 2 inches of snow fell today.”

13
Conjunction

▶ Given two statements p and q, the conjunction p ∧ q


is
▶ TRUE when both p and q are TRUE
▶ FALSE otherwise

▶ Other symbols for AND (∧)



& (used in some computer languages)

14
Conjunction (cont.)

▶ What is the conjunction of the following propositions?


“Today is Friday.”
“It is raining today.”

15
Conjunction (cont.)

▶ What is the conjunction of the following propositions?


“Today is Friday.”
“It is raining today.”

▶ Solution:
“Today is Friday, and it is raining today.”

16
Conjunction (cont.)

▶ What is the conjunction of the following propositions?


“Today is Friday.”
“It is raining today.”
This proposition is TRUE on rainy Fridays.
▶ Solution:
It is FALSE on any day that is not a Friday,
and on Fridays when it is not raining.
“Today is Friday and it is raining today.”

17
Disjunction

▶ Given two statements p and q, the disjunction p ∨ q is

▶ FALSE when both p and q are FALSE


▶ TRUE otherwise

▶ Other symbols for OR (∨)


+
| (used in some computer languages)

18
Disjunction (cont.)

▶ What is the disjunction of the following propositions?


“Today is Friday.”
“It is raining today.”

19
Disjunction (cont.)

▶ What is the disjunction of the following propositions?


“Today is Friday.”
“It is raining today.”

▶ Solution:
“Today is Friday or it is raining today.”

20
Disjunction (cont.)

▶ What is the disjunction of the following propositions?


“Today is Friday.”
“It is raining today.”

▶ Solution:
“Today is This proposition is TRUE on any day that
Friday or it is is either Friday or a rainy day (including
raining today.” rainy Fridays).
It is only FALSE on days that are not
Fridays when it also does not rain.
21
Exclusive OR

▶ Given two statements p and q, the


exclusive OR, denoted by p ⊕ q is
▶ TRUE when exactly one of p and q is TRUE
▶ FALSE otherwise

▶ Other symbols for XOR (⊕)


^ (used in some computer languages)

22
Lecture Problems
You meet three inhabitants, A, B, and C, of Smullyan’s
Island. Using p to represent “A is truthful”, q to
represent the statement “B is truthful”, and r to
represent the statement “C is truthful”, how would
you write the following phrase?

A and B are lying

a) p ∧ q
b) ~p ∧ q
c) ~p ∨ ~q
d) ~p ∧ ~q

23
Lecture Problems
You meet three inhabitants, A, B, and C, of Smullyan’s
Island. Using p to represent “A is truthful”, q to
represent the statement “B is truthful”, and r to
represent the statement “C is truthful”, how would
you write the following phrase?

A and B are lying

d) ~p ∧ ~q

24
Lecture Problems
You meet three inhabitants, A, B, and C, of Smullyan’s
Island. Using p to represent “A is truthful”, q to
represent the statement “B is truthful”, and r to
represent the statement “C is truthful”, how would
you write the following phrase?

All three are lying

a) p ∧ q ∧ r
b) ~p ∧ ~q ∧ ~r
c) ~q ∧ ~r
d) ~p ∨ ~q ∨ ~r

25
Lecture Problems
You meet three inhabitants, A, B, and C, of Smullyan’s
Island. Using p to represent “A is truthful”, q to
represent the statement “B is truthful”, and r to
represent the statement “C is truthful”, how would
you write the following phrase?

All three are lying

b) ~p ∧ ~q ∧ ~r

26
Lecture Problems
You meet three inhabitants, A, B, and C, of Smullyan’s
Island. Using p to represent “A is truthful”, q to
represent the statement “B is truthful”, and r to
represent the statement “C is truthful”, how would
you write the following phrase?

Exactly one of B or C is truthful

a) q ⊕ r
b) ~q ∧ r
c) q ∨ r
d) q ⊕ ~q

27
Lecture Problems
You meet three inhabitants, A, B, and C, of Smullyan’s
Island. Using p to represent “A is truthful”, q to
represent the statement “B is truthful”, and r to
represent the statement “C is truthful”, how would
you write the following phrase?

Exactly one of B and C is truthful

a) q ⊕ r

28
Truth Tables

29
Truth Tables

▶ A truth table is a diagram that shows whether a


proposition is TRUE or FALSE.

▶ Example:
▶ Write the truth table for the conjunction p ∧ q

30
Truth Tables

▶ A truth table is a diagram that shows whether a


proposition is TRUE or FALSE.

▶ Example:
▶ Write the truth table for the conjunction p ∧ q
▶ The two variable are p and q

31
Truth Tables

▶ A truth table is a diagram that shows whether a


proposition is TRUE or FALSE.

▶ Example:
▶ Write the truth table for the conjunction p ∧ q
▶ The two variable are p and q
▶ How many possibilities are there?

32
Truth Tables

▶ A truth table is a diagram that shows whether a


proposition is TRUE or FALSE.

▶ Example:
▶ Write the truth table for the conjunction p ∧ q
▶ The two variable are p and q
▶ How many possibilities are there?
▶ p is TRUE, q is TRUE
▶ p is TRUE, q is FALSE
▶ p is FALSE, q is TRUE
▶ p is FALSE, q is FALSE

33
Truth Tables

▶ A truth table is a diagram that shows whether a


proposition is TRUE or FALSE.

▶ Example:
▶ Write the truth table for the conjunction p ∧ q
▶ The two variable are p and q
▶ How many possibilities are there? p q p∧q
▶ p is TRUE, q is TRUE T T
▶ p is TRUE, q is FALSE
T F
▶ p is FALSE, q is TRUE Set up the truth table
▶ p is FALSE, q is FALSE → F T

F F
34
Truth Tables

▶ A truth table is a diagram that shows whether a proposition is TRUE or


FALSE.

▶ Example:
▶ Write the truth table for the conjunction p ∧ q
▶ The two variable are p and q
▶ How many possibilities are there? p q p∧q
▶ p is TRUE, q is TRUE T T T
▶ p is TRUE, q is FALSE
▶ p is FALSE, q is TRUE
Add the resulting values →T F F

F T F
▶ p is FALSE, q is FALSE
F F F
35
Truth Tables

▶ A truth table is a diagram that shows whether a


proposition is TRUE or FALSE.

p ~p p q p∧q p q p∨q p q p⊕q


T T T T T T T
F T F T F T F

F T F T F T

F F F F F F

Make sure you consider all


possibilities... 36
Truth Tables (cont.)

▶ A truth table is a diagram that shows whether a


proposition is TRUE or FALSE.

p ~p p q p∧q p q p∨q p q p⊕q


T F T T T T T T T T F
F T T F F T F T T F T

F T F F T T F T T

F F F F F F F F F

… And logically produce the results.


37
Example

▶Construct the truth table for the compound statement


(p ∨ q) ∧ ~(p ∧ q)

38
Example (cont.)

▶Construct the truth table for the compound statement

(p ∨ q) ∧ ~(p ∧ q) How many variables


do you have?

Two ➔ p, q

39
Example (cont.)

▶Construct the truth table for the compound statement


(p ∨ q) ∧ ~(p ∧
q) How many variables
p q do you have?
T T
Two ➔ p, q
T F
F T Build the table with
all possibilities.
F F

40
Example (cont.)

▶Construct the truth table for the compound statement


(p ∨ q) ∧ ~(p ∧ q)
What is your first
p q statement?
T T
T F
F T
F F

41
Example (cont.)

▶Construct the truth table for the compound statement


(p ∨ q) ∧ ~(p ∧ q)
What is your first
p q (p ∨ q) statement?
T T
(p ∨ q)
T F
F T
F F

42
Example (cont.)

▶Construct the truth table for the compound statement


(p ∨ q) ∧ ~(p ∧ q)
Add the results.
p q (p ∨ q)
T T T
T F T
F T T
F F F

43
Example (cont.)

▶Construct the truth table for the compound statement


(p ∨ q) ∧ ~(p ∧
What is your next
q)
p q (p ∨ q) statement?
T T T
T F T
F T T
F F F

44
Example (cont.)

▶Construct the truth table for the compound statement


(p ∨ q) ∧ ~(p ∧
q)

p q (p ∨ q) (p ∧ q) What is your next


statement?
T T T
T F T (p ∧ q)
F T T
F F F

45
Example (cont.)

▶Construct the truth table for the compound statement

(p ∨ q) ∧ ~(p ∧ q)

Add the results.


p q (p ∨ q) (p ∧ q)
T T T T
T F T F
F T T F
F F F F

46
Example (cont.)

▶Construct the truth table for the compound statement

(p ∨ q) ∧ ~(p ∧
q)
Negate the last
~(p ∧ statement.
p q (p ∨ q) (p ∧ q)
q)
T T T T ~(p ∧ q)
T F T F
F T T F
F F F F

47
Example (cont.)

▶Construct the truth table for the compound statement


(p ∨ q) ∧ ~(p ∧ q)

Negate the last


statement.
~(p ∧
p q (p ∨ q) (p ∧ q)
q) ~(p ∧ q)
T T T T F
T F T F T
F T T F T
F F F F T

48
Example (cont.)

▶Construct the truth table for the compound statement

(p ∨ q) ∧ ~(p ∧ q)
Combine.

~(p ∧
p q (p ∨ q) (p ∧ q) (p ∨ q) ∧ ~(p ∧ q)
q)
T T T T F
T F T F T
F T T F T
F F F F T

49
Example (cont.)

▶Construct the truth table for the compound statement


(p ∨ q) ∧ ~(p ∧ q)
Combine.

~(p ∧
p q (p ∨ q) (p ∧ q) (p ∨ q) ∧ ~(p ∧ q)
q)
T T T T F F
T F T F T T
F T T F T T
F F F F T F

50
Lecture Problems
Which of the following columns correctly shows
~p ∨ q?
p q A B C D

F F F T T F

F T T F T F

T F T T F F

T T T T T T

51
Lecture Problems
Which of the following columns correctly shows
~p ∨ q?

p q A B C D

F F F T T F

F T T F T F

T F T T F F

T T T T T T
52
Conditional Statements

53
Conditional Statement

▶ Given two statements p and q, the conditional


statement “if p, then q,” denoted by p → q is
▶ FALSE when p is TRUE and q is FALSE

▶ TRUE otherwise

p q p→q

T T T

T F F

F T T

F F T
54
Conditional Statement (cont.)

▶ A conditional statement is also called implication.


▶ There are many ways to express a conditional
statement:
▶ If Bob learns programming, then he will find a good job.
▶ Bob will find a good job when he learns programming.
▶ For Bob to get a new job, it is sufficient for him to learn
programming.
▶ Bob will not find a good job unless he does not learn
programming.

55
Lecture Problems
Consider the statement
If you are drinking beer, then you are at least 21
years old.

You are obeying the law if the previous


statement is true.

Suppose Dan is 25 years old and is drinking beer.


Is Dan obeying the law?

a) Yes
b) No
56
Lecture Problems
Consider the statement
If you are drinking beer, then you are at least 21
years old.

You are obeying the law if the previous


statement is true.

Suppose Dan is 25 years old and is drinking beer.


Is Dan obeying the law?

a) Yes

57
Lecture Problems
Consider the statement
If you are drinking beer, then you are at least 21
years old.

You are obeying the law if the previous


statement is true.

Suppose Betty is 18 years old and is drinking


orange juice. Is Betty obeying the law?

a) Yes
b) No
58
Lecture Problems
Consider the statement
If you are drinking beer, then you are at least 21
years old.

You are obeying the law if the previous


statement is true.

Suppose Betty is 18 years old and is drinking


orange juice. Is Betty obeying the law?

a) Yes

59
Lecture Problems
Consider the statement
If you are drinking beer, then you are at least 21
years old.

You are obeying the law if the previous


statement is true.

Suppose Bin is 19 years old and is drinking beer.


Is Bin obeying the law?

a) Yes
b) No
60
Lecture Problems
Consider the statement
If you are drinking beer, then you are at least 21
years old.

You are obeying the law if the previous


statement is true.

Suppose Bin is 19 years old and is drinking beer.


Is Bin obeying the law?

b) No
61
Conditional Statements
(cont.)
▶ Given p → q, we have three related conditional
statements:
Converse q→p

Contrapositive ~q → ~p
Inverse ~p → ~q

62
Conditional Statements
(cont.)
▶ What are the contrapositive, the converse, and the
inverse of the conditional statement below?
“I close the windows whenever it is raining.”

63
Conditional Statements
(cont.)
▶ What are the contrapositive, the converse, and the
inverse of the conditional statement below?
“I close the windows whenever it is raining.”

▶ Solution:
Let’s start by translating it to a conditional statement
“If it is raining, then I close the windows.”

64
Conditional Statements
(cont.)
▶ Once we have the conditional statement
“If it is raining, then I close the windows.”
We can find the
▶ Converse
“If I close the windows, then it is raining.”
▶ Contrapositive
“If I don’t close the windows, then it is not raining.”
▶ Inverse
“If it is not raining, then I do not close the windows.”

65
Lecture Problems
Consider the statement

If you don’t attend the concert, then you will get an F for
the course.

Let p represent “You attend the concert”


Let q represent “You will get an F for the course”

Which of the following statements symbolize the English


statement?

a. p→q
b. ~p → ~q
c. ~p → q
66
d. ~p ∧ q
Lecture Problems
Consider the statement

If you don’t attend the concert, then you will get an F for
the course.

Let p represent “You attend the concert”


Let q represent “You will get an F for the course”

Which of the following statements symbolize the English


statement?

c) ~p → q
67
Lecture Problems
Consider the statement

If you don’t attend the concert, then you will get an F for
the course.

Which of the following statements is the converse of the


statement above?

a. If you will get an F for the course, then you do not


attend the concert.
b. If you don’t attend the concert, you will get an F for
the course.
c. If you will not get an F for the course, then you do
attend the concert.
d. If you attend the concert, you won’t get an F for the
68

course.
Lecture Problems
Consider the statement

If you don’t attend the concert, then you will get an F for
the course.

Which of the following statements is the converse of the


statement above?

a) If you will get an F for the course, then you do not


attend the concert.

69
Lecture Problems
Consider the statement

If you don’t attend the concert, then you will get an F for
the course.

Which of the following statements is the contrapositive of


the statement above?

a. If you will get an F for the course, then you do not


attend the concert.
b. If you don’t attend the concert, you will get an F for
the course.
c. If you will not get an F for the course, then you do
attend the concert.
d. If you attend the concert, you won’t get an F for the
70

course.
Lecture Problems
Consider the statement

If you don’t attend the concert, then you will get an F for
the course.

Which of the following statements is the contrapositive of


the statement above?

c) If you will not get an F for the course, then you do


attend the concert.

71
Lecture Problems
Consider the statement

If you don’t attend the concert, then you will get an F for
the course.

Which of the following statements is the inverse of the


statement above?

a. If you will get an F for the course, then you do not


attend the concert.
b. If you don’t attend the concert, you will get an F for
the course.
c. If you will not get an F for the course, then you do
attend the concert.
d. If you attend the concert, you won’t get an F for the
72

course.
Lecture Problems
Consider the statement

If you don’t attend the concert, then you will get an F for
the course.

Which of the following statements is the inverse of the


statement above?

d) If you attend the concert, you won’t get an F for the


course. 73
Biconditional Statements

▶ Given two statements p and q, the


biconditional statement “p if and only if q,”
denoted by p ⟷ q is
▶ TRUE when p and q have the same truth

values
p q p⟷q
▶ FALSE otherwise
T T T

▶ Means that p → q AND q →p T F F

F T F

F F74 T
Biconditional Statements (cont.)

▶ A biconditional statement is also called


bi-implication.
▶ There are other common ways to express a
biconditional statement:
▶ p is necessary and sufficient for q

▶ if p then q, and conversely

▶ p iff q (iff is the abbreviation for “if and only if”)

75
Biconditional Statements (cont.)
▶ Given the statement:
You can go to the concert if and only if you buy a
ticket.
▶ TRUE:
▶ You buy a ticket and can go to the concert
▶ You don’t buy the ticket and you cannot go to the
concert (because they will not let you in).
▶ FALSE:
▶ You do not buy a ticket and you can go to the
concert.
▶ You buy the ticket, and you cannot go to the concert
(because they will not let you in).
76
A Note about Biconditionals

▶ Biconditionals are not always explicit in natural


language. They are often expressed using “if,
then” instead of “if and only if.”

▶ Example:
▶ English:
▶ “If you finish your homework, then you can
go out and play.”
▶ This implicitly means:
▶ “You can go out and play if and only if you
finish your homework.”
77
Operator Precedence

Example:
p∧r→q

will be evaluated

(p ∧ r) → q

78
Lecture Problems
When planning a party you want to know whom to invite. Among the
people you would like to invite are three touchy friends. You know
that if Jasmine attends, she will become unhappy if Samir is there,
Samir will attend only if Kanti will be there, and Kanti and Jasmine
will only attend together. Let J and S stand for the statements
“Jasmine will attend” and “Samir will attend”, respectively.

Which expression evaluates to true if Jasmine is happy?

a) J -> ~S
b) ~J -> ~S
c) S -> J
d) ~S -> J
e) J <--> S

79
Lecture Problems
When planning a party you want to know whom to invite. Among the
people you would like to invite are three touchy friends. You know
that if Jasmine attends, she will become unhappy if Samir is there,
Samir will attend only if Kanti will be there, and Kanti and Jasmine
will only attend together. Let J and S stand for the statements
“Jasmine will attend” and “Samir will attend”, respectively.

Which expression evaluates to true if Jasmine is happy?

a) J -> ~S

80
Lecture Problems
When planning a party you want to know whom to invite. Among the
people you would like to invite are three touchy friends.You know
that if Jasmine attends, she will become unhappy if Samir is there,
Samir will attend only if Kanti will be there, and Kanti and Jasmine
will only attend together. Let S and K stand for the statements
“Samir will attend” and “Kanti will attend”, respectively.

Which expression evaluates to true if Samir is satisfied?

a) K -> ~S
b) ~K -> ~S
c) S -> K
d) ~S -> K
e) S <--> K

81
Lecture Problems
When planning a party you want to know whom to invite. Among the
people you would like to invite are three touchy friends.You know
that if Jasmine attends, she will become unhappy if Samir is there,
Samir will attend only if Kanti will be there, and Kanti and Jasmine
will only attend together. Let S and K stand for the statements
“Samir will attend” and “Kanti will attend”, respectively.

Which expression evaluates to true if Samir is satisfied?

c) S -> K

82
Lecture Problems
When planning a party you want to know whom to invite. Among the
people you would like to invite are three touchy friends.You know
that if Jasmine attends, she will become unhappy if Samir is there,
Samir will attend only if Kanti will be there, and Kanti and Jasmine
will only attend together. Let J and K stand for the statements
“Jasmine will attend” and “Kanti will attend”, respectively.

Which expression evaluates to true if Kanti and Jasmine are


satisfied?

a) J -> ~K
b) ~J -> ~K
c) K -> J
d) ~K -> J
e) K <--> J

83
Lecture Problems
When planning a party you want to know whom to invite. Among the
people you would like to invite are three touchy friends.You know
that if Jasmine attends, she will become unhappy if Samir is there,
Samir will attend only if Kanti will be there, and Kanti and Jasmine
will only attend together. Let J and K stand for the statements
“Jasmine will attend” and “Kanti will attend”, respectively.

Which expression evaluates to true if Kanti and Jasmine are


satisfied?

e) K <--> J

84
Logical Equivalence

85
Propositional Equivalencies

▶ Two compound statements P and Q constructed from


the same component statements are logically
equivalent if P and Q have the same truth value for all
combinations of truth values of their component
statements.

If P and Q are logically equivalent,


then we write P Q

If P and Q are NOT logically equivalent,


then we write P Q
86
Example

▶ Show that the negation of the negation of a statement


is logically equivalent to the statement.
Assume our statement is p
p
T
F

87
Example

▶ Show that the negation of the negation of a statement


is logically equivalent to the statement.
Negate p
p ~p
T F
F T

88
Example

▶ Show that the negation of the negation of a statement


is logically equivalent to the statement.
Negate again
p ~p ~(~p)
T F T
F T F

89
Example

▶ Show that the negation of the negation of a statement


is logically equivalent to the statement.

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

p and ~(~p) have the same


truth values; therefore, they
are logically equivalent.
90
De Morgan’s Laws

▶ The negation of an AND statement is logically


equivalent to the OR statement in which each
component is negated.

~(p ∧ q) ≡ ~p ∨ ~q

▶ The negation of an OR statement is logically equivalent


to the AND statement in which each component is
negated.

~(p ∨ q) ≡ ~p ∧ ~q
91
De Morgan’s Law (cont.)

▶ Verify the following De Morgan’s Law by using a truth


table.

~(p ∨ q) ≡ ~p ∧ ~q

92
De Morgan’s Law (cont.)

▶ Verify the following De Morgan’s Law by using a truth


table.

~(p ∨ q) ≡ ~p ∧ ~q

p q (p ∨ q) ~(p ∨ q) ~p ~q ~p ∧ ~q

Start by building the truth table.

93
De Morgan’s Law (cont.)

▶ Verify the following De Morgan’s Law by using a truth


table.

~(p ∨ q) ≡ ~p ∧ ~q

p q (p ∨ q) ~(p ∨ q) ~p ~q ~p ∧ ~q
T T
T F
F T
F F Add the initial values for p and q.

94
De Morgan’s Law (cont.)

▶ Verify the following De Morgan’s Law by using a truth


table.

~(p ∨ q) ≡ ~p ∧ ~q

p q (p ∨ q) ~(p ∨ q) ~p ~q ~p ∧ ~q
T T T
T F T
F T T
F F F Keep on adding the values.

95
De Morgan’s Law (cont.)

▶ Verify the following De Morgan’s Law by using a truth


table.

~(p ∨ q) ≡ ~p ∧ ~q

p q (p ∨ q) ~(p ∨ q) ~p ~q ~p ∧ ~q
T T T F
T F T F The left side of the
F T T F equivalency is completed.

F F F T

96
De Morgan’s Law (cont.)

▶ Verify the following De Morgan’s Law by using a truth


table.
~(p ∨ q) ≡ ~p ∧ ~q

p q (p ∨ q) ~(p ∨ q) ~p ~q ~p ∧ ~q
T T T F
T F T F Now we need to work on the
F T T F right side of the equivalency.

F F F T

97
De Morgan’s Law (cont.)

▶ Verify the following De Morgan’s Law by using a truth


table.
~(p ∨ q) ≡ ~p ∧ ~q

p q (p ∨ q) ~(p ∨ q) ~p ~q ~p ∧ ~q
T T T F F
T F T F F
F T T F T
F F F T T

98
De Morgan’s Law (cont.)

▶ Verify the following De Morgan’s Law by using a truth


table.
~(p ∨ q) ≡ ~p ∧ ~q

p q (p ∨ q) ~(p ∨ q) ~p ~q ~p ∧ ~q
T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T

99
De Morgan’s Law (cont.)

▶ Verify the following De Morgan’s Law by using a truth


table.
~(p ∨ q) ≡ ~p ∧ ~q

p q (p ∨ q) ~(p ∨ q) ~p ~q ~p ∧ ~q
T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T

100
De Morgan’s Law (cont.)

▶ Verify the following De Morgan’s Law by using a truth


table.
~(p ∨ q) ≡ ~p ∧ ~q

p q (p ∨ q) ~(p ∨ q) ~p ~q ~p ∧ ~q
T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T

Left and right side are


equivalent. 101
 

102
103
Lecture Problems
Are the following statements logically equivalent?

(p → q) → r and p → (q → r)

a) Yes
b) No

104
Lecture Problems
Are the following statements logically equivalent?

(p → q) → r and p → (q → r)

b) No

105
Lecture Problems
Are the following statements logically equivalent?

(p ∧ q) → r and (p → r) ∧ (q → r)

a) Yes
b) No

106
Lecture Problems
Are the following statements logically equivalent?

(p ∧ q) → r and (p → r) ∧ (q → r)

b) No

107
Laws of Propositional
Logic

108
Logical Equivalency Laws

▶ There are several laws for logical equivalencies


▶ Some authors use different names

▶ This is another way to verify equivalencies

▶ For the exams, you will be provided with the list of laws
▶ So, no need to memorize them, but you need to
understand them.

109
Summary of Logical
Equivalencies

110
Example

▶ Verify the logical equivalence

▶ Solution:
▶ Use the laws of logical equivalency to replace sections of
the statement form on the left with logically equivalent
expressions.

111
Example (cont.)

▶ Verify the logical equivalence

~(~𝑝 ∧ 𝑞) ∧ (𝑝 ∨ 𝑞) (~(~𝑝) ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) De Morgan’s

112
Example (cont.)

▶ Verify the logical equivalence

~(~𝑝 ∧ 𝑞) ∧ (𝑝 ∨ 𝑞) (~(~𝑝) ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) De Morgan’s

(𝑝 ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) Double negative

113
Example (cont.)

▶ Verify the logical equivalence

~(~𝑝 ∧ 𝑞) ∧ (𝑝 ∨ 𝑞) (~(~𝑝) ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) De Morgan’s

(𝑝 ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) Double negative

𝑝 ∨ (~𝑞 ∧ 𝑞) Distributive

114
Example (cont.)

▶ Verify the logical equivalence

~(~𝑝 ∧ 𝑞) ∧ (𝑝 ∨ 𝑞) (~(~𝑝) ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) De Morgan’s

(𝑝 ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) Double negative

𝑝 ∨ (~𝑞 ∧ 𝑞) Distributive

𝑝 ∨ (𝑞 ∧ ~𝑞) Commutative

115
Example (cont.)

▶ Verify the logical equivalence

~(~𝑝 ∧ 𝑞) ∧ (𝑝 ∨ 𝑞) (~(~𝑝) ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) De Morgan’s

(𝑝 ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) Double negative

𝑝 ∨ (~𝑞 ∧ 𝑞) Distributive

𝑝 ∨ (𝑞 ∧ ~𝑞) Commutative

𝑝∨𝐹 Complement

116
Example (cont.)

▶ Verify the logical equivalence

~(~𝑝 ∧ 𝑞) ∧ (𝑝 ∨ 𝑞) (~(~𝑝) ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) De Morgan’s

(𝑝 ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) Double negative

𝑝 ∨ (~𝑞 ∧ 𝑞) Distributive

𝑝 ∨ (𝑞 ∧ ~𝑞) Commutative

𝑝∨𝐹 Complement

𝑝 Identity

117
Example (cont.)
This is the final step, which
verifies the equivalency.

▶ Verify the logical equivalence

~(~𝑝 ∧ 𝑞) ∧ (𝑝 ∨ 𝑞) (~(~𝑝) ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) De Morgan’s

(𝑝 ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) Double negative

𝑝 ∨ (~𝑞 ∧ 𝑞) Distributive

𝑝 ∨ (𝑞 ∧ ~𝑞) Commutative

𝑝∨𝐹 Complement

𝑝 Identity

118
Example (cont.)
On your exercises, you will
need to specify which law
you are applying.
▶ Verify the logical equivalence

~(~𝑝 ∧ 𝑞) ∧ (𝑝 ∨ 𝑞) (~(~𝑝) ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) De Morgan’s

(𝑝 ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) Double negative

𝑝 ∨ (~𝑞 ∧ 𝑞) Distributive

𝑝 ∨ (𝑞 ∧ ~𝑞) Commutative

𝑝∨𝐹 Complement

𝑝 Identity

119
Example (cont.)
Make sure you use
one law per line.
▶ Verify the logical equivalence

~(~𝑝 ∧ 𝑞) ∧ (𝑝 ∨ 𝑞) (~(~𝑝) ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) De Morgan’s

(𝑝 ∨ ~𝑞) ∧ (𝑝 ∨ 𝑞) Double negative

𝑝 ∨ (~𝑞 ∧ 𝑞) Distributive

𝑝 ∨ (𝑞 ∧ ~𝑞) Commutative

𝑝∨𝐹 Complement

𝑝 Identity

120
Tautologies and
Contradictions
▶ Tautology
▶ A compound proposition that is always TRUE, no
matter what the truth values of the propositions
are.

▶ Contradiction
▶ A compound proposition that is always FALSE, no
matter what the truth values of the propositions
are.

121
Lecture Problems
Are the following statements logically equivalent?
Prove your answer by using the laws of
propositional logic.

(p ∨ ∼q) ∧ (∼p ∨ ∼q) ≡ ∼q

a) Yes
b) No

122
Lecture Problems
Are the following statements logically equivalent?
Prove your answer by using the laws of
propositional logic.

(p ∨ ∼q) ∧ (∼p ∨ ∼q) ≡ ∼q

a) Yes

123
Lecture Problems
Are the following statements logically equivalent?
Prove your answer by using the laws of
propositional logic.

~p → ~ q ≡ q → p

a) Yes
b) No

124
Lecture Problems
Are the following statements logically equivalent?
Prove your answer by using the laws of
propositional logic.

~p → ~ q ≡ q → p

a)Yes

125
Lecture Problems
Is the following conditional statements is a
tautology or a contradiction? Prove your answers
using the laws of propositional logic

p → (p ∨ q)

a) Tautology
b) Contradiction

126
Lecture Problems
Is the following conditional statements is a
tautology or a contradiction? Prove your answers
using the laws of propositional logic

p → (p ∨ q)

a) Tautology

127
Propositional Logic (end)

128

Picture from XKCD

You might also like