0% found this document useful (0 votes)
25 views22 pages

Unint I DMS LM

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)
25 views22 pages

Unint I DMS LM

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/ 22

Discrete Mathematical Structures 1

GUDLAVALLERU ENGINEERING COLLEGE


(An Autonomous Institute with Permanent Affiliation to JNTUK, Kakinada)
Seshadri Rao Knowledge Village, Gudlavalleru – 521 356.

Department of Computer Science and Engineering

HANDOUT

on

DISCRETE MATHEMATICAL STRUCTURES

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 2

Vision :

To be a Centre of Excellence in computer science and engineering education


and training to meet the challenging needs of the industry and society

Mission:

 To impart quality education through well-designed curriculum in tune


with the growing software needs of the industry.
 To be a Centre of Excellence in computer science and engineering
education and training to meet the challenging needs of the industry
and society.
 To serve our students by inculcating in them problem solving,
leadership, teamwork skills and the value of commitment to quality,
ethical behavior & respect for others.
 To foster industry-academia relationship for mutual benefit and growth

Program Educational Objectives :

PEO1 : Identify, analyze, formulate and solve Computer Science and


Engineering problems both independently and in a team environment
by using the appropriate modern tools.

PEO2 : Manage software projects with significant technical, legal, ethical,


social, environmental and economic considerations.

PEO3 : Demonstrate commitment and progress in lifelong learning,


professional development,leadership and Communicate effectively with
professional clients and the public

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 3

HANDOUT ON DISCRETE MATHEMATICAL STRUCTURES

Class & Sem. :II B.Tech – I Semester Year : 2019-20


Branch : CSE Credits : 3
=================================================================
1. Brief History and Scope of the Subject
The History of Foundations of Mathematics involve non classical logics and
constructive mathematics. Mathematical Foundations of Computer Science is
the study of mathematical structures that are fundamentally discrete rather
than continuous. Research in Discrete Structures increased in the latter half
of 20th centenary partly due to development of digital computers, Which
operate in Discrete steps and store data in discrete bits. Graph Theory is study
of, Mathematical Structures used to model pair wise relations between objects
from a certain collection. This course is useful in study and describing objects
and problems in computer science such as computer algorithm, programming
languages, Cryptography, Automated theorem proving and software
development.
2. Pre-Requisites
 Mathematics background such as set theory, Permutations and
Combinations.
3. Course Objectives:
To make the students
 know the structure of statements (and arguments) involving predicates.
 understand the applications of graph theory to various practical problems.
 know how to solve a recursive problem.
4. Course Outcomes:
Students will be able to
CO1: apply the concept of Mathematical logic in software development process.
CO2: use the concept of Pigeon hole principle to derive the n log n  lower
bound.

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 4

CO3: apply the concepts of group theory in robotics, computer vision &
computer graphics.
CO4: use the concepts of graph theory to provide solutions for routing
applications in computer networks.
CO5: apply the recurrence relation for analyzing recursive algorithms.
5. Program Outcomes:
Graduates of the Computer Science and Engineering Program will have
a) an ability to apply knowledge of mathematics, science, and engineering
b) an ability to design and conduct experiments, as well as to analyze and
interpret data
c) an ability to design a system, component, or process to meet desired needs
within realistic constraints such as economic, environmental, social,
political, ethical, health and safety, manufacturability, and sustainability
d) an ability to function on multidisciplinary teams
e) an ability to identify, formulate, and solve engineering problems
f) an understanding of professional and ethical responsibility
g) an ability to communicate effectively
h) the broad education necessary to understand the impact of engineering
solutions in a global, economic, environmental, and societal context
i) a recognition of the need for, and an ability to engage in life-long learning,
j) a knowledge of contemporary issues
k) an ability to use the techniques, skills, and modern engineering tools
necessary for engineering practice.

6. Mapping of Course Outcomes with Program Outcomes:

a b c d e f g h i j k
CO1 2 3 2 2
CO2 3 2
CO3 3 3 3 3
CO4 3 3 3 3
CO5 2 2 1

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 5

7. Prescribed Text Books :

a) J.P.Trembley, R Manohar, Discrete Mathematical Structures with


Applications to Computer Science, Tata McGraw Hill, New Delhi.
b) Mott, Kandel, Baker, Discrete Mathematics for Computer Scientists &
Mathematicians, 2nd edition, PHI.
c) Rosen, Discrete Mathematics and its Application with combinatorics and
graph theory: 7th editon, Tata McGraw Hill, New Delhi.

8. Reference Text Books


