0% found this document useful (0 votes)
86 views15 pages

Propositional Logic

The document provides an introduction to propositional logic and discrete mathematics. It defines discrete mathematics as applying mathematical tools to solve individually separate and distinct problems using a sequence of finite steps. Examples of problems that can be solved with discrete mathematics are presented. The main topics covered in the course are then outlined as propositional logic and proof techniques, induction and recursion, and discrete structures. Propositional logic studies how statements interact with each other through logical connectives like conjunction, disjunction, conditional, biconditional, and negation. Truth tables are used to determine the truth value of statements based on the truth values of their parts and logical connectives.

Uploaded by

Betty Nagy
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)
86 views15 pages

Propositional Logic

The document provides an introduction to propositional logic and discrete mathematics. It defines discrete mathematics as applying mathematical tools to solve individually separate and distinct problems using a sequence of finite steps. Examples of problems that can be solved with discrete mathematics are presented. The main topics covered in the course are then outlined as propositional logic and proof techniques, induction and recursion, and discrete structures. Propositional logic studies how statements interact with each other through logical connectives like conjunction, disjunction, conditional, biconditional, and negation. Truth tables are used to determine the truth value of statements based on the truth values of their parts and logical connectives.

Uploaded by

Betty Nagy
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/ 15

CHAPTER 1

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?

1.1.2 COURSE MAIN TOPICS


Discrete Mathematics include large number of subjects. In this course, we will
be concerned with some of them which are; Propositional Logic and Proof,
Induction and Recursion and Discrete Structures.
Propositional Logic and Proof Techniques: This section is concerned with
building the ability to think mathematically, derive a proof based on a logical
argument and avoid common logical errors. Also, to learn different methods of
proof and apply them to number theory. This part of the course will be
addressed in Chapters 1-2.

Induction and Recursion: This section addresses large problems by assuming


smaller problems that are similar in nature. The main objective is to use
mathematical induction to validate the solution of a large problem from a small
one. Such technique is very useful for building and analyzing algorithms. This
part of the course will be addressed in Chapter 3.

Discrete Structures: This section is concerned with knowing different methods


that can display discrete structure. The two methods that will be introduced in
this course are graphs and trees. They are important to model discrete
structures and solve problems. Trees and graphs have application to artificial
intelligence, scheduling problems, and transportation systems. This part of the
course will be addressed in Chapter 4.
Discrete Mathematics Course

Propositional Logic and Proof Discrete


Induction
Techniques Structures

Elementary
Sequences,
Propositional Number Theory Graphs and
Induction
Logic and Methods of Trees
and Recusion
Proof

Chapter 1 Chapter 2 Chapter 3 Chapter 4

1.1.3 COURSE OBJECTIVES


• Learn by examples how to understand, explain and invent proofs.
• Learn how to apply methods of proofs on elementary number theory.
• Learn about sequences and how to define them using recursive formulas.
• Learn about graphs and trees types and how to use them to model and
solve discrete problems.
1.2 PROPOSITIONAL LOGIC
1.2.1 WHAT IS PROPOSITIONAL LOGIC?
Propositional Logic studies the ways statements can interact with each other. It is
important to remember that it does not really care about the content of the
statements.

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

• It studies the ways statements can interact with each other.


It is the process of validating an arguement form.

Arguement

• An argument is a sequence of statements ending with


a conclusion.

Example 1

Consider the following two arguments:


1: If Sarah eats her vegetables, then she can have a cookie.
Sarah eats her vegetables.
∴ Sarah gets a cookie.
2: Sally must eat her vegetables in order to get a cookie.
Sally eats her vegetables.
∴ Sally gets a cookie.

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.

1.2.2 MATHEMATICAL STATEMENTS


Statement
• A statement is any sentence which is either true or false but
not both. A statement is atomic if it cannot be divided into
smaller statements, otherwise it is called molecular or
propositional form .

Example 2

These are statements (in fact, atomic statements):


• Telephone numbers in the USA have 10 digits.
• The moon is made of cheese.
• 42 is a perfect square.
• 3+7=12

And these are not statements:


• Would you like some cake?
• The sum of two squares.
• 3+x=12
• Go to you room!

1.3 LOGICAL CONNECTIVES


They are used to connect atomic statements together to form a molecular
statement. This section will present some common logical connectives that
shall be used throughout the course.
Logical Connectives

• 𝑷 ∧ 𝐐 is read "P and Q", and called a conjunction.


• 𝑷 ∨ 𝑸 is read "P or Q", and called a disjunction.
• 𝑷 → 𝑸 is read "if P then Q", and called a conditional.
• 𝑷 ⟷ 𝑸 is read "P if and only if Q" and called a biconditional.
• ∼P is read "not P", and called a negation.

Example 3

• Karim will attend the Lecture and the Tutorial. (𝑳 ⋀ 𝑻) conjunction


• Karim will attend the Lecture or the Tutorial. (𝑳 ∨ 𝑻) disjunction
• If Karim attends the Lectures, then he will understand the Course.
(if 𝑳, then 𝑪) conditional.
• Karim will understand the course if and only if he attends the lectures.
(C if and only if 𝑳) biconditional.
• Karim will not attend the Lecture. (∼ 𝑳) negation

1.3.1 CONVERSE OF A CONDITIONAL


The converse of a conditional 𝑷 → 𝑸 is the conditional 𝑸 → 𝑷. The converse is
NOT logically equivalent to the original conditional. That is, whether the
converse is true or not, is independent of the truth of the conditional.

1.3.2 INVERSE OF A CONDITIONAL


The inverse of a conditional 𝑷 → 𝑸 is the conditional ∽ 𝑷 →∽ 𝑸. The inverse is
NOT logically equivalent to the original conditional. That is, whether the inverse
is true or not, is independent of the truth of the conditional.

1.3.3 CONTRAPOSITIVE OF AN CONDITIONAL


The contrapositive of a conditional 𝑷 → 𝑸 is the statement ∽ 𝑸 →∽ 𝑷 . A
conditional and its contrapositive are logically equivalent (they are either both
true or both false).
Example 4

Write the converse, inverse and contrapositive of each of the following


conditional statements:

a. If Ahmed can swim across the lake, then Ahmed can swim to the island.

b. If today is Sham El-Nessim, then tomorrow is Tuesday.

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.

b. Converse: If tomorrow is Tuesday, then today is Sham El-Nessim.


Inverse: If today is not Sham El-Nessim, then tomorrow is not Tuesday.
Contrapositive: if tomorrow is not Tuesday, then today is not a Sham El-
Nessim.

1.4 TRUTH VALUES


The truth value of a statement is determined by the truth value(s) of its part(s),
depending on the connectives.

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

• 𝑷 ∧ 𝑸 is true when P is true and Q is true.


• 𝑷 ∨ 𝑸 is true when P or Q or both are true
• 𝑷 → 𝑸 is true when P is false or Q is true or both.
• 𝑷 ⟷ 𝑸 is true when P and Q are both true or both false.
• ∼P is true when P is false.

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

Consider the statement:


a) If Ahmed gets a 90 on the final, then Ahmed will pass the course.

This is definitely a conditional: 𝑃 is the statement “Ahmed gets a 90 on the


final,” and 𝑄 is the statement “Ahmed will pass the class.”
if Ahmed really did get a 90 on the final and he did pass the class, then the
statement is true. However, if Ahmed did get a 90 on the final and did not pass
the class, then the statement would be false. The tricky case is this: what if
Ahmed did not get a 90 on the final? Maybe he passes the class, maybe he
doesn't. In these last two cases, P was false, and the statement P→Q was true.
In the first case, Q was true, and so was P→Q. So, P→Q is true when either P is
false or Q is true.

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,

WET -> RED

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.

1.5 LOGICAL EQUIVALENCE

Logical Equivalence

• Two molecular statements P and Q are logically


equivalent provided P is true precisely when Q is true. That
is, P and Q have the same truth value under any assignment
of truth values to their atomic parts.

Knowledge of logically equivalent statements is very useful for constructing


arguments. It often happens that it is difficult to see how a conclusion follows
from one form of a statement, whereas it is easy to see how it follows from a
logically equivalent form of the statement. A number of logical equivalences are
summarized as follows.

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

Construct the truth table for the statement form 𝑝 ∨∽ 𝑞 →∽ 𝑝.

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

