0% found this document useful (0 votes)
60 views48 pages

The Foundations: Logic and Proofs: Discrete Mathematics and Its Applications

This document introduces propositional logic and its applications. It discusses that propositional logic is important for understanding mathematical reasoning and is used in computer science applications like circuit design and program verification. It defines basic concepts like propositions, propositional variables, negation, conjunction, and disjunction. Examples are provided to illustrate these concepts and how to determine the truth values of compound propositions using logical connectives.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views48 pages

The Foundations: Logic and Proofs: Discrete Mathematics and Its Applications

This document introduces propositional logic and its applications. It discusses that propositional logic is important for understanding mathematical reasoning and is used in computer science applications like circuit design and program verification. It defines basic concepts like propositions, propositional variables, negation, conjunction, and disjunction. Examples are provided to illustrate these concepts and how to determine the truth values of compound propositions using logical connectives.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 48

Propositional Logic Applications of Propositional Logic Propositional Equivalences

Chapter 1

The Foundations: Logic and Proofs

Discrete Mathematics and its Applications


Kenneth H.Rosen

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Outline

1 Propositional Logic

2 Applications of Propositional Logic

3 Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Why Discrete Mathematics?

Computer Science is about problem solving


Mathematics is at the heart of problem solving
Defining a problem requires mathematical rigor
Use and analysis of models, data structures, algorithms
requires a solid foundation of mathematics
To justify why a particular way of solving a problem is
correct or efficient (i.e., better than another way) requires
analysis with a well-defined mathematical model.

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Introduction

Since The goal of the course is to know how to understand


and how to construct a correct mathematical arguments, it
starts with introduction to logics.
Where logic are important to understand mathematical
reasoning and have applications to computer science.
The rules of logic give a precise meaning of mathematical
statements.
These rules are used to distinguish between valid and
invalid mathematical arguments.

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Introduction

Besides the importance of logic in understanding mathemati-


cal reasoning, logic has numerous applications to computer sci-
ence. 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.
We will discuss these applications of logic in this and later
chapters.

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Propositions

A proposition is a declarative sentence that is either true or


false but not both.
The truth-value of a proposition is “true” or “false.”

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Examples that are not propositions:

a Sit down! This is an imperative sentence, and not


declarative sentence , and hence it is not a proposition
b x + 1 = 2 Because this equation is true when x=1, and
false for other values , it is not proposition
c x+y=z
d What time is it?

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

propositional variables (or statement variables)

We use letters to denote propositional variables: : 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.

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Negation of a proposition

DEFINITION 1: Let p be a proposition. The negation of p, de-


noted by ¬p (also denoted by not 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.

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Negation of a proposition

Example : Negation of a proposition Find the negation of the


proposition “Michael’s PC runs Linux” and express this in
simple English.
Solution: The negation is “It is not the case that Michael’s PC
runs Linux” This negation can be more simply expressed as
“Michael’s PC does not run Linux.”

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Conjunction and Disjunction

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.
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
disjunction p ∨ q is false when both p and q are false and is
true otherwise.

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Corollary: Conjunction and Disjunction

A disjunction is true when at least one of the propositions


is true.
A conjunction is true when all of the propositions is true.

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Example: Conjunction and Disjunction

Example:Find the conjunction and disjunction of the proposi-


tions p and q where
p = “Rebecca’s PC has more than 16 GB free hard disk space”
q = “The processor in Rebecca’s PC runs faster than 1 GHz.”
Solution: Conjunction (p ∧ q): Rebecca’s PC has more than
16 GB free hard disk space, and the processor in her PC runs
faster than 1 GHz.
Disjunction (p ∨ q): Rebecca’s PC has more than 16 GB free
hard disk space, or the processor in her PC runs faster than 1
GHz.

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Example: Exclusive or

We are using the exclusive or when we say


“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.

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Conditional Statements(implication )

Example 1: If p denotes “I am at home.” and q denotes “It is


raining.” then p → q denotes “If I am at home then it is raining.”

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Conditional Statements(implication )
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
“If Maria learns discrete mathematics, then she will find a
good job.”
“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
Week 2
discrete mathematics.” Saudi Electronic University
Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Converse, Contrapositive, and Inverse

From p → q we can form new conditional statements .


q → p is the converse of p → q
¬q → p is the contrapositive of p → q
¬p → ¬q is the inverse of p → q
Example: Find the converse, inverse, and contrapositive of “It
raining is a sufficient condition for me not going to town.”
Solution:
converse: If I do not go to town, then it is raining.
inverse: If it is not raining, then I will go to town.
contrapositive: If I go to town, then it is not raining.

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Expressing the Biconditional

Some alternative ways “p if and only if q” is expressed in


English:

p is necessary and sufficient for q


if p then q , and conversely
p iff q
Order of operations: The logical operators in the innermost
parentheses are applied first. The negation operator is applied
before all other logical operators.

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Problem

Problem: How many rows are there in a truth table with n


propo- sitional variables?
Solution: 2n. We will see how to do this in Chapter 6.

Note that this means that with n propositional variables, we can


construct 2n distinct (i.e., not equivalent) propositions.

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Logic and Bit Operations

A bit has two possible values, zero (0) and one(1). A zero bit
represents “false”; a one bit represents “true.” There are bit op-
erations corresponding to logical conjunction (AND), disjunction
(OR), and exclusive or (XOR). A bit string is a sequence of
zero or more bits. The length of the string is the number of bits
in the string. The bit operations can be performed on two
strings of the same length by comparing respective bits.

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Translating English Sentences

“If I go to Harry’s or to the country, I will not go shopping.”


p: I go to Harry’s
q: I go to the country. r: I
will go shopping. If p
or q then not r.
(p ∨ q) → ¬r

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Example

Problem: Translate the following sentence into propositional


logic: “You can access the Internet from campus only if you are a
com- puter science major or you are not a freshman.”
One Solution: Let a, c, and f represent respectively “You can
access the internet from campus,” “You are a computer science
major,” and “You are a freshman.” a → (c ∨ ¬f )

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Key Logical Equivalences (cont)

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

De Morgan’s laws extend to

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Week 2 Saudi Electronic University


Discrete Mathematics
Propositional Logic Applications of Propositional Logic Propositional Equivalences

Example: Propositional Satisfiability

Determine whether (p ∨ ¬q) ∧ (q ∨ ¬r ) ∧ (r ∨ ¬p) is


satisfiable. Solution: Instead of using truth table to solve this
problem, we will reason about truth values. Note that (p ∨ ¬q)
∧ (q ∨ ¬r ) ∧ (r ∨ ¬p) is true when the three variable p, q, and r
have the same truth value. Hence, it is satisfiable as there is at
least one assignment of truth values for p, q, and r that makes
it true.

Week 2 Saudi Electronic University


Discrete Mathematics

You might also like