You are on page 1of 9

Chapter 5 LOGIC

Logical Statements and Quantifiers

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

Ex. 𝑥 + 5 = 13 For any given value of 𝑥, it is either true or false, but not both.

Simple and Compound Statements


A simple statement is a statement that conveys a single idea. A compound statement
is a statement that conveys two or more ideas.

Truth Value and Truth Tables


The truth value of a simple statement is either true (T) or false (F).
The truth value of a compound statement depends on the truth values of its simple statements
and its connectives.
A truth table is a table that shows the truth value of a compound statement for all possible
truth values of its simple statements.

Writing compound statements in symbolic form


Consider the following simple statements.
𝑝: Today is Monday.
𝑞: It is raining.
𝑟: I am going to visit my friend.
𝑡: I am going to a movie.
Write the following statements in symbolic form.
a. Today is Monday and it is raining.

b. It is not raining and I am going to visit my friend.

c. I am going to visit my friend or I am going to a movie.

d. I am going to the movie if and only if it is raining.

Write the following symbolic statements in words.


a. 𝑝 → ~𝑡

b. 𝑡 ∧∼ 𝑟

c. ∼ 𝑝 ∧ 𝑡

The Truth value of a Conjunction


The conjunction 𝑝 ∧ 𝑞 is true if and only if both 𝑝and 𝑞 are true.

Truth Table for 𝑝 ∧ 𝑞


p q pɅq
T T T
T F F
F T F
F F F
The Truth value of a Disjunction
The disjunction 𝑝 ∨ 𝑞 is true if and only if 𝑝 is true, 𝑞 is true, or both 𝑝and 𝑞 are true.

Truth Table for 𝑝 ∨ 𝑞


p q pVq
T T T
T F T
F T T
F F F

Illustration
Determine the truth value of the following statement.
a. 9 ≥ 7

b. 2 is an odd number or 2 is an even number

c. 15 is a natural number and also an integer

Equivalent Statements
Two statements are equivalent if they are both have the same truth value for all possible
truth values of their simple statements. The notation 𝑝 ≡ 𝑞 is used to indicate that the
statement 𝑝 and 𝑞 are equivalent.

Illustration
Show that 𝑝 ∧ (𝑞 ∨ 𝑟) and (𝑝 ∧ 𝑞) ∨ (𝑝 ∧ 𝑟) are equivalent.
De Morgan’s Laws for Statements
For any statements 𝑝 and 𝑞,
∼ (𝑝 ∨ 𝑞) ≡∼ 𝑝 ∧∼ 𝑞

∼ (𝑝 ∧ 𝑞) ≡∼ 𝑝 ∨∼ 𝑞

Illustrations
It is not the case that, the student cut classes or took part in the demonstration.

It is not true that, I bought a new bike and sold my car.

Quantifiers and Negations

Existential Quantifiers are used as prefixes to assert the existence of something.


- some, there exists, at least one

Universal Quantifiers are used to deny the existence of something or to assert that every
element of a given set satisfies some conditions.
- none, no; all, every

Quantified Statements and Their Negations

Statement Negations
All X are Y Some X are not Y.
No X are Y Some X are Y.

Example:
Some fruits are not green.
All teachers are beautiful.
No restaurants are open.
Some MMW topics are challenging.

Tautologies and Self-Contradictions


A tautology is a statement that is always true. A self-contradiction is a statement that
is always false.
Illustrations
Show that (∼ 𝑝 ∨ 𝑞) ∨ (∼ 𝑞 ∨ 𝑟) is a tautology.

Show that ∼ [(𝑝 ∨ 𝑞 ) ∨ (∼ 𝑝 ∨ 𝑞 )] is a self-contradiction.

The Conditional and the Biconditional


In any conditional statement represented by “If 𝑝, then 𝑞,” the 𝑝 statement is called the
antecedent and the 𝑞 statement is called the consequent.

Example: If I study very well, then I will pass MMW.

Arrow Notation
The conditional statement , “If 𝑝, then 𝑞,” can be written using the arrow notation 𝑝 → 𝑞.
The arrow notation 𝑝 → 𝑞 is read as “if 𝑝, 𝑡ℎ𝑒𝑛 𝑞" or as “𝑝 implies 𝑞. "

The Truth Table for the Conditional 𝑝 → 𝑞

p q p→q
T T T
T F F
F T T
F F T
Examples:
If 7 ≥ 5, then 5 + 8 = 11.

If I pass MMW, then I’ll treat you some pizza.

If a number 𝑛 is prime, then it is factorable.

An Equivalent Form of the Conditional 𝑝 → 𝑞


𝑝 → 𝑞 ≡ ~𝑝 ∨ 𝑞

Examples:
If the number is divisible by 2, then the number is even.

If I don’t stay in Bicol, then I will live in Manila.

The Negation of the Conditional 𝑝 → 𝑞


~(𝑝 → 𝑞) ≡ 𝑝 ∧ ~𝑞

Examples:
If the square of 𝑛 is 36, then 𝑛 is 6 or –6.

If the lines are parallel, then they do not intersect.

The Biconditional
The statement (𝑝 → 𝑞 ) ∧ (𝑞 → 𝑝) is called a Biconditional and is denoted by 𝑝 ↔ 𝑞 which
is read as “𝑝 if and only if 𝑞.”
𝑝 ↔ 𝑞 ≡ (𝑝 → 𝑞 ) ∧ (𝑞 → 𝑝)

The Truth Table for 𝑝 ↔ 𝑞


p q p↔q
T T T
T F F
F T F
F F T

Examples:
𝑥 + 6 = 13 if and only if 𝑥 = 7.

I will go on vacation if and only if I have the money.


𝑥 2 = 49 if and only if 𝑥 = 7.

Equivalent Forms of the Conditional


The converse of 𝑝 → 𝑞 is 𝑞 → 𝑝.

The inverse of 𝑝 → 𝑞 is ~𝑝 → ~𝑞.

The contrapositive of 𝑝 → 𝑞 is ~𝑞 → ~𝑝.


Examples:
Write the converse, inverse, and the contrapositive of the following statements.
1. If 𝑥 + 6 = 13, then 𝑥 = 7.

2. If I pass MMW, then I will bike a new bike.

Switching Network and Logic Gates

terminals
p

p q Parallel Network
Series Network
q

Draw a network to represent each statement.


1. [~𝑃 ∧ 𝑄 ∧ 𝑅] ∨ (𝑃 ∧ 𝑅)
2. (𝑃 ∨ 𝑄 ∨ 𝑅) ∧ 𝑆 ∧ (~𝑄 ∨ 𝑅)

Logic Gates Symbols


The NAND Gate and the Sheffer’s Stroke

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

You might also like