You are on page 1of 33

16/02/2021

Logic
Dr. Rebecca C Tolentino

1
16/02/2021

Logic may be defined as


the science of reasoning.
(Prof. Hardegree)
What is
Logic? Logic is defined as
reasoning conducted or
assessed according to
strict principles of validity.
(Oxford Dictionary)

2
16/02/2021

A statement is a declarative
sentence that is either true or false,
but not both.

If a statement is true, then its truth


Statement value is true which is denoted by T ;
otherwise, its truth value is false and
is denoted by F or F

Statements are also called


propositions.

It is raining.

If you study hard, you will pass the


Examples of exam.
Statement
You are kind and beautiful.

Statements are usually represented


by small letters p, q, r,...

3
16/02/2021

Question: Where are


you?

Exclamation:
Not Congratulations!
Proposition/
Statement Command: Answer
exercise 1.

Self-contradictory: I am
lying.

Activity 1

4
16/02/2021

10

5
16/02/2021

Simple and Compound Statements

• A simple proposition can not be broken down into other


component propositions.
• A compound proposition is a proposition formed from simple
propositions using logical connectors:
• Not (  )
• And (  ) /\
• or (  ) v
• if then ( → ) ->
• if and only if. (  ) <->

11

Simple Statements and Compound Statements

Logic Connectives and Symbols


Table 3.1

12

6
16/02/2021

Example 3 – Write Compound


Statements in Symbolic Form

Consider the following simple statements.


p: Today is Friday.
q: It is raining.
r : I am going to a movie.
s: I am not going to the basketball game.

Write the following compound statements in symbolic form.


a. Today is Friday and it is raining. p/\q
b. It is not raining and I am going to a movie. ~q/\r
c. I am going to the basketball game or I am going to a movie. ~sVr
d. If it is raining, then I am not going to the basketball game.q->s

13

Example 3 – Write Compound Statements in Symbolic Form


Consider the following simple statements.
p: Today is Friday.
q: It is raining.
r: I am going to a movie.
s: I am not going to the basketball game.

Write the following compound statements in symbolic form.


a. Today is Friday and it is raining.
b. It is not raining and I am going to a movie.
c. I am going to the basketball game or I am going to a movie.
d. If it is raining, then I am not going to the basketball game.

14

7
16/02/2021

Example 3 – Write Compound Statements in Symbolic Form


a. ~p/\r
b. ~s/\~r
•Consider the following simple statements. c. r<->q
• p: Today is Friday. d. p->~r
• q: It is raining.
• r: I am going to a movie.
• s: I am not going to the basketball game.

•.

15

Simple Statements and


Compound Statements

•In the next example, we translate symbolic


statements into English sentences.

16

8
16/02/2021

Example 4 – Translate Symbolic Statements

Consider the following statements.


p: The game will be played in Atlanta.
q: The game will be shown on CBS.
r: The game will not be shown on ESPN.
s: The Mets are favored to win.
Write each of the following symbolic statements in words.

17

Example 4 – Solution

p: The game will be played in Atlanta.


q: The game will be shown on CBS.
r: The game will not be shown on ESPN.
s: The Mets are favored to win.

a. The game will be shown on CBS and the


game will be played in Atlanta.

18

9
16/02/2021

Example 4 – Solution

p: The game will be played in Atlanta.


q: The game will be shown on CBS.
r: The game will not be shown on ESPN.
s: The Mets are favored to win.

•b. The game will be shown on ESPN and


the Mets are favored to win.

19

Example 4 – Solution

p: The game will be played in Atlanta.


q: The game will be shown on CBS.
r: The game will not be shown on ESPN.
s: The Mets are favored to win.

•c. The Mets are favored to win if and only if


the game will not be played in Atlanta.

20

10
16/02/2021

Compound
Statements and
Grouping Symbols

21

Simple Statements and Compound Statements

Logic Connectives and Symbols


Table 3.1

22

11
16/02/2021

Compound Statements and Grouping Symbols

•If a compound statement is written in symbolic form, then parentheses


are used to indicate which simple statements are grouped together.

•Table 3.2 illustrates the use of parentheses to indicate groupings for


some statements in symbolic form.

Table 3.2

23

Compound Statements and Grouping Symbols


