Chapter 1_ Logic
Chapter 1_ Logic
Mathematics
Chapter
1: Logic
Done by: Dr. Raja’a Masa’deh
Information Technology Faculty
The World Islamic Sciences and
Education University
Proposition: - is a statement that is either true or false but
not both.
- a sentence with meaning.
- it is never both, neither, or somewhere “in
between”.
Example “3+2=5” it is true.
s:
“Amman is the capital of Jordan” it is true.
1. Negation operator.
2. Conjunction operator.
3. Disjunction operator.
4. Exclusive OR operator.
5. Implication operator.
6. Biconditional operator
Negation operator.
Negation operator.
Negation operator.
p q (p.q)/(pq)/p˄q
Example:P= It is snowing
T T T
q= I am cold.
T F F
pɅq: It is snowing, and I am cold. F T F
F F F
Example:
Find the conjunction of the propositions p & q where p is the
proposition “ Today is Friday” and q is the proposition “It is raining
today”.
= T. T + F. F
=T+F
F F F
=T True والمختلفاتFalse
المتشابهات
Example:
“I will go to coffeeshop, or I will study” which means you will do
only one thing.
Implication operator
Implication operator
𝒑 ⟶ 𝒒=↽𝒑 ∨𝒒 P q
T T T
=F T =F F
T F F
=T =F
F T T
F F T
=T T =T F
=T =T
Example: P: If you study hard.
q: you will pass your exam.
P q
T T T If you study hard, then you will pass the
exam.
T F F If you study hard, then you won’t pass the
F T T exam.
If you don’t study hard, then you will pass the
exam.
F F T If you don’t study hard, then you won’t pass
the exam.
Example:If you get 100% on the final, then you will get an
If you manage to get a 100% on the final, then you would expect
to receive an A.
If you don’t get 100% you may or not receive an A depending on
other factors. However, If you do get 100%, but the professor
doesn’t give you an A, you will feel cheated.
P q
T T T
T F F
F T T
F F T
Biconditional operator
Biconditional operator
𝒑 ⟷ 𝒒=𝒑 . 𝒒+↽ 𝒑 . ↽𝒒 P q
=T+F . F =F+T .T
T T T
=T+F =F+T
T F F
=T =T F T F
F F T
=F+F . T =F+T . F
=F+F =F+F
False والمختلفاتTrue
=F =F
المتشابهات
Example:
(
A proposition that is always has its truth values true is called a
tautology.
A proposition that is always has its truth values false is called a
contradiction.
A proposition that is always has its truth values is a mix of true
Example:
and .false is called a contingency.
Is the proposition tautology, contradiction or contingency?
Contradicti
on
𝒑 ⟶ 𝒒=↽𝒑 ∨𝒒
Example:
T F T F
F T T F
Tautolo
gy Contradictio
n
Exercise:
Logical Equivalence
↽ (𝒑 ∧𝒒 )⟺ ↽ 𝒑 ∨↽ 𝒒
T T F F F F
T F F T T T
F T T F T T
F F T T T T
Distributive Laws:
DE Morgan's Laws:
Discrete
Mathematics
Logical
Equivalence
s
Translating English
Sentences
Translate English sentences into expressions involving
propositional variables and logical connectives.
Example 3
I'll go for a run unless it rains.
p= I'll go for a run
q=it rains
mean
s
If it doesn't rain, then I'll go for a
run ¬ q →𝑝
¬ (p → q) = ¬ ( ¬ p ∨ q) De Morgan’s Law
= ¬ ( ¬ p) ∧ ¬ q Double negation Law
= p ∧ ¬q
Example 2:
Show that (p ∧ q) → (p ∨ q) is a tautology
(p ∧ q) → (p ∨ q)= ¬ (p ∧ q) ∨ (p ∨ q)
= ¬p ∨ ¬q ∨ p ∨ q
= ( ¬ p ∨ p) ∨ ( ¬ q ∨ q)
=T∨T
=T
Suppose p is Suppose p is
true false
( ¬ p ∨ p) ( ¬ p ∨ p) Always ( ¬ p ∨ p)
= ( ¬ T ∨ T) = ( ¬ F ∨ F) =T
= (F ∨ T) = (T ∨ F)
=T = T
Example 3:
Show that ¬ (p ∨( ¬ p ∧ q)) and ¬ p ∧ ¬
q are logically equivalent.
¬ (p ∨ ( ¬ p ∧ q))= ¬ p ∧ ¬ (( ¬ p ∧ q)
= ¬ p ∧ (p ∨ ¬ q)
= ( ¬ p ∧ p) ∨ ( ¬ p ∧ ¬ q)
= F ∨ ( ¬ p ∧ ¬ q)
= ( ¬ p ∧ ¬ q)
Example 4:
Show that (p → r) ∨ ( q → r) and (p ∧
q) → r
are logically equivalent.
(p → r) ∨ ( q → r) = ( ¬ p ∨ r) ∨ ( ¬ q ∨ r)
= (¬p ∨ ¬q ) ∨ r
= ¬ (p ∧ q) ∨ r
= (p ∧ q) → r
Example 5:
Show that (p → r) ∧ ( q → r) and (p ∨
q) → r
are logically equivalent.
(p → r) ∧ ( q → r) = ( ¬ p ∨ r) ∧ ( ¬ q ∨ r)
= (¬p ∧ ¬q ) ∨ r
= ¬ (p ∨ q) ∨ r
= (p ∨ q) → r
Example 6:
Show that (p ∧ q) → p is a tautology
without using truth table.
(p ∧ q) → p = ¬ (p ∧ q) ∨ p
= ¬p ∨ ¬q ∨ p
= ( ¬ p ∨ p) ∨ ¬ q
= T ∨ ¬q
=T
Example 7:
Show that p → (p ∨ q) is a tautology
without using truth table.
p → (p ∨ q) = ¬ p ∨ p ∨ q
= ¬p ∨ p ∨ q
= ( ¬ p ∨ p) ∨ q
=T∨q
=T
Exercise:
1. Write logically equivalent statement form for
( without using “ or “. Then find a logically equivalent
statement to your answer that is simple as possible.
Predicates
and
Quantifiers
Predicates
X is greater than 3
which has two parts:
First part: the variable (X), is the subject of the
statement.
Second part: the predicate, “is greater than 3”.
To obtain Q(1,2), set x=1 and y=2 in the statement Q(x, y).
Hence, Q(1, 2) is the statement “1 = 2+3” which is false. While
Q(3, 0) is the proposition “3= 0+3” which is true.
Example 3:
Let R(x, y, z) denotes the statement “x + y=
z”. What are the truth values of the
proposition R(1, 2, 3) and R(0, 0, 1)?
To obtain P(1), set x=1 in the statement P(x). Hence, P(1) is the
statement “12<1” which is false. While P(2) is the statement
“22<2” which is false too.
Quantifiers
Quantifier: is another important way to create a proposition from
a propositional function.
There are three types of quantification:
The universal quantifier.
The existing quantifier.
Uniqueness quantifier.
The universal
quantifier.
The universal quantification of P(x) is the proposition
“P(x) is true for all values of x in the universe of
discourse”
Many mathematical statement assert that a property is true for all values
of a variable in a particular domain called the universe of discourse or the
domain.
The notation:
read as “ for all x p(x)”
or “ for every x p(x)”.
Avoid using for any x, since it is often ambiguous as to whether “any” means
“every” or “some”.
Example 1:
Let P(X) be the statement . What is the truth values
of the quantification where the universe of
discourse consists of all real numbers?
Q(x) is not true for every real numbers x, since, for instance
Q(3) is false. Thus, is false.
Example 3:
What is the truth values of where is the statement
“” and the universe of discourse consists of the
positive integers not exceeding 4?
Note:
The notation:
read as “ there is an x such that p(x)
or “ for some x p(x)”
or “there is at least one x such that p(x).
Example 1:
Let P(X) denotes the statement . What is the truth
values of the quantification where the universe of
discourse consists of all real numbers?
Note:
OR
3. All your friends are perfect (if there is a person who is your friend
then he is perfect)
OR
Exercise 2:
Negation Equivalent statement When is true When is false
Exercise 3:
Let denotes the statement . If the universe of discourse
consists of all integers, what are these truth values?
a. Q(0)
b. Q(-1)
c. Q(1)
Discrete
Mathematics
Rules of
Inference for
Propositional
Logic
Introduction
Definition
( ( 𝒑 ∨ 𝒒 ) ∧ ( ¬ 𝒑 ∨𝒓 ) ) ⟶ ( 𝒒 ∨ 𝒓 ) 𝒊𝒔 𝒂 𝒕𝒂𝒖𝒕𝒐𝒍𝒐𝒈𝒚
Example
Example
Example
𝑝∧𝑞 Simplificatio
“I will make tea, and I will read a
∴𝑝 n (𝑝 ∧𝑞) ⟹𝑝
book.”
Therefore, “I will make tea.”
Example
Exercise
Discrete
Mathematics
Methods of
proof
Direct proof
Definition
Example
Example
Indirect proof
Proof by contraposition
Proof by contraposition
In a proof of the contrapositive, assume that q is false and
prove that f is false.
For example, the contrapositive of "If it is Friday, I go to the
mosque'' is "If I am not going to the mosque, it is not Friday.‘’
For example, if ab is even then either a or b is even: Assume
both a and b are odd. Since the product of odd numbers is odd,
ab is odd.
ab is even then either a or b is
even
We assume that ab is odd
a and b are odd numbers,
a=2k+1, b=2k+1
ab=(2k+1)(2k+1)
=4k2+4k+1
=2(2k2+k)+1
=2m+1 which is odd
Indirect proof
Proof by contradiction
¬ ( ∀ 𝒙 ( 𝒙 𝟐> 𝒙 ) ) =∃ 𝐱 ( 𝒙 𝟐 ≤ 𝒙 )
(