DEMTH136 - DISCRETE - STRUCTURES SLM-36-46

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Rajesh Kumar, Lovely Professional University Unit 03: Introduction to logic Notes

Unit 03: Introduction to Logic


CONTENTS
Objectives:
Introduction
3.1 logic
3.2 Propositions
3.3 Compound propositions
Summary
Keywords
Self Assessment
Answer for self Assessment
Review Questions:
Further Readings

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.

After this unit, you would be able to

• understand the valid and invalid argument to form a logic


• describes the different propositions, compound preposition, and negation of preposition
• learn the conditional, biconditionalstatement, and inverse, converse, and contrapositive
statement

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.

LOVELY PROFESSIONAL UNIVERSITY 33


Notes Discrete Structures

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.

Example 1. Covid-19 was originated in china


2. Taj Mahal was built on the southern bank of the river Yamuna.
3. 2+10=12
4. 5+5=12
5. How are you?
6.  2 + 2 = 2

Some of the above statements are decelerating the fact and are proposition can be seen in the
following table

Table 1: Proposition and their truth value

Statement Declaring the Proposition Promotional


fact value

Covid-19 was originated in china Yes Yes True

Taj Mahal built on the southern bank of the Yes Yes True
river Yamuna

2+10=12 Yes Yes True

5+5=12 Yes Yes False

How are you? No No -

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

34 LOVELY PROFESSIONAL UNIVERSITY


Unit 03: Introduction to logic Notes
3.3 Compound propositions
A variety of mathematical arguments are made up of one or more propositions. Logic operators are
used to creating new propositions termed compound propositions from current propositions.

Negation of the proposition


Let p be a proposition. The negation of p, denoted by ¬p (also denoted by 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.

Example 1. “Himanshu’s PC runs Linux”


p: “Himanshu’s PC runs Linux”
¬p: “It is not the case that Himanshu’s PC runs Linux.”
Or
¬p: “Himanshu’s PC does not run Linux.”

2. “Himanshu’s smartphone has at least 50GB of memory”


p: Himanshu’s smartphone has at least 50GB of memory”
¬p: “It is not the case that Himanshu’ssmartphone has at least 50GB
of memory”
Or
¬p: “Himanshu’ssmartphone does not have at least 32GB of
memory”
Or
¬p: “Himanshu’s smartphone has less than 32GB of memory.”

Truth table Negation of the proposition


The truth table for the negation of a proposition p is seen in Table 2.

Table 2: Truth table of Negation of proposition

p ¬p

T F

F T

The conjunction of proposition p and q


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.

Table 3 displays the truth table for p ∧ q.

LOVELY PROFESSIONAL UNIVERSITY 35


Notes Discrete Structures
Table 3: the truth table for p ∧ q.

q p∧q
p
T T
T
F F
T
T F
F
F F
F

Example:

Let p and q be the propositions


p:Umesh drives over 50km per hour.
q:He gets a speeding ticket.
p ∧ q: Umesh drive over 50km per hour and he gets a speeding ticket.

The disjunction of proposition p and q


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.
Table 4 displays the truth table for p ∨ q.

Table 4: the truth table for p ∨ q.


p q p∨q

T T
T
F T
T
T T
F
F F
F

Example Let p and q be the propositions


p: Umesh drives over 50 km per hour.
q: He gets a speeding ticket.
p ∨ q: Umesh drive over 50 km per hour or he gets a
speeding ticket.

The exclusive or of p and q


Let p and q be propositions. The exclusive or of p and q, denoted by p ⊕ q, is the
proposition that is true when exactly one of p and q is true and is false otherwise.
Table 5 displays the truth table for p ⊕ q.

Table 5: the truth table for p ⊕ q.

36 LOVELY PROFESSIONAL UNIVERSITY


Unit 03: Introduction to logic Notes
p q p⊕q

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:

Let p and q be the propositions


p: Umesh drives over 50km per hour.
q: He gets a speeding ticket.
p → q: If Umesh drives over 50km per hour then he gets a speeding ticket.

Table 6: the truth table for p → q

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.

LOVELY PROFESSIONAL UNIVERSITY 37


Notes Discrete Structures

Consider the propositions P and Q


P: My score is more than 80.
Q: I will get a new bike.
P → Q: If my score is more than 80 then I will get a new bike
Converse (q → p):If I will get a new bike then my score is more than 80.

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.

The biconditional statement


Let p and q be propositions. The biconditional statement p ↔ q is the proposition “p if and only if
q.” The biconditional statement p ↔ q is true when p and q have the same truth values and is false
otherwise.
Example:
Consider the propositions P and Q
P: My score is more than 80.
Q: I will get a new bike.
P↔Q: My score is more than 80 if and only I will get a new bike

Table 7 displays the truth table for p ↔q.

Table 7: the truth table for p ↔q.

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.

38 LOVELY PROFESSIONAL UNIVERSITY


Unit 03: Introduction to logic Notes
The inverse of conditional statement p → q is the proposition ¬p → ¬q.
The biconditional statement p ↔ q is true when p and q have the same truth values and is false
otherwise.

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

LOVELY PROFESSIONAL UNIVERSITY 39


Notes Discrete Structures

(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

40 LOVELY PROFESSIONAL UNIVERSITY


Unit 03: Introduction to logic Notes
(B) 25
(C) 0
(D)10

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

14. Which one of the following is a proposition?


(A) How are you?
(B) What time is it?
(C) India is in Europe.
(D) 4+x=10

LOVELY PROFESSIONAL UNIVERSITY 41


Notes Discrete Structures
15.What is the truth value of the proposition “5+10=15”?
True
False

Answer for self Assessment

1. C 2. C 3. A 4. D 5. C

6. C 7. A 8. B 9. D 10. C

11. B 12. C 13. A 14. C 15. True

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

42 LOVELY PROFESSIONAL UNIVERSITY


Unit 03: Introduction to logic Notes
10) Let P and Q are propositions
P: Julie is a computer science student.
Q: Julie is doing the job in a software company.
Draw the truth table for ¬p ∨¬q
11) 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
12) Let P and Q are propositions
P: Ramesh is ill.
Q: Ramesh misses the final exam.
Write the P→Qof P and Q as an English sentence
13) 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 “If Ramesh is not a clever boythen he did not
perform well in the final exam”.
14) Let P and Q are propositions
P: Julie is a computer science student.
Q: Julie is doing the job in a software company.
Draw the truth table for contrapositive statement of P →Q
15) Let P and Q are propositions
P: Raman is a tallboy.
Q: Raman performs well in the high jump.
Find the converse of the conditional statement P →Q

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

LOVELY PROFESSIONAL UNIVERSITY 43

You might also like