DEMTH136 - DISCRETE - STRUCTURES SLM-36-46
DEMTH136 - DISCRETE - STRUCTURES SLM-36-46
DEMTH136 - DISCRETE - STRUCTURES SLM-36-46
Objectives:
Logic is one of humankind's oldest cognitive areas. It can be traced back to Aristotle. People
included Leibniz, Boole, Russell, Turing, and others have learned it over the years. It ‘still a topic of
active inquiry now a day. In "logic-enabled" computing systems, where users can display and
modify logical sentences, logic is also growing more popular at the human-machine interface.
Consider email readers that enable users to write rules to handle incoming mail messages
depending on message attributes, such as deleting some, sending some to other mailboxes, and so
on.
Introduction
Mathematical statements are given specific interpretations by logic laws. These laws are used to
determine which mathematical statements are true and which are false. We begin our review of
discrete mathematics with an introduction to logic since one of the main goals of this section to
understand and develop valid mathematical arguments. Logic has many uses in computer science,
in addition to its usefulness in explaining mathematical reasoning. These rules are used in a variety
of areas, including the design of electronic circuits, the development of computer systems, and the
checking of software correctness.
3.1 logic
Logic is thesystematic study of valid rules of inferences. More broadly logic is the analysis and
appraisal of arguments.
Rules of inferences:
A relation that leads to the acceptance of some conclusion based on some premises or a hypothesis.
LetX and Y are two friends and the age of X10-year, while Y is five-year-old hence X is
older than Y.So, we can frame a hypothesis H, logic L, and argument Athat can be valid or
invalid.
H: X is taller than Y
L:Footsteps of tallboys are larger than smaller ones
Now let us consider one argument
A: The X has larger footsteps than Y.
So based on hypothesis H, we can conclude the logic L,and using the logic L the argument
A is valid.
The foundation of logic is the propositions so we will focus on it.
3.2 Propositions
A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or
false, but not both.
Some of the above statements are decelerating the fact and are proposition can be seen in the
following table
Taj Mahal built on the southern bank of the Yes Yes True
river Yamuna
2 + 2 = 2 No No -
The true truth value of a proposition is denoted by T and the false truth value is denoted
by F.
p ¬p
T F
F T
q p∧q
p
T T
T
F F
T
T F
F
F F
F
Example:
T T
T
F T
T
T T
F
F F
F
T F
T
F T
T
T T
F
F F
F
Example:
Students who have taken Mathematics or computer science major can take this class.
Conditional Statements
Consider the propositions p and q. The proposition “if p, then q” is the conditional declaration p →
q. If p is true and q is false, the conditional assertion p → q is false; otherwise, it is true.
The theory is referred to as p in the conditional declaration p → q. (or antecedent or premise). The
conclusion is referred to as q. (or consequence).
Table 6 displays the truth table for p → q.
Example:
p q p→q
T T T
T F F
F T T
F F T
Converse
Consider the propositions p and q. The converse of conditional statement p → q is the proposition q
→p
Contrapositive
Consider the propositions p and q. The contrapositive of conditional statement p → q is the
proposition ¬q → ¬p.
Inverse
Consider the propositions p and q. The inverse of conditional statement p → q is the proposition ¬p
→ ¬q.
Contrapositive (¬q → ¬p):If I will not get a new bike then my score is not more than 80.
Inverse (¬p → ¬q):If my score is not more than 80 then I will not get a new bike.
p q p↔q
T T T
T F F
F T F
F F T
Summary
Logic is the systematic study of valid rules of inferences. More broadly logic is the analysis and
appraisal of arguments.
A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or
false, but not both.
The negation of p, denoted by ¬p (also denoted by p), is the statement “It is not the case that p.”
The conjunction p ∧ q is true when both p and q are true and is false otherwise.
The disjunction p ∨ q is false when both p and q are false and is true otherwise.
The proposition “if p, then q” is the conditional declaration p → q. If p is true and q is false, the
conditional assertion p → q is false; otherwise, it is true
The converse of conditional statement p → q is the proposition q → p
The contrapositive of conditional statement p → q is the proposition ¬q → ¬p.
Keywords
Proposition: a statement that is true or false propositional.
¬ p (negation of p): the proposition with truth value opposite to the truth value of p.
p ∧ q (conjunction of p and q): the proposition “p and q,” which is true if and only if both p and q
are true.
p ∨ q (disjunction of p and q): the proposition “p or q,” which is true if and only if at least one of p
and q is true
p ⊕ q (exclusive or of p and q): the proposition “p XOR q,” which is true when exactly one of p
and q is true
p→ q (p implies q): the proposition “if p, then q,” which is false if and only if p is true and q is false
Self Assessment
1.What is the negation of the statement “Salman sent more than 100 text messages every day”?
(A) Salman sent more than 200 text messages every day.
(B) Salman sent less than 100 text messages but not every day.
(C) Salman did not send more than 100 text messages every day.
(D) Salman did not send any text messages every day.
2.Let Q(x, y) denote the statement “y is the capital of x.” What are the truth values of i) Q(Punjab,
Chandigarh), ii) Q(India, New Delhi ) iii) Q(Rajasthan, Shimla), iv) Q(Nepal, Kathmandu)?
(A) T,F,T,F
(B) T,T,F,F
(C) T,T,F,T
(D) T,T,T,T
3.Let p and q be the propositions,p: Umesh drives over 50 km per hour. q: He gets a speeding ticket.
Then which one of the following is correct for p and q?
(A) Umesh drives over 50 km per hour and he gets a speeding ticket.
(B) Umesh did not drive over 50 km per hour and he gets a speeding ticket.
(C) Umesh drives over 50 km per hour and he did not get a speeding ticket.
(D) Umesh drives over 50 km per hour or he gets a speeding ticket.
4.What will be the Truth values of the statement p ↔ ¬p for the Truth values T, F of p?
(A) T, F
(B) F, T
(C) T, T
(D) F,F
5. Let P: Dogs can fly, and consider the following flow chart of a computer program then
what is the value of S
(A) 20
(B) 30
(C) 0
(D) 25
6. What will be the Truth values of the statement (p ∧ q) → (p ∨ q) for the Truth values T, T,
F, F of p and T, F, T, F of q?
(A) T, F,T,F
(B) F, T,F,T
(C) T, T, T, T
(D) F,F,F,F
7. If P: “You can use the wireless network in the airport,” Q: “You pay the daily fee,”.Which
is the right expression for the statement “To use the wireless network in the airport you must pay
the daily fee ”.
(A) Q→P
(B) P→Q
(C) Q∧P
(dD) Q∨P
8. Let P: 5+10=15, Q: 5*10=50.And consider the following flow chart of a computer program
then the value of S is?
(A) 30
9. The converse of the statement “If you are honest, then you are respected.”
(A) If You are honest then he is not respected.
(B) If You are not respected then you are not honest.
(C) If you are not honest then you are not respected.
(D) If you are respected then you are honest.
10. The inverse of the statement “If you are honest, then you are respected.”
(A) If You are honest then he is not respected.
(B) If You are not respected then you are not honest.
(C) If you are not honest then you are not respected.
(D) If you are respected then you are honest.
11.The contapositive of the statement “If you are honest, then you are respected.”
(A) If You are honest then he is not respected.
(B) If You are not respected then you are not honest.
(C) If you are not honest then you are not respected.
(D) If you are respected then you are honest.
12. The Converse of the statement “If you are lucky, then you will get a ticket.”
(A) If you are lucky then you will get a ticket.
(B) If you are not lucky then you will not get a ticket.
(C) If you will get a ticket then you are lucky.
(D) If you are respected then you are honest.
13.Consider the logic L: Footsteps of tallboys are larger than smaller ones then Which one of the
following arguments is valid?
(A) The height of Ramesh is 6.5 feet while the height of Rakesh is 6 feet hence footsteps of
Ramesh are larger than Rakesh
(B) Delhi is the capital of India hence footsteps of Ramesh are larger than Rakesh
(C) Kolkata is the capital of India hence footsteps of Ramesh are not larger than Rakesh
(D) Ramesh and Rakesh are friends hence footsteps of Ramesh are larger than Rakesh
1. C 2. C 3. A 4. D 5. C
6. C 7. A 8. B 9. D 10. C
Review Questions:
1) Which of these statements are propositions?
a. 10+5=15
b.2*25=40
c. How are you?
2) What is the truth value of the following propositions?
a. 5 = 10
b. Chandigarh is the capital of Punjab
3) What is the negation of the following propositions?
a. His computer has more than 32 GB of memory
b. Metro cities are more polluted than villages
4) Let P and Q are propositions
P: Ramesh is ill.
Q: Ramesh misses the final exam.
Write the conjunction of P and Q as an English sentence
5) Let P and Q are propositions
P: Ramesh is a clever boy.
Q: Ramesh performs well in the final exam.
Find the truth value ofthe proposition “Ramesh is not a clever boy and he performs well in
the final exam”.
6) Let P and Q are propositions
P: Julieis a computer science student.
Q: Julie is doing the job in a software company.
Draw the truth table for ¬p ∧¬q
7) Let P and Q are propositions
P: Raman is a tallboy.
Q: Raman performs well in the high jump.
Express the proposition as an English sentence ¬P∧Q
8) Let P and Q are propositions
P: Ramesh is ill.
Q: Ramesh misses the final exam.
Write the disjunction of P and Q as an English sentence
9) Let P and Q are propositions
P: Ramesh is a clever boy.
Q: Ramesh performs well in the final exam.
Find the truth value of the proposition “Ramesh is not a clever boy or he performs well in
the final exam”.
Further Readings
• Discrete mathematics & its applications by Kenneth H Rosen, McGraw hill education
• Discrete mathematics (Schaum's outlines) (sie) by Seymour Lipschutz, Marc Lipson,
Varsha H. Patil, Mcgraw hill education