a) S.Santha, Discrete Mathematics, Cengage publications.
b) J K Sharma, Discrete Mathematics, 2nd edition, Macmillan Publications.

9. URLs and Other E-Learning Resources


So net CDs & IIT CDs on some of the topics are available in the digital library.
10. Digital Learning Materials:
 http://nptel.ac.in/courses/106106094
 http://nptel.ac.in/courses/106106094/40
 http://nptel.ac.in/courses/106106094/30
 http://nptel.ac.in/courses/106106094/32
 http://textofvideo. nptl.iitm.ac.in/106106094/lecl.pdf
 www.nptelvideos.in/2012/11/discrete-mathematical -structures.html
11. Lecture Schedule / Lesson Plan
No. of Periods
Topic
Theory Tutorial
UNIT –1: Mathematical Logic :
Propositional Calculus: Statements and Notations 1 2
Connectives 1
Truth Tables 1
Tautologies 1 2

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 6

Equivalence of Formulas 2
Tautological Implications 1
Theory of Inference for Statement Calculus 2 2
Consistency of Premises 1
UNIT – 2: Relations & Functions
Relations: Properties of Binary Relations 1
Equivalence 1
Compatibility and Partial order relations 2
2

Hasse Diagram 1
Functions : Inverse 1
Composite and Recursive functions 2 2
Pigeon hole principle and its application 1
UNIT – 3: Algebraic Structures
Algebraic Systems and Examples 1
general properties 1
2
semi group, Monoid 1
Groups 2
Subgroups 2
2
Cyclic groups 2
UNIT – 4: Graph Theory - I:
Concepts of Graphs 1
2
Sub graphs, Multigraphs 2
Matrix Representation of Graphs: Adjacency and
2
incidence Matrices 2
Isomorphic Graphs 2
UNIT – 5: Graph Theory - II:
Paths and Circuits, Eulerian graph 2 2

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 7

Planar graphs 2
Hamiltonian Graph 2
Chromatic number of a graph 1
UNIT – 6: Combinatorics and Recurrence Relation:
Basics of Counting principles ( sum rule and
1
product rule)
2
Solving linear homogeneous recurrence Relations
1
by substitution
The Method of Characteristic Roots
2
2
Solving Inhomogeneous Recurrence Relations 2
Total No. of Periods: 48 24

12. Seminar Topics


 Theory of Inference
 Graph isomorphism and applications
 Recurrence relations and applications

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 8

UNIT – I
Mathematical Logic
Objectives:
 To comprehend the structure of statements (and arguments) involving
predicates and quantifiers
Syllabus:
Mathematical Logic: Propositional Calculus: Statements and Notations,
Connectives, Truth Tables, Tautologies, Equivalence of Formulas, Tautological
Implications, Theory of Inference for Statement Calculus, Consistency of
Premises.
Sub Outcomes:
 Construct truth tables for different types of connectives.
 Identify the tautologies.
 Determine the equivalence formulas and tautological implications.

Learning Material

Statement:

A declarative sentence which is either true or false but not both is called
a statement or proposition.

 Statements are generally denoted by either upper case or lower case


letters.

Examples:

1. Bombay is the capital of Canada . (Statement)


2. Canada is a country. (Statement)
3. 10 + 100 = 110 . (Statement)
4. 3 + 3 = 4. (Statement)
5. x + 5 =8. (not a statement)
6. close the door. (not a statement)
7. what is your name? (not a statement)

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 9

Atomic statement/ Primitive statement :

A statement that cannot be broken down into more than one simpler
statement is called atomic statement.

Compound statement:

A statement that can be broken down into simpler statements is called


compound or molecular statement.

Propositional calculus:

The area of logic that deals with propositions is called propositional


calculus or propositional logic.

Truth value:

 Truth value for true statement is T


 Truth value for false statement is F

Statement Truth value


Bombay is the capital of
F
Canada
Canada is a country T
10 + 100 = 110 T
3+3=4 F
Not a statement
x + 5 =8
We can’t give truth value

Connectives:

The words or expressions which are used to construct compound


statements from simpler statements are known as sentential connectives.

 And, or, if then, iff, not, so, because are sentential connectives.
 are mathematical connectives.

Different types of compound statements:

Type Connective Symbol Notation Read as


Conjunction And P P and Q
Disjunction Or Q P or Q
Conditional If then Q P implies Q
i.e If P then Q
Bi-conditional If and only if P double implies Q
i.e. P if and only if Q

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 10

Negation Not or No or Negation P


(or) Not P
Truth Table:

The table showing the truth values of a statement formula for each
possible combination of the truth values of the compound statements is called
the truth table of the formula.

