Propositional Logic
Propositional Logic
1 PROPOSITIONAL LOGIC
1.1 INTRODUCTION
1.1.1 WHAT IS DISCRETE MATH?
Mathematics is a collection of tools that allow you to solve problems that
involve numbers, functions, lines, triangles, … etc. Discrete Mathematics is,
trying to apply the concept of “discrete” to mathematical tools to solve
problems that are individually separate and distinct.
Discrete mathematics describe processes that consist of a sequence of finite
steps. This contrasts with calculus, which describes processes that change in a
continuous fashion. The ideas of calculus were fundamental to science and
technology of industrial revolution, in the same manner the ideas of discrete
mathematics underlie the science and technology of the computer age.
Here are some examples about the types of problems that can be solved using
Discrete Mathematics topics studied in this course.
1- After excavating for weeks, you finally arrive at a room. The room is empty
except for two large boxes. On each is carved a message
You Know exactly one of the two messages is true. What should you do?
2- At a college graduating party, there was “All Chocolates You Can Eat” Contest,
Ali ate one chocolate. Karim then showed him up by eating three. Not to be
outdone, Samir ate five. This continued with each contestant eating two more
chocolates than the previous contestant. How many chocolates did Ziad (the
26th and final contestant) eat? How many chocolates were eaten all together?
3- Five small towns decided they wanted to build roads directly connecting each
pair of towns. It was very important that the roads do not intersect with each
other (as stop signs had not yet been invented). Also, tunnels and bridges were
not allowed. Is it possible for each of these towns to build a road to each of the
four other towns without creating any intersections?
Elementary
Sequences,
Propositional Number Theory Graphs and
Induction
Logic and Methods of Trees
and Recusion
Proof
For example, in terms of propositional logic, the claim, “if the moon is made of
cheese then basketballs are round is a valid logical statement.
Propositional Logic
Arguement
Example 1
Are these arguments valid? Hopefully, you agree that the first one is but the
second one is not. Logic tells us why by analyzing the structure of the
statements in the argument. Notice the two arguments above look almost
identical. Sarah and Sally both eat their vegetables. In both cases there is a
connection between the eating of vegetables and cookies. But we claim that it
is valid to conclude that Sarah gets a cookie, but not that Sally does. The
difference must be in the connection between eating vegetables and getting
cookies. We need to be skilled at reading and comprehending these sentences.
Example 2
Example 3
a. If Ahmed can swim across the lake, then Ahmed can swim to the island.
Solution
a. Converse: If Ahmed can swim to the island, then Ahmed can swim across the
lake.
Inverse: If Ahmed cannot swim across the lake, then Ahmed cannot swim to
the island.
Contrapositive: If Ahmed cannot swim to the island, then Ahmed cannot
swim across the lake.
The truth table for a given statement form displays the truth values that
correspond to all possible combinations of truth values for its atoms.
Truth Conditions for Connectives
Example 5
Given are the truth tables of the logical connectives defined in section 2.3
P Q 𝑷∧𝑸
T T T
T F F
F T F
F F F
P Q 𝑷∨𝑸
T T T
T F T
F T T
F F F
P Q 𝑷→𝑸
T T T
T F F
F T T
F F T
P Q 𝑷⟷𝑸
T T T
T F F
F T F
F F T
P ~P
T F
F T
Example 6
b) I have a piece of paper here that is coated with a chemical that changes
color. I claim that if the paper is wet, it is red. That is,
Now let's consider what you might see when I show you the paper, taking the
four cases in your order.
Case 1: It's wet, and it's red. That agrees with my statement, so you say my
statement is true. this instance that "if it's wet, then it's red."
Case2: It's dry, and it's blue. You don't know that it would be red if it were wet;
there's no evidence one way or the other. So, simply by convention, you say
that my statement is true, meaning that the evidence is consistent with that
conclusion.
Case3: It's wet, and it's blue. That disproves my statement; we have a case
where it is wet but NOT red. My statement is definitely false. (This case is
enough to disprove the stronger claim that wet implies red; you have a
counterexample.)
Case 4: It's dry, and it's red. Hmmm ... maybe it's ALWAYS red, and my
statement was technically true but misleading; or maybe it's red for some other
reason than wetness. Or maybe it actually turns blue when it gets wet, and I
just lied. Again, you really don't know! The evidence at hand deals only with
the case where it's dry, and my statement is about what would be true if it were
wet. So, you have to say that it's true, because you haven't disproved it, just like
in case 2.
So, your cases 2 and 4 are both "true" for the same reason, not for different
reasons. The evidence in both cases is consistent with my statement, so we call
it true.
Logical Equivalence
Let p, q and r are any given statements, t denotes a statement that is always
true (tautology) and c denotes a statement that is always false (contradiction)
Logical Equivalences
Commutative laws 𝑝∧𝑞 ≡𝑞∧𝑝 𝑝∨𝑞 ≡𝑞∨𝑝
Associative Laws (𝑝 ∧ 𝑞) ∧ 𝑟 ≡ 𝑝 ∧ (𝑞 ∧ 𝑟) (𝑝 ∨ 𝑞) ∨ 𝑟 ≡ 𝑝 ∨ (𝑞 ∨ 𝑟)
Distributive Laws 𝑝 ∧ (𝑞 ∨ 𝑟) ≡ (𝑝 ∧ 𝑞) ∨ (𝑝 ∧ 𝑟) 𝑝 ∨ (𝑞 ∧ 𝑟) ≡ (𝑝 ∨ 𝑞) ∧ (𝑝 ∨ 𝑟)
De Morgan’s Laws ∼ (𝑝 ∧ 𝑞) ≡∼ 𝑝 ∨∼ 𝑞 ∼ (𝑝 ∨ 𝑞) ≡∼ 𝑝 ∧∼ 𝑞
Example 7
Solution
By the order of operations given above, the following two expressions are
equivalent:
p ∨ ∼q →∼p and (p ∨ (∼q)) → (∼p), and this order governs the construction
of the truth table. First fill in the four possible combinations of truth values for
p and q, and then enter the truth values for ∼p and ∼q using the definition of
negation. Next fill in the p ∨ ∼q column using the definition of ∨. Finally, fill in
the p ∨ ∼q →∼p column using the definition of→. The only rows in which the
hypothesis p ∨ ∼q is true and the conclusion ∼p is false are the first and second
rows. So, you put F’s in those two rows and T’s in the other two rows.
p q ∽ 𝒑 ∽ 𝒒 𝒑 ∨∽ 𝒒 𝒑 ∨∽ 𝒒 →∽ 𝒑
T T F F T F
T F F T T F
F T T F F T
F F T T T T
Example 8
Use truth tables to show the logical equivalence of the statement forms 𝑝 ∨
𝑞 → 𝑟 𝑎𝑛𝑑(𝑝 → 𝑟 ) ∧ (𝑞 → 𝑟 ).
Solution
First fill in the eight possible combinations of truth values for 𝑝, 𝑞, and 𝑟 . Then
1.6.1 PREDICATE
A predicate is a sentence that contains a finite number of variables and becomes
a statement when specific values are substituted for the variables. It is denoted
by 𝑃(𝑥).
The domain of a predicate variable is the set of all values that may be
substituted in place of the variable. It is denoted by 𝐷.
The truth set of 𝑃(𝑥) is the set of all elements of 𝐷 that make 𝑃(𝑥) true when
they are substituted for 𝑥. The truth set of 𝑃(𝑥) is denoted by
{𝑥 ∈ 𝐷|𝑃(𝑥)}
Example 9
The set of real numbers ℝ is the domain of the predicate 𝑃(𝑥) =“𝑥 2 > 𝑥”
𝑃(2): 22 > 2, 𝑜𝑟 4 > 2 True.
2
1 1 1 1 1
𝑃 ( ): ( ) > , 𝑜𝑟 > False.
2 2 2 4 2
1 1 2 1 1 1
𝑃 (− ): (− ) > − , 𝑜𝑟 > − True.
2 2 2 4 2
Example 10
Let 𝑄(𝑛) be the predicate "𝑛 is a factor of 8." Find the truth set of 𝑄(𝑛) if
a. the domain of 𝑛 is the set 𝒁+ of all positive integers
b. the domain of 𝑛 is the set 𝒁 of all integers.
Solution
a. The truth set is (1, 2, 4, 8} because these are exactly the positive integers that
divide 8 evenly.
b. The truth set is (1, 2, 4, 8, -1, -2, -4, -8) because the negative integers -1, -2, -
4 and -8 also divide into 8 without leaving a remainder.
1.6.2 QUANTIFIERS
Quantifiers are words that refer to quantities such as "some" or "all" and tell for
how many elements a given predicate is true.
The symbol ∀ denotes "for all" and is called the universal quantifier. For
example, another way to express the sentence "All human beings are mortal" is
to write ∀ human beings 𝑥, 𝑥 is mortal.
Universal Statement
Example 11
∀𝑥 ∈ 𝐷, 𝑥 2 ≥ 𝑥
Solution
The symbol ∃ denotes "there exists" and is called the existential quantifier. For
example, the sentence "There is a student in PHM 211" can be written as ∃ a
person s such that s is a student in PHM 211,
Existential Statement
Example 12
a) Consider the statement “∃𝑚 ∈ ℤ, 𝑚2 = 𝑚”. Show that this statement is true.
b) Let 𝐸 = {2, 3, 4, 5,6), Show that the following statement is false;
∃𝑚 ∈ 𝐸 such that 𝑚2 = 𝑚
Solution: