0% found this document useful (0 votes)
14 views

Discrete-Structures-2-Module-1 2

This document is a module on Propositional Logic from a Discrete Structures course at Gordon College, introducing the fundamentals of logic and its applications in computer science. It covers key concepts such as propositions, truth values, logical operators, and conditional statements, providing definitions and examples for clarity. The module aims to equip students with the ability to identify propositions, construct new propositions using connectives, and understand the implications of conditional statements.

Uploaded by

202210059
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Discrete-Structures-2-Module-1 2

This document is a module on Propositional Logic from a Discrete Structures course at Gordon College, introducing the fundamentals of logic and its applications in computer science. It covers key concepts such as propositions, truth values, logical operators, and conditional statements, providing definitions and examples for clarity. The module aims to equip students with the ability to identify propositions, construct new propositions using connectives, and understand the implications of conditional statements.

Uploaded by

202210059
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Republic of the Philippines

City of Olongapo

GORDON COLLEGE
Olongapo City Sports Complex, East Tapinac, Olongapo City
Tel. No. (047) 224-2089 loc. 314
www.gordoncollege.edu.ph

DISCRETE STRUCTURES 2
Title: PROPOSITIONAL LOGIC Module No. 1

I. INTRODUCTION
We begin our study of discrete mathematics with an introduction to logic. Besides the
importance of logic in understanding mathematical reasoning, logic has numerous
applications to computer science. These rules are used in the design of computer circuits,
the construction of computer programs, the verification of the correctness of programs,
and in many other ways. Furthermore, software systems have been developed for
constructing some, but not all, types of proofs automatically.

II. LEARNING OBJECTIVES


After studying this module, you should be able to:
 Identify whether or not a sentence is a proposition and determine its truth value;
 Build new propositions from two or more existing propositions using connectives;
 Translate sentences to expressions involving propositional variables and connectives.

III. TOPICS AND KEY CONCEPT


A. PROPOSITIONS
Our discussion begins with an introduction to the basic building blocks of logic—
propositions. A proposition is a declarative sentence (that is, a sentence that declares
a fact) that is either true or false, but not both.

EXAMPLE 1
All the following declarative sentences are propositions.

1. Washington, D.C., is the capital of the United States of America.


2. Toronto is the capital of Canada.
3. 1 + 1 = 2.
4. 2 + 2 = 3.

Propositions 1 and 3 are true, whereas 2 and 4 are false.

Some sentences that are not propositions are given in Example 2.

EXAMPLE 2
Consider the following sentences.

1. What time is it?


2. Read this carefully.
3. x + 1 = 2.
4. x + y = z.

Prepared by: Mr. Kenneth V. Bautista 1 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

Sentences 1 and 2 are not propositions because they are not declarative sentences.
Sentences 3 and 4 are not propositions because they are neither true nor false. Note
that each of sentences 3 and 4 can be turned into a proposition if we assign values to
the variables.

We use letters to denote propositional variables (or statement variables), that is,
variables that represent propositions, just as letters are used to denote numerical
variables. The conventional letters used for propositional variables are p, q, r, s, . . . .
The truth value of a proposition is true, denoted by T, if it is a true proposition, and
the truth value of a proposition is false, denoted by F, if it is a false proposition.

The area of logic that deals with propositions is called the propositional calculus or
propositional logic. It was first developed systematically by the Greek philosopher
Aristotle more than 2300 years ago.

We now turn our attention to methods for producing new propositions from those
that we already have. These methods were discussed by the English mathematician
George Boole in 1854 in his book The Laws of Thought. Many mathematical
statements are constructed by combining one or more propositions. New
propositions, called compound propositions, are formed from existing propositions
using logical operators.

DEFINITION 1 Let p be a proposition. The negation of p, denoted by ¬p (also


denoted by p
̅ ), is the statement.

“It is not the case that p.”

The proposition ¬p is read “not p.” The truth value of the negation
of p, ¬p, is the opposite of the truth value of p.

EXAMPLE 3
Find the negation of the proposition

“Today is Friday”

and express this in simple English.

Solution: The negation is

“It is not the case that today is Friday.”

This negation can be more simply expressed as

“Today is not Friday.”

or

“It is not Friday today.”

Prepared by: Mr. Kenneth V. Bautista 2 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

EXAMPLE 4
Find the negation of the proposition

“At least 10 inches of rain fell today in Miami.”

and express this in simple English.

Solution: The negation is

“It is not the case that at least 10 inches of rain fell today in Miami.”

This negation can also be expressed as

“Less than 10 inches of rain fell today in Miami.”

TABLE 1 The Truth Table for


the Negation of a Proposition.

p ¬p

T F

F T

Table 1 displays the truth table for the negation of a proposition p. This table has a
row for each of the two possible truth values of a proposition p. Each row shows the
truth value of ¬p corresponding to the truth value of p for this row.

The negation of a proposition can also be considered the result of the operation of the
negation operator on a proposition. The negation operator constructs a new
proposition from a single existing proposition. We will now introduce the logical
operators that are used to form new propositions from two or more existing
propositions. These logical operators are also called connectives.

DEFINITION 2 Let p and q be propositions. The conjunction of p and q, denoted by


p ∧ q, is the proposition “p and q.” The conjunction p ∧ q is true when
both p and q are true and is false otherwise.

TABLE 2 The Truth Table for the Conjunction


of Two Propositions.

p q p∧q

T T T

T F F

F T F

F F F

Prepared by: Mr. Kenneth V. Bautista 3 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

Table 2 displays the truth table of p ∧ q. This table has a row for each of the four
possible combinations of truth values of p and q. The four rows correspond to the
pairs of truth values TT, TF, FT, and FF, where the first truth value in the pair is the
truth value of p and the second truth value is the truth value of q.

Note that in logic the word “but” sometimes is used instead of “and” in a conjunction.
For example, the statement “The sun is shining, but it is raining” is another way of
saying “The sun is shining and it is raining.” (In natural language, there is a subtle
difference in meaning between “and” and “but”; we will not be concerned with this
nuance here.)

EXAMPLE 5
Find the conjunction of the propositions p and q where p is the proposition “Today is
Friday” and q is the proposition “It is raining today”.

Solution: The conjunction of these propositions, p ∧ q, is the proposition

“Today is Friday and it is raining today.”

This proposition is true on rainy Fridays and is false on any day that is not a Friday
and on Fridays when it does not rain.

DEFINITION 3 Let p and q be propositions. The disjunction of p and q, denoted by


p ∨ q, is the proposition “p or q.” The conjunction p ∨ q is false when
both p and q are false and is true otherwise.

TABLE 3 The Truth Table for the Disjunction


of Two Propositions.

p q p∨q

T T T

T F T

F T T

F F F

Table 3 displays the truth table for p ∨ q.

The use of the connective or in a disjunction corresponds to one of the two ways the
word or is used in English, namely, as an inclusive or. A disjunction is true when at
least one of the two propositions is true. For instance, the inclusive or is being used in
the statement

“Students who have taken calculus or computer science can take this class.”
Here, we mean that students who have taken both calculus and computer science can
take the class, as well as the students who have taken only one of the two subjects. On
the other hand, we are using the exclusive or when we say

Prepared by: Mr. Kenneth V. Bautista 4 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

“Students who have taken calculus or computer science, but not both, can enroll
in this class.”

Here, we mean that students who have taken both calculus and a computer science
course cannot take the class. Only those who have taken exactly one of the two courses
can take the class.

Similarly, when a menu at a restaurant states, “Soup or salad comes with an entrée,”
the restaurant almost always means that customers can have either soup or salad, but
not both. Hence, this is an exclusive, rather than an inclusive, or.

EXAMPLE 6
What is the disjunction of the propositions p and q where p and q are the same
propositions as in Example 5?

Solution: The disjunction of p and q, p ∨ q, is the proposition

“Today is Friday or it is raining today.”

This proposition is true on any day that is either a Fridays or a rainy day (including
rainy Fridays). It is only false on days that are not Fridays when it also does not rain.

As was previously remarked, the use of the connective or in a disjunction corresponds


to one of the two ways the word or is used in English, namely, in an inclusive way.
Thus, a disjunction is true when at least one of the two propositions in it is true.
Sometimes, we use or in an exclusive sense. When the exclusive or is used to connect
the propositions p and q, the proposition “p or q (but not both)” is obtained. This
proposition is true when p is true and q is false, and when p is false and q is true. It is
false when both p and q are false and when both are true.

DEFINITION 4 Let p and q be propositions. The exclusive or of p and q, denoted by


p ⊕ q, is the proposition that is true when exactly one of p and q is
true and is false otherwise.

TABLE 4 The Truth Table for the Exclusive Or


of Two Propositions.

p q p⊕q

T T F

T F T

F T T

F F F

The truth table for the exclusive or of two propositions is displayed in Table 4.

Prepared by: Mr. Kenneth V. Bautista 5 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

B. CONDITIONAL STATEMENTS
We will discuss several other important ways in which propositions can be combined.

DEFINITION 5 Let p and q be propositions. The conditional statement p → q is the


proposition “if p, then q.” The conditional statement p → q is false
when p is true and q is false, and true otherwise.

In the conditional statement p → q, p is called the hypothesis (or


antecedent or premise) and q is called the conclusion (or
consequence).

The statement p → q is called a conditional statement because p → q asserts that q is


true on the condition that p holds. A conditional statement is also called an
implication.

TABLE 5 The Truth Table for the Conditional


Statement p → q.

p q p→q

T T T

T F F

F T T

F F T

The truth table for the conditional statement p → q is shown in Table 5. Note that the
statement p → q is true when both p and q are true and when p is false (no matter
what truth value q has).

Because conditional statements play such an essential role in mathematical


reasoning, a variety of terminology is used to express p → q. You will encounter most
if not all of the following ways to express this conditional statement:

“if p, then q” “p implies q”


“if p, q” “p only if q”
“p is sufficient for q” “a sufficient condition for q is p”
“q if p” “q whenever p”
“q when p” “q is necessary for p”
“a necessary condition for p is q” “q follows from p”
“q unless ¬p”

A useful way to understand the truth value of a conditional statement is to think of an


obligation or a contract. For example, the pledge many politicians make when running
for office is

“If I am elected, then I will lower taxes.”

Prepared by: Mr. Kenneth V. Bautista 6 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

If the politician is elected, voters would expect this politician to lower taxes.
Furthermore, if the politician is not elected, then voters will not have any expectation
that this person will lower taxes, although the person may have sufficient influence to
cause those in power to lower taxes. It is only when the politician is elected but does
not lower taxes that voters can say that the politician has broken the campaign pledge.
This last scenario corresponds to the case when p is true but q is false in p → q.

Many people find it confusing that “p only if q” expresses the same thing as “if p, then
q,” To remember this, note that “p only if q” says that p cannot be true when q is not
true. That is, the statement is false if p is true, but q is false. When p is false, q may be
either true or false, because the statement says nothing about the truth value of q. A
common error is for people to think that “q only if p” is a way of expressing p → q.
However, these statements have different truth values when p and q have different
truth values.

The word “unless” is often used to express conditional statements. Observe that “q
unless ¬p” means that if ¬p is false, then q must be true. That is, the statement “q
unless ¬p” is false when p is true and q is false, but it is true otherwise. Consequently,
“q unless ¬p” and p → q always have the same truth value.

We illustrate the translation between conditional statements and English statements


in Example 7.

EXAMPLE 7
Let p be the statement “Maria learns discrete mathematics” and q the statement
“Maria will find a good job.” Express the statement p → q as a statement in English.

Solution: From the definition of conditional statements, we see that when p is the
statement “Maria learns discrete mathematics” and q is the statement “Maria will find
a good job,” p → q represents the statement

“If Maria learns discrete mathematics, then she will find a good job.”

There are many other ways to express this conditional statement in English. Among
the most natural of these are:

“Maria will find a good job when she learns discrete mathematics.”

“For Maria to get a good job, it is sufficient for her to learn discrete mathematics.”

and

“Maria will find a good job unless she does not learn discrete mathematics.”

Note that the way we have defined conditional statements is more general than the
meaning attached to such statements in the English language. For instance, the
conditional statement in Example 7 and the statement

“If it is sunny, then we will go to the beach.”

Prepared by: Mr. Kenneth V. Bautista 7 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

are statements used in normal language where there is a relationship between the
hypothesis and the conclusion. Further, the first of these statements is true unless
Maria learns discrete mathematics, but she does not get a good job, and the second is
true unless it is indeed sunny, but we do not go to the beach. On the other hand, the
statement

“If today is Friday, then 2 + 3 = 5.”

is true from the definition of a conditional statement, because its conclusion is true.
(The truth value of the hypothesis does not matter then.) The conditional statement

“If Juan has a smartphone, then 2 + 3 = 6.”

is true every day except Friday, even though 2 + 3 = 6 is false.

We would not use these last two conditional statements in natural language (except
perhaps in sarcasm), because there is no relationship between the hypothesis and the
conclusion in either statement. In mathematical reasoning, we consider conditional
statements of a more general sort than we use in English. The mathematical concept
of a conditional statement is independent of a cause-and-effect relationship between
hypothesis and conclusion. Our definition of a conditional statement specifies its truth
values; it is not based on English usage. Propositional language is an artificial
language; we only parallel English usage to make it easy to use and remember.

The if-then construction used in many programming languages is different from that
used in logic. Most programming languages contain statements such as if p then S,
where p is a proposition and S is a program segment (one or more statements to be
executed). When execution of a program encounters such a statement, S is executed
if p is true, but S is not executed if p is false, as illustrated in Example 8.

EXAMPLE 8
What is the value of the variable x after the statement

if 2 + 2 = 4 then x := x + 1

if x = 0 before this statement is encountered? (The symbol := stands for assignment.


The statement x := x + 1 means the assignment of the value of x + 1 to x.)

Solution: Because 2 + 2 = 4 is true, the assignment statement x := x + 1 is executed.


Hence, x has the value 0 + 1 = 1 after this statement is encountered.

CONVERSE, CONTRAPOSITIVE, AND INVERSE We can form some new conditional


statements starting with a conditional statement p → q. In particular, there are three
related conditional statements that occur so often that they have special names. The
proposition q → p is called the converse of p → q. The contrapositive of p → q is the
proposition ¬q → ¬p. The proposition ¬p → ¬q is called the inverse of p → q. We will
see that of these three conditional statements formed from p → q, only the
contrapositive always has the same truth value as p → q.

Prepared by: Mr. Kenneth V. Bautista 8 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

We first show that the contrapositive, ¬q → ¬p, of a conditional statement p → q


always has the same truth value as p → q. To see this, note that the contrapositive is
false only when ¬p is false and ¬q is true, that is, only when p is true and q is false.
We now show that neither the converse, q → p, nor the inverse, ¬p → ¬q, has the same
truth value as p → q for all possible truth values of p and q. Note that when p is true
and q is false, the original conditional statement is false, but the converse and the
inverse are both true.

When two compound propositions always have the same truth value we call them
equivalent, so that a conditional statement and its contrapositive are equivalent. The
converse and the inverse of a conditional statement are also equivalent, as the reader
can verify, but neither is equivalent to the original conditional statement. (We will
study equivalent propositions in Module 2.) Take note that one of the most common
logical errors is to assume that the converse or the inverse of a conditional statement
is equivalent to this conditional statement.

We illustrate the use of conditional statements in Example 9.

EXAMPLE 9
What are the contrapositive, the converse, and the inverse of the conditional
statement

“The home team wins whenever it is raining?”

Solution: Because “q whenever p” is one of the ways to express the conditional


statement p → q, the original statement can be rewritten as

“If it is raining, then the home team wins.”

Consequently, the contrapositive of this conditional statement is

“If the home team does not win, then it is not raining.”

The converse is

“If the home team wins, then it is raining.”

The inverse is

“If it is not raining, then the home team does not win.”

Only the contrapositive is equivalent to the original statement.

BICONDITIONALS We now introduce another way to combine propositions that


expresses that two propositions have the same truth value.

DEFINITION 6 Let p and q be propositions. The biconditional statement p ↔ q is


the proposition “p if and only if q.” The biconditional statement p ↔
q is true when p and q have the same truth values, and is false
otherwise. Biconditional statements are also called bi-implications.