Note: In general if there are n distinct components in a statement formula we


need to consider 2n possible combinations of truth values in order to construct
the truth table.

Truth table rules:

P Q P Q Q
T T T T T T F
T F F T F F F
F T F T T F T
F F F F T T T
Example Problems:

Q. Using the statements R: Mark is rich. H: Mark is happy.

Denote the following statements in symbolic form.

a) Mark is poor but happy. Ans:


b) Mark is rich or unhappy. Ans:
c) Mark is neither rich nor happy. Ans:
d) Mark is poor or he is both rich and unhappy. Ans:

Q. Represent the following statement in symbolic form.

“If either John takes Computer science or Merin takes Mathematics then
Nishanth will take Biology.”

Ans: Let us denote the statements as follows.

P : John takes Computer science

Q : Merin takes Mathematics

R : Nishanth takes Biology

Then given statement can be written as .

Q. How can the following statement be translated into a logical expression.

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 11

“You can access the internet from campus only if you are a Computer
science major student or you are not a freshman.”
(For student)

Q. Construct the truth tables for the following statement formula.

1.

P Q
T T F F F T
T F F T T F
F T T F T F
F F T T T F
2. P

P Q R P P
A B B
T T T F F F F T T T T
T T F F F F F F F F F
T F T F T T F F T F T
T F F F T F F F F F F
F T T T F F F T F T T
F T F T F F F F F F F
F F T T T T T F F T T
F F F T T F F F F F F

3. (For student)

4. (For student)

For Implication statement

Converse: Inverse: Contrapositive:

Note: Converse of inverse of an implication is a contrapositive.

Inverse of connverse of an implication is a contrapositive.

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 12

Conditional ( If I am sleeping, then I am breathing


Converse ( ) If I am breathing, then I am sleeping
Inverse ( If I am not sleeping, then I am not breathing
Contrapositive ( If I am not breathing, then I am not sleeping

Q. What are the converse, inverse and contrapositive of the implication

“If I get good rank in EAMCET then I will choose CSE. “

Ans: Let us take the statements as follows.

P: I get good rank in EAMCET


Q: I will choose CSE

Converse: If I choose CSE, then I got good rank in EAMCET.

Inverse: If I not get good rank in EAMCET , then I will not choose CSE.

Contra positive: If I will not choose CSE, then I did not get good rank in
EAMCET.

Q. What are the inverse, converse, and contra positive of the implication “If
today is a holiday, then I will go for a movie “
( For student )

A statement
formula

Tautology Contradiction Contingency


(All truth values are (All truth values are (Consisting both T and

Tautology:

A statement formula that is always true, irrespective of the truth values


of the propositions that occur in it, is called a tautology. This is also called as
universally valid formula or a logical truth.

Contradiction:

A statement formula that is always false, irrespective of the truth values


of the propositions that occur in it, is called contradiction.

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 13

Contingency:

A proposition that is neither a tautology nor a contradiction is called a


contingency.

Note: 1. The negation of contradiction is tautology.

2. The conjunction of two tautologies is also a tautology.

Q. Indentify that is a tautology.

p Q r
A B C D E
T T T T T T T T T
T T F T F F F F T
T F T F T T T T T
T F F F T F T T T
F T T T T T T T T
F T F T F T T T T
F F T T T T T T T
F F F T T T T T T
Hence the given statement is Tautology.
Q. Show that is a contradiction.
P q
T T F F F
T F T T F
F T F F F
F F T F F
Hence the given statement is Contradiction.

Equivalence formulas:
The two propositions A and B are said to be logically equivalent if
is a tautology.
And written as and read as A is equivalent to B.
Q. show that
P Q
T T F T T
T F F F F
F T T T T
F F T T T

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 14

Hence

Q. Show that

P Q
T T F F T
T F F F F
F T T F T
F F T F F

From the above truth table,

Hence

Equivalence Rules :

The logical equivalences below are important equivalences that should be


memorized.

Idempotent Laws: p ∨ p ⇔ p

p∧p⇔p

Commutative Laws: p∨q⇔q∨p

p∧q⇔q∧p

Associative Laws: (p ∨ q) ∨ r ⇔ p ∨ (q ∨ r)

(p ∧ q) ∧ r ⇔ p ∧ (q ∧ r)

Distributive Laws: p ∨ (q ∧ r) ⇔ (p ∨ q) ∧ (p ∨ r)

p ∧ (q ∨ r) ⇔ (p ∧ q) ∨ (p ∧ r)

Identity Laws: p∧T⇔p

p∨F⇔p

Domination Laws: p ∨ T ⇔ T

p∧F⇔F

De Morgan’s Laws: ¬(p ∧ q) ⇔ ¬p ∨ ¬q

¬(p ∨ q) ⇔ ¬p ∧ ¬q

Absorption Laws: p ∧ (p ∨ q) ⇔ p

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 15

p ∨ (p ∧ q) ⇔ p

Negation Laws: p ∨ ¬p ⇔ T

p ∧ ¬p ⇔ F

Double Negation Law: ¬(¬p) ⇔ p.

Tautological Implications:

A statement A is said to be tautologically imply to a statement B iff


is a tautology. And it is denoted by .

Standard Implications:

1. 7.
2. 8.
3. 9.
4. 10.
5. 11.
6.
Note: 1.If a statement formula is equivalent to tautology then it must be a
tautology.

2.If a formula is implied by a tautology then it must be tautology.

Other connectives:

Type Symbol Definition


Exclusive OR i.e. XOR
NAND
NOR
Truth table:

P Q XOR NAND NOR

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

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 16

Theory of Inference

The main function of logic is to provide rules of inference or principles of


reasoning. The theory associated with such rules is known as inference theory.

Premise: Premise is an axiom or believed to be true either from experience or


from faith.

Valid conclusion and valid argument:

Any conclusion which is arrived by the set of rules or premises is called a


valid conclusion and the argument is called a valid argument.

Validity using truth tables:

Q. Determine whether the conclusion C follows logically from the premises H 1


and H2 in the following cases.

1.

Sol: We have to construct the following truth tabe.

P Q

T T T T F F
T F F F T F
F T T F T T
F F T F T T
Here H1 and H2 are the true in the third and fourth rows and the conclusion C
is also T in these two rows.

Thus . ,

Hence the conclusion is valid.

2.

Sol: We have to construct the following truth tabe.

(C) (H2) (
P Q
T T T
T F F
F T T
F F T

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 17

Here H1 and H2 are true in the 1st and 3rd rows but conclusion C is true only in
1st row false in 3rd row.

Hence the conclusion C is not valid.

Rules of inferences:

Rule P: A premise may be introduced at any point in the derivation.

Rule T:A formula S may be introduced in a derivation if S is tautologically


implied by

one or more of the preceding formulas in the derivation.

Rule CP: If we can derive S from R and a set of premises, then we can derive
from a set of premises alone.

Q. Apply theory of inference to check R is valid inference from the premises

Sol:

{ 1} (1). Rule P
{ 2} (2). Rule P
{ 1,2 } (3). Rule T on (1),(2) “ ”
{ 4} (4). Rule P
{ 1,2,4 } (5). Rule T on (3),(4) “ ”
Hence R is valid inference

Q. Show that is automatically implied by

Sol.

{1} (1). Rule P


{1} (2). Rule T on (1) “ ”
{3} (3). Rule P
{ 1,3} (4). Rule T on (2),(3) “ ”
{ 1,3 } (5). Rule T on (4) “ ”
{6} (6). Rule P
{ 1,3,6 } (7). Rule T on (5),(6) “ ”
{ 1,3,6 } (8). Rule T on (7) “ ”
Hence proved

Q. Show that follows logically from the premises

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 18

(For student)

Consistency of premises: A set of formulas H1, H2 ……..Hn is said to be


consistent if their conjunction has the truth value T for some assignment of the
truth values to the atomic variables appearing in H1, H2, …….Hm. A set of
formulas H1, H2……..Hm is said to be inconsistent if their conjunction implies
a contradiction i. e. H 1  H 2  .........H m  R  R where R is any formula.

Q. Show that the set of premises P  Q, P  R, Q  R, P are in consistent.

Sol:
1) PQ P
2) Q  R P
3) P  R T 1,2 P  Q, Q  R  P  R
4) P P
5) R T 3,4 P  Q, P  Q
6) PR P
7) P T 5,6 P  Q, Q  P
8) P P
9) P  P T 7,8 P, Q  P  Q

The set of premises are inconsistent

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 19

UNIT-I
Assignment-Cum-Tutorial Questions
SECTION-A

Objective Questions

1) Which of the following is a statement. [ ]

a) how old are you ? b) Jaipur is in Andhra Pradesh

c) where are you ? d) god bless you.

2) The inverse of ( p  q ) (  q   p ) is ______________ [ ]

3) What is the truth value of the statement ‘If Charminar is in Hyderabad then
5*3=8’. [ T / F]

4) If the truth value of q is T then the truth value of q  r   q is ____ .