•If a compound statement is written as an English sentence, then a
comma is used to indicate which simple statements are grouped
together. Statements on the same side of a comma are grouped
together. See Table 3.3.

Table 3.3

24

12
16/02/2021

Compound
Statements
and
Grouping
Symbols

25

Example 5 – Translate Compound Statements

Let p, q, and r represent the following.


p: You get a promotion.
q: You complete the training.
r: You will receive a bonus.

a. Write as an English sentence.

b. Write “If you do not complete the training, then you will not get a
promotion and you will not receive a bonus.” in
symbolic form.

26

13
16/02/2021

Example 5(a) – Solution

•Because the p and the q statements both appear in parentheses in the


symbolic form, they are placed to the
left of the comma in the English sentence.

•Thus the translation is: If you get a promotion and complete the
training, then you will receive a bonus.

27

Example 5(b) – Solution cont’d

•Because the not p and the not r statements are both to


the right of the comma in the English sentence, they are
grouped together in parentheses in the symbolic form.


•Thus the translation is:

28

14
16/02/2021

Seatwork 1

29

Quantifiers and Negation

30

15
16/02/2021

Quantifiers and Negation

•In a statement, the word some and the phrases there exists and at
least one are called existential quantifiers. Existential quantifiers are
used as prefixes to assert the existence of something.

•In a statement, the words none, no, all, and every are called universal
quantifiers. The universal quantifiers none and no deny the existence
of something, whereas the universal quantifiers all and every are used
to assert that every element of a given set satisfies some condition.

31

Quantifiers and Negation

•What is the negation of the false statement, “No doctors write in a


legible manner”?

•Whatever the negation is, we know it must be a true statement. The


negation cannot be “All doctors write in a legible manner,” because this
is also a false statement.

•The negation is “Some doctors write in a legible manner.” This can


also be stated as, “There exists at least one doctor who writes in a
legible manner.”

32

16
16/02/2021

Quantifiers and Negation

•Table 3.4A illustrates how to write the negation of some quantified


statements.

Quantified Statements and Their Negations

Table 3.4A

33

Example 7 – Write the Negation of a Quantified


Statement

Write the negation of each of the following statements.


a. Some airports are open.
b. All movies are worth the price of admission.
c. No odd numbers are divisible by 2.

Solution:
a. No airports are open.
b. Some movies are not worth the price of admission.
c. Some odd numbers are divisible by 2.

34

17
16/02/2021

Truth Tables

A truth table lists all possible combinations


p
of truth values.
T

In a two-valued logic system, a single


statement p has two possible truth p q
values: truth (T) and falsehood (F).
T T

T F

Given two statements p and q, there are F T


four possible. As a result, there are four F F
rows in the truth table.

35

p q r
• With three
statements, there T T T
are eight truth
value T T F
combinations,
ranging from TTT T F T
to FFF.
F T T
• In general, given n
statements, there F F T
are 2n rows (or
cases) in the truth F T F
table.
T F F

F F F

36

18
16/02/2021

Basic Truth Tables of the Five


Connectives

37

Truth Tables of
Negation
p p
• The negation of propositionp
is written as ∼p ( read as not
p).
T F
• The possible truth values of a
negation are opposite to the
possible truth values of the
statement it negates. F T
• if p is true, then ∼p is false.
• If p is false, then ∼p is true.

38

19
16/02/2021

Truth Tables of
Conjunction p q pq

• The conjuction of p and q is T T T


denoted by p q ( read as p
and q). p and q are called
conjucts. T F F
• A conjunction p q is true only
when both of its conjuncts are F T F
true. It is false in all other
three cases.
F F F

39

Truth Tables of
Disjunction p q pq

• A disjunction p ∨ q ( p or q) is T T T
false only when both of its
disjuncts are false. In the other
three cases, the disjunction is T F T
true.
F T T

F F F

40

20
16/02/2021

Truth Tables of
Conditional p q p→q

• A conditional p → q (If p then T T T


q) is false only when its
antecedent is true but its
consequent is false. T F F

F T T

F F T

41

Truth Tables of
Biconditional p q pq

• A biconditional p  q ( p if T T T
and only if q) is true only
when both p and q share the
same truth value. If p and q T F F
have opposite truth values,
then the biconditional is false. F T F

F F T

42

21
16/02/2021

Construction of a Truth
Table

43

Alternative Method for the Construction of a Truth Table

44

22
16/02/2021

Example 3 – Use the Alternative Procedure to Construct a Truth Table


Construct a truth table for .

Solution:
Step 1: The given statement h as the two simple
statements p and q. Thus we start with a standard form that has 22
= 4 rows.

p q p V [~ (p /\ ~q)]
T T T T T T F F
T F T T F T T T
F T F T T F F F
F F F T T F F T

45

Example 3 – Solution cont’d

In each column, enter the truth values for the statements p and ~q,
as shown in the columns numbered 1, 2, and 3 of the following
table.

46

23
16/02/2021

Example 3 – Solution cont’d

Step 2: Use the truth values in columns 2 and 3 to


determine the truth values to enter under the “and”
connective. See column 4 in the following truth
table. Now negate the truth values in column
4 to produce the truth values in column 5.

47

Example 3 – Solution cont’d


Step 3: Use the truth values in the columns 1 and 5 to determine the truth
values to enter under the “or” connective. See column 6 in the following
table. Shaded column 6 is the truth table for

48

24
16/02/2021

Construct a truth table for

p q (p /\ ~q) /\ (p /\ q)

T T T F F F T T T

T F T T T F T F F

F T F F F F F F T

F F F F T F F F F

49

50

25
16/02/2021

p q r (p /\ q) /\ (~r V q)
T T T T T T T F T T
T T F T T T T T T T
T F T T F F F F F F
T F F T F F F T T F
F T T F F T F F T T
F T F F F T F T T T
F F T F F F F F F F
F F F F F F F T T F

51

52

26
16/02/2021

r p q [ r /\ ( ~p V q )] -> (r V ~q)
T T T T T F T T T T T F
T T F T F F F F T T T T
T F T T T T T T T T T F
T F F T T T T F T T T T
F T T F F F T T T F F F
F T F F F F F F T F T T
F F T F F T T T T F F F
F F F F F T T F T F T T

53

Equivalent
Statements

54

27
16/02/2021

Equivalent Statements

Two statements are equivalent if they both have the same truth value
for all possible truth values of their simple statements. Equivalent
statements have identical truth values in the final columns of their
truth tables.

The notation p  q is used to indicate that the statements p and q are


equivalent.

55

Thus the statements are equivalent.

56

28
16/02/2021

Equivalent Statements

These equivalences are known as De Morgan’s laws for statements.

De Morgan’s laws can be used to restate certain English sentences in an


equivalent form.

57

Example 5 – State an Equivalent Form

Use one of De Morgan’s laws to restate the following sentence in an


equivalent form.
It is not true that, I graduated or I got a job.

Solution:
Let p represent the statement “I graduated.” Let q represent the
statement “I got a job.” In symbolic form, the original sentence is
. One of De Morgan’s laws states that this is equivalent to .

Thus a sentence that is equivalent to the original sentence is “I did not


graduate and I did not get a job.”

58

29
16/02/2021

Tautologies and Self-Contradictions

59

Tautologies and Self-Contradictions

A TAUTOLOGY IS A STATEMENT A SELF-CONTRADICTION IS A


THAT IS ALWAYS TRUE. STATEMENT THAT IS ALWAYS FALSE.

60

30
16/02/2021

Example 6 – Verify Tautologies and Self-Contradictions

Show that is a tautology.

Solution:
Enter the truth values for each simple statement and its negation as
shown in the columns numbered 1, 2, and 3.

Use the truth values in columns 2 and 3 to determine the truth values
to enter in column 4, under the “or” connective.

Use the truth values in columns 1 and 4 to determine the truth values
to enter in column 5, under the “or” connective.

61

Example 6 – Solution cont’d

Column 5 of the table shows that is always true.

Thus is a tautology.

62

31
16/02/2021

63

Constructing Truth Tables

p q p→q q→p (p→q)q→p

T T T T T

T F F T F

F T T F F

F F T T T

64

32
16/02/2021

Construct the truth table for

p q r p→r q→r (p→r) (q→r)

T T T T T T

T T F F F F

T F T T T T

F T T T T T

T F F F T F

F T F T F F

F F T T T T

F F F T T T

65

33

You might also like