Prepared by: Mr. Kenneth V. Bautista 9 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

TABLE 6 The Truth Table for Biconditional


Statement p ↔ q.

p q p↔q

T T T

T F F

F T F

F F T

The truth table for p ↔ q is shown in Table 6. Note that the statement p ↔ q is true
when both the conditional statements p → q and q → p are true and is false otherwise.
That is why we use the words “if and only if” to express this logical connective and
why it is symbolically written by combining the symbols → and ←. There are some
other common ways to express p ↔ q:

“p is necessary and sufficient for q”


“if p then q, and conversely”
“p iff q.”

The last way of expressing the biconditional statement p ↔ q uses the abbreviation
“iff” for “if and only if.” Note that p ↔ q has exactly the same truth value as (p → q) ∧
(q → p).

EXAMPLE 10
Let p be the statement “You can take the flight,” and let q be the statement “You buy a
ticket.” Then p ↔ q is the statement

“You can take the flight if and only if you buy a ticket.”

This statement is true if p and q are either both true or both false, that is, if you buy a
ticket and can take the flight or if you do not buy a ticket and you cannot take the flight.
It is false when p and q have opposite truth values, that is, when you do not buy a
ticket, but you can take the flight (such as when you get a free trip) and when you buy
a ticket but you cannot take the flight (such as when the airline bumps you).

C. Truth Tables of Compound Propositions


We have now introduced four important logical connectives—conjunctions,
disjunctions, conditional statements, and biconditional statements—as well as
negations. We can use these connectives to build up complicated compound
propositions involving any number of propositional variables. We can use truth tables
to determine the truth values of these compound propositions, as Example 11
illustrates. We use a separate column to find the truth value of each compound
expression that occurs in the compound proposition as it is built up. The truth values
of the compound proposition for each combination of truth values of the propositional
variables in it is found in the final column of the table.

Prepared by: Mr. Kenneth V. Bautista 10 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

EXAMPLE 11
Construct the truth table of the compound proposition

(p ∨ ¬q) → (p ∧ q).

Solution: Because this truth table involves two propositional variables p and q, there
are four rows in this truth table, one for each of the pairs of truth values TT, TF, FT,
and FF. The first two columns are used for the truth values of p and q, respectively. In
the third column we find the truth value of ¬q, needed to find the truth value of
p ∨ ¬q, found in the fourth column. The fifth column gives the truth value of p ∧ q.
Finally, the truth value of (p ∨ ¬q) → (p ∧ q) is found in the last column. The resulting
truth table is shown in Table 7.

TABLE 7 The Truth Table of (p ∨ ¬q) → (p ∧ q).

p q ¬q p ∨ ¬q p∧q (p ∨ ¬q) → (p ∧ q)

T T F T T T

T F T T F F

F T F F F T

F F T T F F

D. PRECEDENCE OF LOGICAL OPERATORS


We can construct compound propositions using the negation operator and the logical
operators defined so far. We will generally use parentheses to specify the order in
which logical operators in a compound proposition are to be applied. For instance, (p
∨ q) ∧ (¬r) is the conjunction of p ∨ q and ¬r. However, to reduce the number of
parentheses, we specify that the negation operator is applied before all other logical
operators. This means that ¬p ∧ q is the conjunction of ¬p and q, namely, (¬p) ∧ q,
not the negation of the conjunction of p and q, namely ¬(p ∧ q).

Another general rule of precedence is that the conjunction operator takes precedence
over the disjunction operator, so that p ∧ q ∨ r means (p ∧ q) ∨ r rather than p ∧ (q ∨
r). Because this rule may be difficult to remember, we will continue to use parentheses
so that the order of the disjunction and conjunction operators is clear.

Finally, it is an accepted rule that the conditional and biconditional operators → and
↔ have lower precedence than the conjunction and disjunction operators, ∧ and ∨.
Consequently, p ∨ q → r is the same as (p ∨ q) → r. We will use parentheses when the
order of the conditional operator and biconditional operator is at issue, although the
conditional operator has precedence over the biconditional operator.

Table 8 displays the precedence levels of the logical operators, ¬, ∧, ∨, →, and ↔.

Prepared by: Mr. Kenneth V. Bautista 11 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