5) The truth value of 2+6=9 if and only if 9+6=10 is ______ .

6) The converse of the statement “If there is a flood then the crop will be
destroyed” is _________________________________________.

7) Symbolic form of the statement ‘If I do not have car or I do not wear good
dress then I am not a Millionaire’ is _________________ .

8) P and Q are two propositions. Which of the following logical expressions are
equivalent?

I. P ~ Q II. ~ ~ P  Q 

III. P  Q   P  ~ Q   ~ P  ~ Q  IV. P  Q   P  ~ Q   ~ P  Q 

a) Only I and II b) Only I, II and III c) Only I, II and IV d) All of I, II, III & IV

9) Consider the following propositional statements: [ ]

P1 :  A  B   C    A  C   B  C 

P2 :  A  B   C    A  C   B  C 

Which one of the following is true?

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 20

a) P1 is a True, but not P2 b) P2 is a True, but not P1

c) P1 and P2 are both True d) Both P1 and P2 are not True

10) Consider the following statements [ ]

P: Good mobile phones are not cheap

Q: Cheap mobile phones are not good.

L: P implies Q. M: Q implies P . N:P is equivalent to Q

Which of the following about L, M and N is correct?

a) only L is true b) only M is correct

c) only N is true d) L, M and N are true.

11) Which of the following is a tautology? [ ]

a) p  ( p  q ) b) ((( p  q)  (q  r ))   p )  r

c) p  p  q d) p  q

12) Which of the following is a contingency? [ ]

a)  p  q    p  q  b) p  q   p  q 

c) p   p d) p  q  p

Section - B

1) Let p , q and r be the propositions . P: you have the free.


Q: you miss the final examination.
R: you pass the course.

Write the following proposition into statement form.

i) P → Q ii) P → R iii) Q → R iv) P V Q V R v) ( P → R)V(Q→ R)

2) Construct a truth table for each of the following compound statements.

i) ( p → q) ( p → q) ii) p → ( q v r)

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 21

3)Construct the truth table for the given statement:

(P→(Q→R))→((P→Q)→(P→R)).

4) Construct the truth table for PVQ ~ R  Q .


5) Show that P  Q  R   P  Q   P  R  .

6) Use truth table to verify the following logical equivalence


p  q  r    p  q    p  r 
7) Establish the validity of the argument p  q, q  r , p  r .

8) Show that R V S follows logically form the premises C v D , (C v D)  ~ H,


~H  (A  ~B) and (A  ~B)  (R v S).
9) Determine the validity of the following argument : “ my father praises me
only if I can be proud of myself either I do well in sports or I cann’t be proud
of myself. If I study hard, then I cann’t do well in sports. Therefore, if father
praises me then I do not study well.”

10) Show that the following set of premises is inconsistent :


“ if the contract is valid then john is liable for penalty. “If john is liable for
penalty, he will go bankrupt. If the bank will loan him money, he will not go
bankrupt. As a matter of fact, the contract is valid and the bank will loan
him money.”
11) Prove that the following argument is valid.
If Rochelle gets the supervisor’s position and works hard, then she’ll get a
raise. If she gets the raise, then she’ll buy a new car. She has not purchased a
new car. Therefore either Rochelle did not get the supervisor’s position or she
did not work hard.
Section – C

1. Which one of the following is NOT equivalent to p↔ q?


(A) (┐p q) (p ┐q) (B) (┐p q) (q → p)
(C) (┐p q) (p ┐q) (D) (┐p ┐q) (p q) (GATE2015)

II Year-I Semester 2019-20 CSE


Discrete Mathematical Structures 22

2. Let a, b, c, d be propositions. Assume that the equivalences a ↔ (b V-b) and


b ↔ c hold. Then the truth value of the formula (a ∧ b) → (a ∧ c) ∨ d) is
always
(A) True (B) False (C) Same as the truth value of b
(D) Same as the truth value of d (GATE 2000)

3. P and Q are two propositions. Which of the following logical expressions are

equivalent?

a)Only I and II b)Only I, II and III

c)Only I, II and IV d)All of I, II, III and IV (GATE 2008 )

4.Which one of the following Boolean expressions is NOT a

tautology?

a) A b) B c) C d) D (GATE 2014)

5. Let P, Q and R be three atomic prepositional assertions. Let X denote (P v


Q) → R and Y denote

(P → R) v (Q → R). Which one of the following is a tautology?

a) X ≡ Y b) X → Y c) Y → X d) ¬ Y → X (GATE-CS-2005)

II Year-I Semester 2019-20 CSE

You might also like