You are on page 1of 40

Discrete Mathematics and Its Applications

Chapter 1: The Foundations:


Logic and Proofs
1
2 Why study discrete mathematics?

 Develop your mathematical maturity


 Provides the mathematical
foundations for many CS and IT
courses
3 The Foundations:
Logic and Proofs
 The rules of logic specify the
meaning of mathematical statements
 A proof is a valid argument that
establishes the truth of a
mathematical statement.
1.1 Propositional Logic
4

 A proposition is a declarative sentence (a


sentence that declares a fact) that is either true or
false, but not both.
 Are the following sentences propositions?
 Washington, D.C., is the capital of the United States of
America. (Yes)
 Read this carefully. (No)
 1+2=3 (Yes)
 x+1=2 (No)
 What time is it? (No)
 Y-7=8 (No)
 5*5=25 (Yes)
5 1.1 Propositional Logic

 Propositional Logic – the area of logic that deals


with propositions
 Propositional Variables – variables that represent
propositions: p, q, r, s
 E.g. Proposition p – “Today is Friday.”
 Truth values – T, F
6 Propositional Logic

 Let p - Washington, D.C., is the capital of the


United States of America. (T)
 Let p - 1+2=3 (T)
 Let p - 8-7=8 (F)
 Let p - 5*5=25 (T)
 Let p – Today is Saturday. (F)
Exercise 1:
7 Which of these sentences are propositions? What are
the truth values of those that are propositions?

 1. Batangas is located in the CALABARZON region.


 2. Cebu is the capital city of the Philippines.
 3. 2 + 3 = 5.
 4. 5 + 7 = 10.
 5. x + 2 = 11.
 6. Answer this question.
 7. Do not pass.
 8. What time is it?
 9. There are no black dogs in the Philippines.
 10. 4 + x = 5.
 11. The moon is made of green cheese.
 12. 2n ≥ 100.
1.1 Propositional Logic
8

DEFINITION 1
Let p be a proposition. The negation of p, 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.

 Examples
 Find the negation of the proposition “His new car is black.” and
express this in simple English.
Solution: The negation is “It is not the case that his new car is black.”
In simple English, “His new car is not black.”

 Find the negation of the proposition “At least 5 inches of rain fell today
in Ohio.” and express this in simple English.
Solution: The negation is “It is not the case that at least 5 inches
of rain fell today in Ohio.”
In simple English, “Less than 5 inches of rain fell today in
Ohio.”
9 Negation Operator Notation

 The notation for the negation operator is not


standardized.
 Although ¬ p and p are the most common notations
used in mathematics to express the negation of p,
other notations you might see are ∼p, −p, p′, Np, and
!p.
Negation of p
(¬p)
 Truth table:
  It is a mathematical table used in logic 
  It is basically used to check whether the propositional expression is
or false, as per the input values.

The Truth Table for the


Negation of a Proposition.
p ¬p
T F
F T
11 Negation of p
(¬p)
 Find the negation of the proposition “Angel’s smartphone has
at least 32 GB of memory” and express this in simple English.
 The negation is:
“It is not the case that Angel’s smartphone has at least 32 GB of
memory.”

 This negation can also be expressed as

“Angel’s smartphone does not have at least 32 GB of memory” or


even more simply as

“Angel’s smartphone has less than 32 GB of memory.”


12 Exercise 2:

What is the negation of each of these


propositions?
 Angel is younger than Wayne.
 Paul makes more money than Richard.
 Liz is taller than Abby.
 James is richer than Dwayne.
13 Logical Operators
 Logical operators are used to form new
propositions from two or more existing
propositions. The logical operators are also
called connectives.
14 1.1 Propositional Logic
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.

 Examples
 Find the conjunction of the propositions p and q where p is the
proposition “Today is Monday.” and q is the proposition “The weather
is cold and snowy.”, and the truth value of the conjunction.

Answer: The conjunction is the proposition “Today is Monday and


the weather is cold and snowy.” The proposition is true on cold
and snowy Mondays.
 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.”
15 Conjunction of p and q
(p Λ q)
 Find the conjunction of the propositions p and q where p is
the proposition “Lebron’s PC has more than 32 GB free hard
disk space” and q is the proposition “The processor in
Lebron’s PC runs faster than 4.1 GHz.”
 The conjunction of these propositions, p ∧ q, is the
proposition “Lebron’s PC has more than 16 GB free hard disk
space, and the processor in Lebron’s PC runs faster than 1 GHz.”
 This conjunction can be expressed more simply as “Lebron’s
PC has more than 16 GB free hard disk space, and its
processor runs faster than 4.1 GHz.”
 For this conjunction to be true, both conditions given must be
true. It is false when one or both of these conditions are false.
16 Conjunction of p and q
(p Λ q)

 Truth Table:

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
17 1.1 Propositional Logic
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.

inclusive or : The disjunction is true when at least one of the two


propositions is true.

 A disjunction is true when at least one of the two propositions is


true. That is, p ∨ q is true when both p and q are true or when
exactly one of p and q is true.
18 Disjunction of p and q
(p ν q)

 Find the disjunction of the propositions p and q where p is


the proposition “Lebron’s PC has more than 32 GB free
hard disk space” and q is the proposition “The processor in
Lebron’s PC runs faster than 4.1 GHz.”
 The disjunction of p and q, p ∨ q, is the proposition
 “Lebron’s PC has more than 32 GB free hard disk space, or
the processor in Lebron’s PC runs faster than 4.1 GHz.
19 Disjunction of p and q
(p ν q)

 Truth Table:

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
20 Truth value

 Today is Tuesday and tomorrow is