TABLE 8 Precedence of
Logical Operators.

Operator Precedence

¬ 1

∧ 2

∨ 3

→ 4

↔ 5

E. TRANSLATING ENGLISH SENTENCES


There are many reasons to translate English sentences into expressions involving
propositional variables and logical connectives. In particular, English (and every
other human language) is often ambiguous. Translating sentences into compound
statements (and other types of logical expressions, which we will introduce later in
this chapter) removes the ambiguity. Note that this may involve making a set of
reasonable assumptions based on the intended meaning of the sentence. Moreover,
once we have translated sentences from English into logical expressions we can
analyze these logical expressions to determine their truth values, we can manipulate
them, and we can use rules of inference (which will be discussed in Module 3) to
reason about them.

To illustrate the process of translating an English sentence into a logical expression,


consider Examples 12 and 13.

EXAMPLE 12
How can this English sentence be translated into a logical expression?

“You can access the Internet from campus only if you are a computer science
major or you are not a freshman.”

Solution: There are many ways to translate this sentence into a logical expression.
Although it is possible to represent the sentence by a single propositional variable,
such as p, this would not be useful when analyzing its meaning or reasoning with it.
Instead, we will use propositional variables to represent each sentence part and
determine the appropriate logical connectives between them.

In particular, we let a, c, and f represent “You can access the Internet from campus”,
“You are a computer science major”, and “You are a freshman”, respectively. Noting
that “only if” is one way a conditional statement can be expressed, this sentence can
be represented as

a → (c ∨ ¬f ).

Prepared by: Mr. Kenneth V. Bautista 12 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

EXAMPLE 13
How can this English sentence be translated into a logical expression?

“You cannot ride the roller coaster if you are under 4 feet tall unless you are older
than 16 years old.”

Solution: Let q, r, and s represent “You can ride the roller coaster,” “You are under 4
feet tall,” and “You are older than 16 years old,” respectively. Then the sentence can
be translated to

(r ∧ ¬s) → ¬q.

Of course, there are other ways to represent the original sentence as a logical
expression, but the one we have used should meet our needs.

F. LOGIC PUZZLES
Puzzles that can be solved using logical reasoning are known as logic puzzles. Solving
logic puzzles is an excellent way to practice working with the rules of logic. Also,
computer programs designed to carry out logical reasoning often use well-known
logic puzzles to illustrate their capabilities. Many people enjoy solving logic puzzles,
published in periodicals, books, and on the Web, as a recreational activity.

We will discuss two logic puzzles here. We begin with a puzzle originally posed by
Raymond Smullyan, a master of logic puzzles, who has published more than a dozen
books containing challenging puzzles that involve logical reasoning.

RAYMOND SMULLYAN (BORN 1919) Raymond Smullyan has


written many books on recreational logic and mathematics. Because
his logic puzzles are challenging, entertaining, and thought-
provoking, he is considered to be a modern-day Lewis Carroll. He
has written several books about the application of deductive logic to
chess, three collections of philosophical essays and aphorisms, and
several advanced books on mathematical logic and set theory.

EXAMPLE 14
In [Sm78] Smullyan posed many puzzles about an island that has two kinds of
inhabitants, knights, who always tell the truth, and their opposites, knaves, who
always lie. You encounter two people A and B. What are A and B if A says “B is a knight”
and B says “The two of us are opposite types?”

Solution: Let p and q be the statements that A is a knight and B is a knight, respectively,
so that ¬p and ¬q are the statements that A is a knave and B is a knave, respectively.

We first consider the possibility that A is a knight; this is the statement that p is true.
If A is a knight, then he is telling the truth when he says that B is a knight, so that q is
true, and A and B are the same type. However, if B is a knight, then B’s statement that
A and B are of opposite types, the statement (p ∧ ¬q) ∨ (¬p ∧ q), would have to be
true, which it is not, because A and B are both knights. Consequently, we can conclude
that A is not a knight, that is, that p is false.

Prepared by: Mr. Kenneth V. Bautista 13 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

If A is a knave, then because everything a knave says is false, A’s statement that B is a
knight, that is, that q is true, is a lie. This means that q is false and B is also a knave.
Furthermore, if B is a knave, then B’s statement that A and B are opposite types is a
lie, which is consistent with both A and B being knaves. We can conclude that both A
and B are knaves.

EXAMPLE 15
A father tells his two children, a boy and a girl, to play in their backyard without
getting dirty. However, while playing, both children get mud on their foreheads. When
the children stop playing, the father says “At least one of you has a muddy forehead,”
and then asks the children to answer “Yes” or “No” to the question: “Do you know
whether you have a muddy forehead?” The father asks this question twice. What will
the children answer each time this question is asked, assuming that a child can see
whether his or her sibling has a muddy forehead, but cannot see his or her own
forehead? Assume that both children are honest and that the children answer each
question simultaneously.

Solution: Let s be the statement that the son has a muddy forehead and let d be the
statement that the daughter has a muddy forehead. When the father says that at least
one of the two children has a muddy forehead, he is stating that the disjunction s ∨ d
is true. Both children will answer “No” the first time the question is asked because
each sees mud on the other child’s forehead. That is, the son knows that d is true, but
does not know whether s is true, and the daughter knows that s is true, but does not
know whether d is true.

After the son has answered “No” to the first question, the daughter can determine that
d must be true. This follows because when the first question is asked, the son knows
that s ∨ d is true, but cannot determine whether s is true. Using this information, the
daughter can conclude that d must be true, for if d were false, the son could have
reasoned that because s ∨ d is true, then s must be true, and he would have answered
“Yes” to the first question. The son can reason in a similar way to determine that s
must be true. It follows that both children answer “Yes” the second time the question
is asked.

IV. TEACHING AND LEARNING MATERIALS RESOURCES


Hardware Device: Desktop Computer/ Laptop/ Mobile Phone
Application Software: GC-LAMP; Google Meet; Facebook

V. LEARNING TASKS
EXERCISES:
1. Which of these sentences are propositions? What are the truth values of those that
are propositions?
a. Boston is the capital of Massachusetts.
b. Miami is the capital of Florida.
c. 2 + 3 = 5.
d. 5 + 7 = 10.
e. x + 2 = 11.
f. Answer this question.

Prepared by: Mr. Kenneth V. Bautista 14 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.
Discrete Structures 2: PROPOSITIONAL LOGIC | Module No. 1

2. What is the negation of each of these propositions?


a. Today is Thursday.
b. There is no pollution in New Jersey.
c. 2 + 1 = 3.
d. The summer in Maine is hot and sunny.

3. Let p and q be the propositions


p: Swimming at the New Jersey shore is allowed.
q: Sharks have been spotted near the shore.
Express each of these propositions as an English sentence.
a. ¬q
b. p ∧ q
c. ¬p ∨ q
d. p → ¬q
e. ¬q → p
f. ¬p → ¬q
g. p ↔ ¬q
h. ¬p ∧ (p ∨ ¬q)

4. Let p and q be the propositions


p: It is below freezing. q: It is snowing.
Write these propositions using p and q and logical connectives.
a. It is below freezing and snowing.
b. It is below freezing but not snowing.
c. It is not below freezing and not snowing.
d. It is either snowing or below freezing (or both).
e. If it is below freezing, it is also snowing.
f. If is either below freezing or it is snowing, but it is not snowing if it is below
freezing.
g. That it is below freezing is necessary and sufficient for it to be snowing.

5. State the converse, contrapositive, and inverse of each of the following conditional
statements.
a. If it snows today, I will ski tomorrow.
b. I come to class whenever there is going to be a quiz.
c. A positive integer is a prime only if it has no divisors other than 1 and itself.
d. I go to the beach whenever it is a sunny summer day.
e. When I stay up late, it is necessary that I sleep until noon.

RUBRIC:
3 2 1 0

Answers all parts of Answers part of the Attempts to answer


Does not answer the
the question correctly question or is the question but is
question
and thoroughly partially correct incorrect

VI. REFERENCE
 Rosen, K. H. (2018). Discrete Mathematics and Its Applications, Eighth Edition.
McGraw-Hill.

Prepared by: Mr. Kenneth V. Bautista 15 | 15


EXCLUSIVE FOR GORDON COLLEGE ONLY.

You might also like