0% found this document useful (0 votes)
15 views28 pages

CH 1 1 Introduction and Propositional Logic

The document introduces discrete mathematics and propositional logic. It discusses topics in discrete mathematics including logic, proofs, sets, counting, graphs and number theory. It also covers logical connectives such as negation, conjunction, disjunction, implication and biconditional. Truth tables are provided for each logical connective.

Uploaded by

Rubayet fahim
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)
15 views28 pages

CH 1 1 Introduction and Propositional Logic

The document introduces discrete mathematics and propositional logic. It discusses topics in discrete mathematics including logic, proofs, sets, counting, graphs and number theory. It also covers logical connectives such as negation, conjunction, disjunction, implication and biconditional. Truth tables are provided for each logical connective.

Uploaded by

Rubayet fahim
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/ 28

Lecture 1

Introduction to Discrete Mathematics and


Propositional Logic

S. Ahmed CSE173 Discrete Mathematics 1


Discrete Mathematics: Introduction
• Discrete vs. Continuous
• Continuous math example:
– Given a fixed surface area, what are the dimensions of a cylinder
that maximizes volume?
• Discrete math example:
– Given a fixed set of characters, and a length, how many different
passwords can you construct?
– How many edges are there in a graph with n vertices?

S. Ahmed CSE173 Discrete Mathematics 2


Why study Discrete Mathematics
• Provides mathematical foundations for:
– Data structures
– Algorithms
– Database theory
– Automata theory
– Formal languages
– Compiler theory
– Computer security
– Operating Systems, etc.

S. Ahmed CSE173 Discrete Mathematics 3


Discrete Mathemetics: Topics
1. Logic
2. Method of proofs
3. Set theory
4. Functions and relations
5. Sums and recurrence relations
6. Counting
7. Probability
8. Graphs
9. Trees
10. Number theory

S. Ahmed CSE173 Discrete Mathematics 4


Logic
• Proposition
– A proposition is a declarative sentence (i.e. A sentence that
declares a fact) which is either true or false, but not both.
– Example:
1. Washington, D.C., is the capital of the USA. True

2. Toronto is the capital of Canada. False


3. 1+1 = 2. True
4. 2+2 = 3. False
5. What time is it?
6. Read this carefully.
7. X+1 = 3.
8. X+Y = Z.

S. Ahmed CSE173 Discrete Mathematics 5


Proposition
Exercise:
Which of these are propositions? What are the truth values
of those that are propositions? Justify your answer.
a) Do not pass go.
b) What time is it?
c) There are no black flies in Maine.
d) 4 + x = 5.
e) The moon is made of green cheese.
f) 2𝑛 ≥ 100.

S. Ahmed CSE173 Discrete Mathematics 6


Proposition
• Letters are used to denote propositions, just as letters
are used to denote variables.
• Conventional letters: p, q, r, s, ...
• True proposition T
• False proposition F
• The area of logic that deals with propositions is called
propositional calculus or propositional logic.

S. Ahmed CSE173 Discrete Mathematics 7


Compound propositions
• New propositions called compound propositions are
formed from existing propositions using logical
operators.
• Logical operators:
– Negation
– Conjunction
– Disjunction
– Exclusive OR
– Implication
– Biconditional

S. Ahmed CSE173 Discrete Mathematics 8


Negation
• Let p be a proposition. The negation of p is the
statement
“It is not the case that p.”
• Denoted by ¬𝑝 and also 𝑝ҧ
• The truth value of ¬𝑝 is the opposite of the truth value of
𝑝.

𝑝 ¬𝑝
Table 1: The truth table for the
T F
negation of a proposition
F T

S. Ahmed CSE173 Discrete Mathematics 9


Negation
Example 1:
Find the negation of the proposition
“Michael‘s PC runs Linux.”
and express this in simple English.
Solution:
• “It is not the case that Michael’s PC runs Linux.”
More simply
• “Michael’s PC does not run Linux.”

S. Ahmed CSE173 Discrete Mathematics 10


Negation
Example 2:
Find the negation of the proposition
“Vandana’s smartphone has at least 32GB of memory.”
and express this in simple English.
Solution:
• “It is not the case that Vandana’s smartphone has at least
32 GB of memory.”
• “Vandana’s smartphone does not have at least 32GB of
memory.
• “Vandana’s smartphone has less than 32GB of memory.”

S. Ahmed CSE173 Discrete Mathematics 11


Conjunction
• Connective
• Let p and q be propositions. The conjunction of p and q
is the proposition
“p and q.”
• Denoted by “p ᴧ q”.
• The conjunction p ᴧ q is true when both p and q are true
and is false otherwise.
p q pᴧq
T T T Table 2: The truth table for the
T F F conjunction of two propositions
F T F
F F F

S. Ahmed CSE173 Discrete Mathematics 12


Conjunction
• Example:
Find the conjunction of the propositions p and q where p is the
proposition „Rebecca‘s PC has more than 16 GB free hard disk
space“ and q is the proposition „The processor in Rebecca‘s PC
runs faster than 1 GHz.“
• Solution:
– “Rebecca‘s PC has more than 16 GB free hard disk space, and
the processor in her PC runs faster than 1 GHz.”
Or more simply,
– “Rebecca‘s PC has more than 16 GB free hard disk space and
its processor runs faster than 1 GHz”
Note:
In logic the word “but” sometimes is used instead of “and” in a conjunction.

S. Ahmed CSE173 Discrete Mathematics 13


