CSE 4203 Discrete Mathematics: Mohammad Ridwan Kabir (MRK) Email: Cse - Ridwankabir@iut-Dhaka - Edu
CSE 4203 Discrete Mathematics: Mohammad Ridwan Kabir (MRK) Email: Cse - Ridwankabir@iut-Dhaka - Edu
DISCRETE MATHEMATICS
Mohammad Ridwan Kabir (MRK)
Email : [email protected]
Introduction
Contents
Discrete Mathematics and its applications-
7th edition – Kenneth H. Rosen
References and slides as provided in the
class.
Quizzes and Assignments
4 quizzes ( 2 before mid + 2 after mid ). Best
3 will be counted.
There will be surprise quizzes as well.
2 assignments will be given.
Chapter 1
The Foundations : Logic and Proofs
Kenneth H. Rosen 7th edition
Section 1.1 : Propositional Logic
Propositios
A declarative sentence, i.e. declares a fact
Either true
Or false
But not both
Logical Operators
T F
F T
Negation Operator (¬) (contd.)
Examples:
∶ “Adam has a high resolution PC.”
¬ :
“Adam does not have a high resolution PC.” Or,
“It is not the case that Adam has a high resolution PC.”
∧
F F F
F T F
T F F
T T T
Conjunction / AND operator ( ⋀ )(Contd.)
Examples:
∶ “Dean’s PC has more than 32GB of free hard disk
space.”
∶ “The processor in Dean’s PC runs faster than 1GHz.”
∧ :
“Dean’s PC has more than 32GB of free hard disk space and
the processor in Dean’s PC runs faster than 1GHz.” Or,
“Dean’s PC has more than 32GB of free hard disk space and its
processor runs faster than 1GHz.”
Disjunction / OR operator ( ∨ )
Definition:
Let and be propositions.
The disjunction of and , denoted by ∨ , is the
proposition “ .”
The disjunction ∨ is false when both and are
false and is true otherwise.
∨
F F F
F T T
T F T
T T T
Exclusive OR/ XOR operator ( ⨁ )
Definition:
Let and be propositions.
The exclusive or of and , denoted by ⊕ , is the
proposition “ ”.
The exclusive or ⊕ is true when EXACTLY ONE
of and is true and is false otherwise.
⨁
F F F
F T T
T F T
T T F
Conditionals/Implications
Definition:
Let and be propositions.
The conditional statement → is the proposition “ , .”
The conditional statement → is false when is true and is false,
and true otherwise.
In the conditional statement → ,
is called the hypothesis (or antecedent or premise)
is called the conclusion (or consequence).
→
F F T
F T T
T F F
T T T
Conditionals/Implications(Contd.)
Terminologies to express implication:
“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”
Conditionals/Implications(Contd.)
A useful way to understand the truth value of a
conditional statement is to think of an obligation or a
contract.
Confusions:
Of the various ways to express the conditional statement
→ , the two that seem to cause the most confusion
are
“ ”
“ ¬ ”
Conditionals/Implications(Contd.)
“ ”
Expresses the same thing as “ , .”
It means, cannot be true when is not true.
i.e. the statement is false if is true, but is false.
When is false, may be either true or false, because
the statement says nothing about the truth value of .
→ [ p only if q ]
F F T
F T T
T F F
T T T
Conditionals/Implications(Contd.)
“ ¬ ”
Expresses the same thing as “ , ,”
It means, if ¬ is false, then must be true.
i.e. the statement “ ¬ ” is false when is true
but is false, but it is true otherwise.
Consequently, “ ¬ ” and → always have
the same truth value.
→ [ q unless ¬p ]
F F T
F T T
T F F
T T T
Conditionals/Implications(Contd.)
Example 1:
Contrapositive:
“If the home team does not win, then it is not
raining.”
Inverse:
“If it is not raining, then the home team does not
win.”
Bi-conditionals
Definition:
Let and be propositions.
The bi-conditional statement ↔ is the proposition
“ .”
The bi-conditional statement ↔ is true when and have the
same truth values, and is false otherwise.
Bi-conditional statements are also called bi-implications.
↔
F F T
F T F
T F F
T T T
Bi-conditionals(Contd.)
Terminologies to express bi-conditionals:
“p if and only if q.”
“p is necessary and sufficient for q”
“if p then q, and conversely”
“p iff q.”
Bi-conditionals(Contd.)
Example 1:
: “You can take the flight,”
: “You buy a ticket.”
Then ↔ means,
“You can take the flight if and only if you buy a ticket.”
Implicit use:
Bi-conditionals are not always explicit in natural language
“if and only if” is rarely used in common language.
Often expressed using an “if, then” or an “only if” construction.
The other part of the “if and only if” is implicit.
That is, the converse is implied, but not stated.
We need to make an assumption whether a conditional
statement in natural language implicitly includes its converse
Bi-conditionals(Contd.)
Example of Implicit Use:
“If you finish your meal, then you can have dessert.”
What it really means:
“You can have dessert if and only if you finish your meal.”
This last statement is logically equivalent to the two
statements
“If you finish your meal, then you can have dessert”
And,
“You can have dessert only if you finish your meal.”
Truth table of compound propositions
Construct the truth table part by part in terms of logical
expressions.
Example 1:
Find the truth table of the following compound expression
∨¬ → ∧
Solution:
¬ ∨¬ ∧ ∨¬ → ∧
F F T T F F
F T F F F T
T F T T F F
T T F T T T
Precedence of Logical Operators
The operators with lower precedence values have higher
priorities.
That means, the operation of those operators must be
performed before that of the low priority operators.
Operators Precedence
¬ (Negation) 1
∧ (Conjunction) 2
∨ (Disjunction) 3
→ (Implication) 4
↔ (Bi-conditionals) 5
Precedence of Logical Operators(Contd.)
Example:
“¬ ∧ ” is the conjunction of ¬ and , namely,
“(¬ ) ∧ ”, NOT the negation of the conjunction of
and , namely “¬( ∧ )”.
“ ∧ ∨ ” means “( ∧ ) ∨ ” and NOT
“ ∧ ( ∨ )”.
“ ∨ → ” is the same as “( ∨ ) → ”.
Logic and Bit Operations
A bit is a symbol with two possible values,
0 (zero)
1 (one)
A bit can be used to represent a truth value, because
there are two truth values,
True (T)
False (F)
1 (one) represents T (true).
0 (zero) represents F (false).
Logic and Bit Operations(Contd.)
Logical operations using 1s (Ones) and 0s (Zeros)
∨ ∧ ⨁ → ↔
0 0 0 0 0 1 1
0 1 1 0 1 1 0
1 0 1 0 1 0 0
1 1 1 1 0 1 1
Logic and Bit Operations(Contd.)
Bit Strings
A bit string is a sequence of zero or more bits.
The length of this string is the number of bits in the
string.
101010011 is a bit string of length nine.
We can extend bit operations to bit strings.
We define the bitwise OR, bitwise AND, and bitwise
XOR of two strings of the same length to be the strings
that have as their bits, the OR,AND, and XOR of the
corresponding bits in the two strings, respectively.
We will split bit strings into blocks of four bits to make
them easier to read.
Logic and Bit Operations(Contd.)
Example 1:
Find the bitwise OR, bitwise AND, and bitwise XOR of
the bit strings 01 1011 0110 and11 0001 1101.
Solution: