Discrete Structures CMSC 2123 1.1 Propositional Logic Definition 0 Example 1.1
Discrete Structures CMSC 2123 1.1 Propositional Logic Definition 0 Example 1.1
Discrete Structures CMSC 2123 1.1 Propositional Logic Definition 0 Example 1.1
DEFINITION 0 A proposition is a declarative sentence that is either true or false but not
both.
EXAMPLE 2.1 The following is not a declarative sentence because the sentence is not a
statement of a fact. The sentence is a question.
What time is it?
EXAMPLE 2.2 The following is not a declarative sentence because the sentence is not a
statement of a fact. The sentence is a command.
Read this carefully.
EXAMPLE 2.3 The following is not a declarative sentence because the sentence cannot be
shown to be either true or false.
𝑥𝑥 + 1 = 2
EXAMPLE 2.4 The following is not a declarative sentence because the sentence cannot be
shown to be either true or false.
𝑥𝑥 + 𝑦𝑦 = 𝑧𝑧
1
Discrete Structures Lecture 1
CMSC 2123 1.1 Propositional Logic
The proposition ¬𝑝𝑝 is read “not p.” The truth value of the negation of p, ¬𝑝𝑝,
is the opposite of the truth value of p.
“Today is Friday.”
2
Discrete Structures Lecture 1
CMSC 2123 1.1 Propositional Logic
“It is not the case that Vandana’s smartphone has at least 32GB of
memory.”
“It is not the case that at least 10 inches of rain fell today in Miami.”
REMARK 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 ¬𝒑𝒑 corresponding to the truth value of 𝒑𝒑 for
this row.
3
Discrete Structures Lecture 1
CMSC 2123 1.1 Propositional Logic
REMARK • 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.
• The logical operators are also called connectives.
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, 𝑝𝑝 ∧ 𝑞𝑞, is the proposition
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.
4
Discrete Structures Lecture 1
CMSC 2123 1.1 Propositional Logic
EXAMPLE 6 Find the disjunction 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 disjunction of these propositions, 𝑝𝑝 ∨ 𝑞𝑞, is the proposition
This proposition is true on any day that is either a Friday or a rainy day
(including rainy Fridays). It is only false on days that are not Fridays when it
also does not rain.
Conditional Statements
DEFINITION 5 Let p and q be propositions. The conditional statement, 𝑝𝑝 → 𝑞𝑞, is the
proposition “if p, then q.” The conditional statement 𝑝𝑝 → 𝑞𝑞 is false when p
is true and q is false, and true otherwise. In the conditional statement 𝑝𝑝 →
𝑞𝑞, p is called the hypothesis (or antecedent or premise) and q is called the
conclusion (or consequence).
5
Discrete Structures Lecture 1
CMSC 2123 1.1 Propositional Logic
EXAMPLE 7 Let p be the statement “Maria learns discrete mathematics” and q the
statement “Maria will find a good job.” Express the statement 𝑝𝑝 → 𝑞𝑞 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,” 𝑝𝑝 → 𝑞𝑞 represents the statement
“If Maria learns discrete mathematics, then she will find a good job.”
Alternatively:
“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.”
“Maria will find a good job unless she does not learn discrete
mathematics.”
if 2 + 2 = 4 then 𝑥𝑥 ≔ 𝑥𝑥 + 1
6
Discrete Structures Lecture 1
CMSC 2123 1.1 Propositional Logic
Implication 𝑝𝑝 → 𝑞𝑞 if p, then q
Converse of 𝑝𝑝 → 𝑞𝑞 𝑞𝑞 → 𝑝𝑝 if q, then p
Contrapositive 𝒑𝒑 → 𝒒𝒒 ¬𝒒𝒒 → ¬𝒑𝒑 if not q, then not p
Inverse 𝑝𝑝 → 𝑞𝑞 ¬𝑝𝑝 → ¬𝑞𝑞 if not p, then not q
• Only the contrapositive ¬𝒒𝒒 → ¬𝒑𝒑, has the same truth values as the implication 𝑝𝑝 → 𝑞𝑞.
• When two compound propositions have the same truth values they are called equivalent.
Equivalence is denoted by the operator ≡.
EXAMPLE 9 What are the contrapositive, the converse, and the inverse of the conditional
statement
contrapositive ¬𝑞𝑞 → ¬𝑝𝑝 “If the home team does not win, then it is not
raining.”
converse 𝑞𝑞 → 𝑝𝑝 “If the home team wins, then it is raining.”
inverse ¬𝑝𝑝 → ¬𝑞𝑞 “If it is not raining, then the home team does
not win.”
Note: Only the contrapositive is equivalent to the original statement.
7
Discrete Structures Lecture 1
CMSC 2123 1.1 Propositional Logic
The truth table for 𝑝𝑝 ↔ 𝑞𝑞 is shown in Table 6. Note that the statement 𝑝𝑝 ↔ 𝑞𝑞 is true when both
the conditional statements 𝑝𝑝 → 𝑞𝑞 and 𝑞𝑞 → 𝑝𝑝 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 other common ways to express 𝑝𝑝 ↔ 𝑞𝑞:
The last way of expressing the biconditional statement 𝑝𝑝 ↔ 𝑞𝑞 uses the abbreviation “iff” for “if
and only if.” Note that 𝑝𝑝 ↔ 𝑞𝑞 has exactly the same truth value as (𝑝𝑝 → 𝑞𝑞) ∧ (𝑞𝑞 → 𝑝𝑝).
EXAMPLE 10 Let p be the statement “You can take the flight” and q be the statement “You
buy a ticket.” Express the biconditional 𝑝𝑝 ↔ 𝑞𝑞 as an English sentence.
Solution: “You can take the flight if and only if you buy a ticket.”
8
Discrete Structures Lecture 1
CMSC 2123 1.1 Propositional Logic
“You can access the Internet from campus only if you are a computer
science major or you are not a freshman.”
“You cannot ride the roller coaster if you are under 4 feet tall unless you
are older than 16 years old.”
9
Discrete Structures Lecture 1
CMSC 2123 1.1 Propositional Logic
REMARK A bit is the contraction of binary digit, a zero (0) or a one (1).
DEFINITION 7 A bit string is a sequence of zero or more bits. The length of the string is the
number of bits in the string.
EXAMPLE 13 Find the bitwise OR, bitwise AND, and bitwise XOR, of the bit strings 01
1011 0110 and 11 0001 1101.
Solution:
0 1 1 0 1 1 0 1 1 0
1 1 0 0 0 1 1 1 0 1
OR 1 1 1 0 1 1 1 1 1 1
0 1 1 0 1 1 0 1 1 0
1 1 0 0 0 1 1 1 0 1
AND 0 1 0 0 0 1 0 1 0 0
0 1 1 0 1 1 0 1 1 0
1 1 0 0 0 1 1 1 0 1
XOR 1 0 1 0 1 0 1 0 1 0
10