Discrete Mathematics Chapter 1 Without Annotaton
Discrete Mathematics Chapter 1 Without Annotaton
Discrete Mathematics Chapter 1 Without Annotaton
MATHEMATICS
Rajeev Kumar Singh
Goals of this course
This course should teach how to think
logically and mathematically
1: Mathematical reasoning
2: Combinatorial analysis
3: Discrete Structures
4: Algorithmic thinking
soberly
philosophising
1921-Ludwig Wittgenstein-Tractatus
Logico philisophicus that logic cannot tell
us anything about the world but can only
clarify what we already know about the
world through non logical means
Propositional logic
A p r o p o s i t i o n i s a d e c l a ra t i ve s e n t e n c e t h a t i s e i t h e r t r u e o r f a l s e .
Examples of propositions:
b) Wa s h i n g t o n i s t h e c a p i t a l o f U S A .
d) 2 + 0 = 1
e) 0 + 1 = 2
f) Re a d t h i s c a r e f u l l y.
g) W h a t t i m e i s i t ?
h) x + 1 = 2
i) x + B = z
The area of logic that deals with proposition is called
propositional calculus /logic
Constructing Propositions:
P r o p o s i t i o n a l Va r i a b l e s : p , q , r , s , …
The proposition that is always true is denoted by T and the proposition that is always false is
denoted by F.
–N e g a t i o n ¬
–C o n j u n c t i o n ∧
–D i s j u n c t i o n ∨
–I m p l i c a t i o n →
–B i c o n d i t i o n a l ↔
Negation
T h e n e g a ti o n of a p r o p o s i t i o n p is denoted
by ¬p and has the truth table as shown:
E x am p l e : If p d e n o t e s “ I a m a t o ffi c e .” a n d
q d e n o t e s “ I t i s ra i n i n g t o d ay.” t h e n p ∧ q
d e n o te s “ I a m a t o ffi c e a n d i t i s ra i n i n g
t o d a y.”
Disjunction
E x a m p l e : I f p d e n o t e s “ I a m a t o ffi c e .” a n d
q d e n o t e s “ I t i s ra i n i n g t o d a y.” t h e n p ∨ q
d e n o t e s “ I a m a t o ffi c e o r i t i s r a i n i n g
t o d a y.”
In English “or” has
two distinct meanings.
Example: If p d e n o t e s “ I a m a t h o m e .” a n d q
d e n o t e s “ I t i s r a i n i n g .” t h e n p →q denotes “If I
a m a t h o m e t h e n i t i s r a i n i n g .”
In p → q there does not need to be any connection between the antecedent or the
consequent . The “meaning” of p → q depends only on the truth values of p and q .
“If the moon is made of green cheese, then I have more money than Bill Gates. ”
“If you get 100% on the fi nal, then you will get an A.”
If the politician is elected and does not lower taxes, then the voters
can say that he or she has broken the campaign pledge. Something
similar holds for the professor. This corresponds to the case where p
is true and q is false.
if p, q
if p, then q q unless ¬p
p only if q
p implies q q when p
Alternate
ways to
q whenever p q follows from p
q if p
p is q is necessary
express sufficient for q for p
conditional
a necessary a sufficient
statement condition for p is
q
condition for q is
p
q →p is the converse of p →q
If p d e n o t e s “ I a m a t h o m e .” a n d q denotes
“ I t i s r a i n i n g .” t h e n p ↔q denotes “I am
a t h o m e i f a n d o n l y i f i t i s r a i n i n g .”
Cont…
p iff q
Precedence
p q r i s e q u i va l e n t to ( p q ) r
t h e n p a r e n t h e se s m u s t b e u s e d .
Equivalence
Two p r opo si t io ns a re
e q u i va l en t i f t hey a lway s
have the s a me t r uth va lue .
“ I f I g o t o H a r r y ’s o r t o t h e c o u n t r y, I w i l l n o t g o s h o p p i n g .”
p : I g o t o H a r r y ’s
q : I g o t o t h e c o u n t r y.
r: I will go shopping.
Pr ob l em : Trans l a te t he foll ow ing s e nte nc e in to
p r opo si t i ona l l og i c:
a→ ( c ∨ ¬ f )
Example: Express in propositional logic:
System and
Software engineers
“The automated reply cannot be sent when the
take requirements file system is full”
in English and
express them in a
precise specifi cation Solution: Let p denote “The automated reply can
be sent” and q denote “The file system is full.”
language based on
logic
q→ ¬ p
Are these specifications consistent? Solution: Let p denote “The
• “The diagnostic message is stored diagnostic message is stored in the
buffer.” Let q denote “The diagnostic
in the buffer or it is retransmitted.”
message is retransmitted” The
Defi nition: A list of
• “The diagnostic message is not
specification can be written as: p ∨
stored in the buffer.”
• “If the diagnostic message is
q, ¬p, p → q. When p is false and propositions is
q is true all three statements are
stored in the buffer, then it is
retransmitted.”
true. So the specification is consistent if it is
consistent.
• What if “The diagnostic message is possible to assign
not retransmitted is added.”
• Solution: Now we are adding ¬q
and there is no satisfying
truth values to the
assignment. So the specification is
not consistent. proposition variables
so that each
proposition is true
An island has two kinds of inhabitants, knights, who
always tell the truth, and knaves, who always lie.
Yo u g o t o t h e i s l a n d a n d m e e t A a n d B .
A s a y s “ B i s a k n i g h t .”
B s a y s “ T h e t w o o f u s a r e o f o p p o s i t e t y p e s .”