Disjunction
• Let p and q be propositions. The disjunction of p and q is
the proposition
“p or q.”
• Denoted by “p ˅ q”
• The disjunction p ˅ q is false when both p and q are
false and is true otherwise.
p q p˅q
T T T
• The “or” corresponds to
T F T
inclusive or.
F T T
• Inclusive or: A statement is
F F F
true when at least one of the
Table 3: The truth table for the
two propositions is true.
disjunction of two propositions
S. Ahmed CSE173 Discrete Mathematics 14
Disjunction
• Example:
Find the disjunction of the propositions p and q where p is the
proposition „Rebecca‘s PC has more than 16 GB free hard disk
space“ and q is the proposition „The processor in Rebecca‘s PC
runs faster than 1 GHz.“
• Solution:
– “Rebecca’s PC has at least 16 GB free hard disk space, or the
processor in Rebecca’s PC runs faster than 1 GHz”.

S. Ahmed CSE173 Discrete Mathematics 15


Exclusive OR
• Let p and q be propositions. The exclusive or of p and q
is the statement
“p or q (but not both)”
• Denoted by “p ⊕ q”
• It is true when exactly one of p and q is true and is false
otherwise.

p q p⊕q
T T F Table 4: The truth table for the
T F T exclusive or of two propositions
F T T
F F F

S. Ahmed CSE173 Discrete Mathematics 16


Conditional Statements
• Let p and q be propositions. The conditional statement
with p and q is
“if p, then q.”
• Denoted by “p → q”
• The conditional statement p → q is false when p is true
and q is false, and true otherwise.
• In p → q, p is called the hypothesis (or premise) and q is
called the conclusion (or consequence).
p q p→q
T T T
Table 5: The truth table for the
T F F
conditional statement p → q.
F T T
F F T

S. Ahmed CSE173 Discrete Mathematics 17


Conditional Statements
• Variety of terminology is used to express p → q:

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

S. Ahmed CSE173 Discrete Mathematics 18


Conditional Statements
Example:
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:
1. “if p, then q”
2. “q when p”
3. “a sufficient condition for q is p”
4. “q unless ¬p”
5. Etc.

S. Ahmed CSE173 Discrete Mathematics 19


Converse, Contrapositive, Inverse
Let p → q be the conditional statement of two propositions.
• Converse: q → p
• Contrapositive: ¬q → ¬p
• Inverse: ¬p → ¬q

Example:
What are the contrapositive, the converse and the inverse of the
conditional statement
“The home team wins whenever it is raining.”?
Solution:
(Done on the board)

S. Ahmed CSE173 Discrete Mathematics 20


Bi-conditional Statement
• Let p and q be propositions. The bi-conditional statement
is the proposition
“p if and only if q”
• Denoted by p ↔ q
• The bi-conditional statement p ↔ q is true when p and q
have the same truth values, and is false otherwise.
• These statements are also called bi-implications.
p q p↔q
T T T
Table 5: The truth table for the
T F F
bi- conditional statement p ↔ q.
F T F
F F T

S. Ahmed CSE173 Discrete Mathematics 21


Bi-conditional Statement
Example:
Let p and q be the propositions
p: “You can take the flight”
q: “You buy a ticket.”
Express the statement p ↔ q as an English statement.
Solution:
“You can take the flight if and only if you buy a ticket.”

S. Ahmed CSE173 Discrete Mathematics 22


Exercise Problem
Exercise 8
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.
a) ¬p e) p ↔ q

b) p v q f) ¬p → ¬q

c) p → q g) ¬p ᴧ ¬q

d) p ᴧ q h) ¬p v (p ᴧ q)

S. Ahmed CSE173 Discrete Mathematics 23


Truth Table of compound proposition
Example:
Construct the truth table of the compound proposition
(p v ¬q) → (p ᴧ q)

Solution:

p q ¬q p v ¬q pᴧq (p v ¬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

S. Ahmed CSE173 Discrete Mathematics 24


Precedence of Logical Operators

Operator Precedence
¬ 1 highest
ᴧ 2
v 3
→ 4
↔ 5 lowest

S. Ahmed CSE173 Discrete Mathematics 25


Logic and Bit Operations
• Bit: Binary Digit
0 => False
1 => True
• Boolean Variable: A variable is called a Boolean variable
if its value is either true or false.
• Table for bit operators (OR, AND, and XOR):
x y xvy xᴧy x⊕y
0 0 0 0 0
0 1 1 0 1
1 0 1 0 1
1 1 1 1 0

S. Ahmed CSE173 Discrete Mathematics 26


Bit String
• A bit string is a sequence of zero or more bits.
• The length of this string is the number of bits in the
string.
Example:

01 1011 0110
11 0001 1101

11 1011 1111 : bitwise OR


01 0001 0100 : bitwise AND
10 1010 1011 : bitwise XOR

S. Ahmed CSE173 Discrete Mathematics 27


Exercise Problem
Exercise 14
Let p, q, and r be the propositions
p: “You get an A on the final exam.”
q: “You do every exercise in this book.”
r: “You get an A in this class.”
Write these propositions using p, q, and r and logical connectives
(including negations).
a) You get an A in this class, but you do not do every exercise in this
book.
b) You get an A on the final, you do every exercise in this book, and you
get an A in this class.
c) To get an A in this class, it is necessary for you to get an A on the final.
d) You get an A on the final, but you don’t do every exercise in this book;
nevertheless, you get an A in this class.
e) Getting an A on the final and doing every exercise in this book is
sufficient for getting an A in this class.
f) You will get an A in this class if and only if you either do every exercise
in this book or you get an A on the final.

S. Ahmed CSE173 Discrete Mathematics 28

You might also like