fill in the columns for 𝑝 ∨ 𝑞, 𝑝 → 𝑟 , 𝑎𝑛𝑑 𝑞 → 𝑟 using the definitions of or and


if-then. For instance, the 𝑝 → 𝑟 column has F’s in the second and fourth rows
because these are the rows in which p is true and q is false. Next fill in the 𝑝 ∨
𝑞 → 𝑟 column using the definition of if-then. The rows in which the hypothesis
p ∨ q is true and the conclusion r is false are the second, fourth, and sixth. So,
F’s go in these rows and T’s in all the others.

The complete table shows that 𝑝 ∨ 𝑞 → 𝑟 and (𝑝 → 𝑟 ) ∧ (𝑞 → 𝑟 ) have the


same truth values for each combination of truth values of 𝑝, 𝑞, and 𝑟 . Hence the
two statement forms are logically equivalent.

𝒑 𝒒 𝒓 𝒑∨𝒒 𝒑⟶𝒓 𝒒⟶𝒓 𝒑∨𝒒⟶𝒓 (𝒑 ⟶ 𝒓) ∧ (𝒒 ⟶ 𝒓)


T T T T T T T T
T T F T F F F F
T F T T T T T T
T F F T F T F F
F T T T T T T T
F T F T T F F F
F F T F T T T T
F F F F T T T T
1.6 QUANTIFIED STATEMENTS

The sentence "He is a college student" is not a statement because it may be


either true or false depending on the value of the pronoun, he. Similarly, the
sentence "x + y is greater than 0" is not a statement because its truth value
depends on the values of the variables x and y. In order to convert these
sentences to statements, these sentences are decomposed into parts with the
help of predicates and quantifiers.

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

• Let 𝑄(𝑥) be a predicate and 𝐷 is the domain of 𝑥. A


universal statement is a statement of the form ∀𝑥 ∈ 𝐷,
𝑄(𝑥)." It is defined to be true if, and only if, 𝑄(𝑥) is true for
every 𝑥 in 𝐷. It is defined to be false if, and only if, 𝑄(𝑥) is
false for at least one 𝑥 in 𝐷.

Example 11

a) Let 𝐷 = {1, 2, 3, 4, 5), Show that the following statement is true;

∀𝑥 ∈ 𝐷, 𝑥 2 ≥ 𝑥

b) Consider the statement, ∀𝑥 ∈ ℝ, 𝑥 2 ≥ 𝑥 , Find a counter example to prove


that this statement is false.

Solution

a) Check that “𝑥 2 ≥ 𝑥” for each individual 𝑥 in 𝐷.


12 ≥ 1 , 22 ≥ 2, 32 ≥ 3, 42 ≥ 4, 52 ≥ 5.
Hence, " ∀𝑥 ∈ 𝐷, 𝑥 2 ≥ 𝑥" is true.
1 1
b) Counterexample: Take 𝑥 = . Then 𝑥 ∈ ℝ, 𝑆𝑖𝑛𝑐𝑒 is a real number and
2 2
2
1 1
( ) ≱
2 2
Hence, , " ∀𝑥 ∈ ℝ, 𝑥 2 ≥ 𝑥" is false.

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

• Let 𝑄(𝑥) be a predicate and 𝐷 is the domain of 𝑥. An


existential statement is a statement of the form "∃𝑥 ∈
𝐷 such that 𝑄(𝑥)." It is defined to be true if, and only if,
𝑄(𝑥) is true for at least one 𝑥 in 𝐷. It is false if, and only if,
𝑄(𝑥) is false for all 𝑥 in 𝐷.

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:

a) Since 12 = 1. Thus, 𝑚2 = 𝑚 is true for at least one integer 𝑚. Hence, the


statement ∃𝑚 ∈ ℤ, 𝑚2 = 𝑚 is true.
b) Note that 𝑚2 ≠ 𝑚 for any integers 𝑚 from 2 to 6:
22 ≠ 2, 32 ≠ 3, 42 ≠ 4, 52 ≠ 5, 62 ≠ 6

Thus, “∃𝑚 ∈ 𝐸such that 𝑚2 = 𝑚” is false.

You might also like