your birthday. (F)

 The clock is slow or the time is


correct. (T)
 cout is for C and printf is for C++.
(F)
21 1.1 Propositional Logic
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.

 Besides its use in disjunctions, the connective or is also used to


express an exclusive or.
 Unlike the disjunction of two propositions p and q, the exclusive
or of these two propositions is true when exactly one of p and q
is true; it is false when both p and q are true (and when both
are false).
22 Exclusive Or of p and q
(p ⊕ q (or pXOR q))

 Let p and q be the propositions that state “A student can


have a salad with dinner” and “A student can have soup
with dinner,” respectively. What is p ⊕ q, the exclusive or of
p and q?
 The exclusive or of p and q is the statement that is true
when exactly one of p and q is true. That is, p ⊕ q is the
statement “A student can have soup or salad, but not both,
with dinner.”
23
Exclusive Or of p and q
(p ⊕ q (or pXOR q))
 Truth Table:

The Truth Table for the


Exclusive Or (XOR) of
Two Propositions.
p q p ⊕ q
T T F
T F T
F T T
F F F
24 Exercise 3
 Let p and q be the propositions
 p: Angel had pasta last night
 q: Wayne finished his homework
 r: Ahki watched the NBA this morning

 Write the following statements in symbolic form:


 Wayne did not finish his homework
 Angel had pasta last night and Wayne finished his homework.
 Wayne did not finish his homework and Ahki watched the NBA this morning.
 Angel had pasta last night or Wayne finished his homework.
 Either Wayne finished his homework or Ahki watched the NBA this morning, but not both.
25
1.1 Propositional Logic
Conditional Statements
DEFINITION 5
Let p and q be propositions. The conditional statement p → q, 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
→ 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.

 Example: “If I am elected, then I will end corruption.” p→q


implication:
elected, end corruption. T T |T
not elected, end corruption. F T |T
not elected, not end corruption. F F |T
elected, not end corruption. T F |F
26 Conditional Statement
(p → q)

 Truth Table:
27 Conditional Statement
(p → q)
 If 2 + 1 = 4, then 1 + 4 = 3. (T)
 If 1 + 1 = 2, then cats can fly. (F)

 If today is Saturday, the 9>5. (T)

 If 2 + 2 = 4, then 1 + 2 = 3. (T)
28
Conditional Statement
(p → q)
 Example:
 Let p be the statement “Sandra learns discrete structures.” and q the
statement “Sandra will find a good job.” Express the statement p → q as
a statement in English.
Solution: Any of the following -
“If Sandra learns discrete structures, then she will find a
good job.
“Sandra will find a good job when she learns discrete
structures.”
“For Sandra to get a good job, it is sufficient for her to learn
discrete structures.”
“Sandra will find a good job unless she does not learn
discrete structures.”
29 Conditional Statement
(p → q)
 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:
30 Conditional Statement
(p → q)
 Let p and q be the propositions that state ”The
weather is cold” and “We will go to Tagaytay”
respectively
 Answer: Any of the following -
 “If the weather is cold, then we will go to Tagaytay”
 “We will go to Tagaytay, if the weather is cold”
 “We will go to Tagaytay when the weather is cold”
31 Exercise 4
 Let p and q be the propositions
 p: I bought a lottery ticket this week.
 q: I won the million dollar jackpot.
 Express each of these propositions as an English
sentence.
 ¬P
 ¬q
 p∨q
 p∧q
 p→q
32 1.1 Propositional Logic
 Other conditional statements:
 Converse of p → q : q → p
 Contrapositive of p → q : ¬ q → ¬ p
 Inverse of p → q : ¬ p → ¬ q
33
Inverse, Converse and
Contrapositive
34 Inverse, Converse and
Contrapositive
35 Converse, Contrapositive, and
Inverse
 Find the contrapositive, the converse, and the inverse of the conditional
statement
 “The home team wins whenever their superstars are playing.”
Because “q whenever p” is one of the ways to express the conditional
statement p → q,
 The original statement can be rewritten as “If their superstars are
playing, then the home team wins.”
 The converse is:
“If the home team wins, then their superstars are playing.”
 The contrapositive of this conditional statement is:
“If the home team does not win, then their superstars are not playing.”
 The inverse is:
“If their superstars are not playing, then the home team does not win.”
36 Exercise 5

 Let p and q be the propositions


 p: It is below freezing.
 q: It is snowing.
 Express each of these propositions as an English
sentence.
 Converse
 Contrapositive
 Inverse
37 1.1 Propositional Logic
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.

 p ↔ q has the same truth value as (p → q) Λ (q → p)


 “if and only if” can be expressed by “iff”
 Example:
 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.”
Implication:
If you buy a ticket you can take the flight.
If you don’t buy a ticket you cannot take the flight.
Biconditional statement
(p ↔ q)

The Truth Table for the


Biconditional p ↔ q.
p q p↔ q
T T T
T F F
F T F
F F T

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.” “p exactly when q.”
39 Exercise 6
 Let p and q be the propositions “Swimming at the New
 Jersey shore is allowed” and “Sharks have been spotted near
the shore,” respectively.
 Express each of these compound propositions as an English
sentence.
 ¬q
 p∧q
 p∨q
 p→¬q
 ¬q→p
 ¬p→q
 p↔¬q
40 References

 Discrete Mathematics and Its Applications Eighth Edition by


Kenneth H. Rosen
 https://www.tutorialspoint.com/discrete_mathematics/index.
htm

You might also like