DM Sanchit Sir Notes
DM Sanchit Sir Notes
• Set are the fundamental discrete structures on which all the discrete structures are
built. Sets are used to group objects together, formally speaking
• “A well-defined, unordered collection of distinct objects (Called elements or members
of a set) of same type”. Here the type is defined by the one who is defining the set.
For e.g. A = {0,2,4,6, ---}, B = {1,3,5, ---}, C= {x| x ∈ Natural number}
• A set is generally denoted usually by capital letter. The objects of a set called the
elements, or members of the set. A set is said to contain its elements. Lower case
letters are generally used to denote the element of the set.
• x ϵ A, means element x is a member of A
• x ∉ A means x is not a member of A
• Cardinality of a set— It is the number of elements present in a Set, denoted like |A|,
For e.g. A = {0,2,4,6}, |A| = 4.
• Representation of set
o Tabular/Roster representation of set- here a set is defined by actually listing
its members. Generally Used when set contains few elements. Used in complex
analysis or large sets. E.g.
▪ A = {a, e, i, o, u}
▪ B = {1, 2, 3, 4}
▪ C = {---- -4, -2, 0, 2, 4, -----}.
o Set Builder representations of set- here we specify the property which the
elements of the set must satisfy. E.g.
▪ A = {x| x is an odd positive number less than 10}
▪ A = {x | x ϵ English alphabet && x is vowel}
▪ B = {x | x ϵ N && x <5}
▪ C = {x | x ϵ Z && x%2 = 0}
Standard notations
• Set of all Complex number(C) - A complex number is a number that can be expressed
in the form ‘a + bi’, where ‘a’ and ‘b’ are real numbers and ‘i’ is the imaginary unit,
that satisfies the equation i2 = −1. In this expression, ‘a’ is the real part and ‘b’ is the
imaginary part of the complex number.
• Set of all Real number(R) - A real number is a value that represents a quantity along
a continuous line, containing all of the rational numbers and all of the irrational
numbers.
• Set of all Rational number (Q) - A rational number is any number that can be
expressed as a fraction p/q of two integers, a numerator p and a non-zero
denominator q.
• Set of all Irrational number (R-Q or R/Q or P)- An irrational number is a real
number that cannot be expressed as a fraction i.e. as a ratio of integers.
Therefore, irrational numbers, when written as decimal numbers, do not terminate,
nor do they repeat. E.g. root2.
• Set of all Integer(Z) - An integer is a number that can be written without a fractional
component.
• Set of all Whole number(W) - A natural number. whole number in Science
Expand. whole number. A member of the set of positive integers and zero.
• Set of all-Natural number(N) - A natural number is a number that occurs commonly
and obviously in nature. The set of natural numbers, can be defined as N = {1,2,3, 4....
∞}
• Finite set - If there are exactly ‘n’ distinct elements in S where ‘n’ is a nonnegative
integer, we say that S is a finite set. For e.g. A = {1,2,3,4} and ‘n’ is the cardinality of S.
• Infinite set – A set contain infinite number of elements is called infinite set, if the
counting of different elements of the set does not come to an end. For e.g. a set of
natural numbers.
• Countable set – A set is said to be countable if there can be a one to one mapping
between the elements of the set and natural numbers. E.g. Set of stars.
• Uncountable set – A set is said to be uncountable if there cannot be a one to one
mapping between the elements of the set and natural numbers. E.g. Set of real
numbers.
• Sets can be represented graphically using Venn diagrams, named after the English
mathematician John Venn, who introduced their use in 1881. In Venn diagrams the
universal set U, which
• Contains all the objects under consideration, is represented by a rectangle. (Note
that the universal set varies depending on which objects are of interest.) Inside this
rectangle, circles or other geometrical figures are used to represent sets. Sometimes
points are used to represent the particular elements of the set. Venn diagrams are
often used to indicate the relationships between sets.
Q The cardinality of the power set of {0, 1, 2 . . ., 10} is _________. (GATE-2015) (1 Marks)
(A) 1024 (B) 1023 (C) 2048 (D) 2043
Answer: (C)
To understand this question better let’s try to understand it with another example
A={}
P(A) = {Ф}
A = {a}
P(A) = {Ф, {a}}
A = {a, b}
P(A) = {Ф, {a}, {b}, {a, b}}
A = {Ф}
P(A) = {Ф, {Ф}}
Q If ɸ is an empty set. Then | P(P(P(ɸ))) | =______?
a) 1 b) 2 c) 4 d) none of above
Ans: C
Q For a set A, the power set of A is denoted by 2A. If A = {5, {6}, {7}}, which of the following
options are True. (GATE-2015) (1 Marks)
I) ɸ ∈ 2A II) ɸ ⊑ 2A III) {5, {6}} ∈ 2A IV) {5, {6}} ⊑ 2A
(A) I and III only (B) II and III only (C) I, II and III only (D) I, II and IV only
Answer: (C)
Q The number of elements in the power set P(S) of the set S= {{∅},1, {2,3}} is: (GATE-1995)
(1 Mark)
a) 2 b) 4 c) 8 d) None of the above
Ans: C
Q let A be a set with n elements. Let C be a collection of distinct subsets of A such that for
any two subsets S1 and S2 in C, either S1 is subset of S2 or S2 is subset of S1. What is the
maximum cardinality of C? (GATE-2005) (2 Marks)
a) n b) n+1 c)2n-1+1 d) n!
Ans: b
Operation on sets
• Complement of set – set of all x such that x ∉ A, but x ϵ U. Ac = {x | x ∉ A & x ϵ U}
• Union of sets – union of two sets A and B is a set of all those elements which either
belong to A or B or both, it is denoted by A U B. A U B = {x| x ϵ A or x ϵ B}
• Intersection of sets -- intersection of two sets A and B is a set of all those elements
which belong to both A and B, and is denoted by A ⋂ B. A ⋂ B = {x| x ϵ A and x ϵ B}
• Disjoint sets -- Two sets are said to be disjoint if they do not have a common
element, i.e. no element in A is in B and no element in B is in A. A ⋂ B = ɸ
• Set difference – the set difference of two sets A and B, is the set of all the elements
which belongs to A but do not belong to B. (A – B) / (A\B = {x| x ϵ A and x ∉ B}
• Symmetric difference – the symmetric difference of two sets A and B is the set of all
the elements that are in A or in B but not in both, denoted as.
o A ⨁ B = {A U B} -- {A ⋂ B}
o A ⨁ B = {x| (x ϵ A and x ∉ B) or (x ϵ B and x ∉ A)}
o A ⨁ B = {A - B} U {B - A}
Q Let A, B and C be non-empty sets and let X = (A−B) −C and Y=(A−C) −(B−C). Which one of
the following is TRUE? (GATE-2005) (1 Marks)
a) X=Y b) X⊂Y c) Y⊂X d) None of these
Answer: (a)
Q Let A and B be sets and let Ac and Bc denote the complements of the sets A and B. the set
(a – b) ∪ (b - a) ∪ (a ∩ b) is equal to. (GATE- 1996) (1 Mark)
(a) A ∪ B (b) Ac ∪ bc (c) A ∩ B (d) Ac ∩ bc
Answer: (a)
Q If P, Q, R are subsets of the universal set U, then (GATE-2008) (1 Marks)
(P ⋂ Q ⋂ R) U (PC ⋂ Q ⋂ R) U QC U RC
(A) Qc U Rc (B) P U Qc U Rc
(C) Pc U Qc U Rc (D) U
Answer: (d)
Q let p, q and r be sets let @ denotes the symmetric difference operator defined as
P @ q = (p U q) – (p ∩ q)? (GATE-2006) (2 Mark)
I) p @ (q ∩ r) = (p @ q) ∩ (P @ q)
II) p∩ (q @ r) = (p ∩ q) @ (p @ r)
a) I only b) II only c) neither I nor II d) both I and II
Answer: (B)
Q Let S be an infinite set S1, S2…………, Sn be Sets such that S1 U S2 U …U Sn = S Then, (GATE-
1993) (1 Marks)
(a) at least one of the set Si is a finite set
(b) not more than one of the set Si can be finite
(c) at least one of the sets Si is an infinite set
(d) not more than one of the sets Si can be infinite
Answer: (C)
Q Let P(S) denotes the power set of set S. Which of the following is always true? (GATE-
2000) (2 Marks)
(a) P(P(S)) = P(S) (b) P(S) ∩P(P(S)) = {φ}
(c) P(S) ∩S = P(S) (d) S ∉P(S)
Answer: (B)
Q In a class of 200 students, 125 students have taken Programming Language course, 85
students have taken Data Structures course, 65 students have taken Computer Organization
course; 50 students have taken both Programming Language and Data Structures, 35
students have taken both Data Structures and Computer Organization; 30 students have
taken both Data Structures and Computer Organization, 15 students have taken all the three
courses. How many students have not taken any of the three courses? (GATE-2004) (1 Mark)
(A) 15 (B) 20 (C) 25 (D) 35
Answer: (C)
P(AUBUC)=P(A)+P(B)+P(C)-P(A∩B)-P(A∩C)-P(B∩C)+P(A∩B∩C)
125+85+65-50−35−30+15=175
No of students not taking any courses-> 200−175=25
Q what is the cardinality of the set of integers X defined below (GATE-2006) (2 Mark)
X = {n| 1<=n<=123, n is not divisible by 2,3 or 5}?
a)28 b)33 c)37 d)44
Ans: b
N(AUBUC) = N(A) +N(B)+N(C) -N(A∩B)-N(B∩C)-N(A∩C)+ N(A∩B∩C)
61+41+24−20−12−8+4=90=61+41+24−20−12−8+4=90
123 −90 = 33
Q The number of integers between 1 and 500 (both inclusive) that are divisible by 3 or 5 or
7 is ______. (GATE-2017) (1 Marks)
Ans: 271
166 + 100 + 71 -33-14-23+4 = 271
Q In a college, there are three student clubs, Sixty students are only in the Drama club, 80
students are only in the Dance club, 30 students are only in Maths club, 40 students are in
both Drama and Dance clubs, 12 students are in both Dance and Maths clubs, 7 students
are in both Drama and Maths clubs, and 2 students are in all clubs. If 75% of the students in
the college are not in any of these clubs, then the total number of students in the college is
_____________. (GATE-2019) (2 Mark)
(A) 1000 (B) 975 (C) 900 (D) 225
Answer: (C)
Therefore, total number of students participating in any of these clubs,
60 + 80 + 30 + 38 + 2 + 10 + 5
225
x*0.25 = 225
225/0.25
900
Q How many multiples of 6 are there between the following pairs of numbers? (NET-Jan-
2017)
0 and 100 and –6 and 34
a) 16 and 6 b) 17 and 6 c) 17 and 7 d) 16 and 7
Answer: (a)
Between 0 and 100 multiple of 6 are: 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 78, 84, 90, 96 ie.
16 multiple.
Between -6 and 34 multiple of 6 are: 0, 6, 12, 18, 24, 30. ie. 6 multiple.
So,option (a) is correct.
From set A numbers {3,6,9,……..999} which are divisible by 3 are 999 / 3 (A)= 333 .
From set A numbers {5,10,……995,1000} which are divisible by 5 are 1000 / 5 (B)= 200.
From set A numbers {15, 30, …990} which are divisible by 3 and 5 are 990 / 3 * 5 (A ∧ B)= 990 / 15 = 66.
So, numbers divisible by 3 or by 5 or by both 3 and 5:
(A ∨ B) = A + B – (A ∧ B)
(A ∨ B) = 333 + 200 – 67.
(A ∨ B) = 467.
So, option (C) is correct.
Q Let A and B be sets in a finite universal set U. Given the following: |A – B|, |A ⊕ B|, |A| +
|B| and |A ∪ B| Which of the following is in order of increasing size? (NET-Dec-2016)
a) |A – B| < |A ⊕ B| < |A| + |B| < |A ∪ B|
b) |A ⊕ B| < |A – B| < |A ∪ B| < |A| + |B|
c) |A ⊕ B| < |A| + |B| < |A – B| < |A ∪ B|
d) |A – B| < |A ⊕ B| < |A ∪ B| < |A| + |B|
Ans: d
Q Suppose U is the power set of the set S = {1,2,3,4,5,6}. For any T ∈ U, let |T| denote the
number of elements in T and T′ denote the complement of T. For any T, R ∈ U, let T\R be
the set of all elements in T which are not in R. (GATE-2015) (2 Marks)
Which one of the following is true?
A) ∀X∈U, (|X|=|X′|) B) ∃X∈U, ∃Y∈U, (|X|=5, |Y|=5 and X∩Y=ϕ)
C) ∀X∈U, ∀Y∈U, (|X|=2, |Y|=3 and X∖Y=ϕ) D) ∀X∈U, ∀Y∈U, (X ∖ Y= Y′ ∖ X′)
Ans: d
Q Consider the following relation on subsets of the set S of integers between 1 and 2014.
For two distinct subsets U and V of S we say U < V if the minimum element in the symmetric
difference of the two sets is in U. Consider the following two statements: (GATE-2014) (2
Marks)
S1: There is a subset of S that is larger than every other subset.
S2: There is a subset of S that is smaller than every other subset.
Which one of the following is CORRECT?
(A) Both S1 and S2 are true (B) S1 is true and S2 is false
(C) S2 is true and S1 is false (D) Neither S1 nor S2 is true
Answer: (A)
Q Let U = {1, 2, ..., n} and A = {(x, X), x ∈ X and X ⊆ U}. Consider the following two
statements for |A|. (Gate-2019) (1 Marks)
(i) |A| = n*2n−1
(ii) |A|= ∑𝑛𝑘=1 𝑘.nCr
Which of the following is correct?
(a) (i) only (b) (ii) only (c) Both (i) and (ii) (d) None of the above
Answer: (C)
Q The bit string for the sets, A = {1,3,5,7,9} and B = {1,2,3,4,5} are 1010101010 and
1111100000 respectively. If the universal set is U = {1, 2….,10} is represented 1111111111
which of the following is false?
a) A U B = 1111111010 b) A ⋂ B = 1010100000
c) A – B= 0000001010 d) AC = 0000011111
Ans: d
Q There are 100 people in a room. In this group 60 are men, 30 are young and 10 are young
men, then the number of old women is______?
a)12 b)20 c)30 d)80
Ans: b
Q how many possible integers are there that are <= 91 and are relatively prime to 91?
a)52 b)62 c)72 d)19
Ans: c
• Idempotent law
o AUA=A
o A⋂A=A
• Associative law
o (A U B) U C = A U (B U C)
o (A ⋂ B) ⋂ C= A ⋂ (B ⋂ C)
• Commutative law
o AUB=BUA
o A⋂B=B⋂A
• Distributive law
o A U (B ⋂ C) = (A U B) ⋂ (A U C)
o A ⋂ (B U C) = (A ⋂ B) U (A ⋂ C)
• De Morgan’s law
o (A U B) C = AC ⋂ BC
o (A ⋂ B) C = AC U BC
• Identity law
o AUɸ=A
o A⋂ɸ=ɸ
o AUU=U
o A⋂U=A
• Complement law
o A U AC = U
o A ⋂ AC = ɸ
o UC = ɸ
o ɸC = U
• Involution law
o ((A)C) C = A
Cartesian Product
● Cartesian Product: - of two sets A and B in the set of all ordered pairs, whose first
member belongs to the first set and second member belongs to the second set,
denoted by A * B.
● It is a kind of maximum relation possible, where every member of the first set belong
to every member of the second set. A*B = {(a, b) | a ∈ A and b ∈ B}
● For E.g. if A = {a, b}, B = {1, 2, 3}, A*B = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3)}
● In general, commutative law does not hold good A* B != B*A
● If |A| = m and |B| = n then |A*B| = m.n
Q Let A be a finite set of size n. The number of elements in the power set of A×A is: (GATE-
1993) (1 Marks)
a) 2^(2^n) b) 2^(n^2) c) 2^n
d) 2^n e) None of the above
Answer: (B)
Relation
● Relation: - Let A and B are sets then every subset of ‘A*B’ is called a relation from A
to B.
● If |A| =m and |B| = n then total no of element(pair) will be m*n, every element will
have two choice weather to present or not present in the subset(relation), therefore
the total number of relation possible is 2m.n.
● Largest relation possible will be A*B
● Smallest possible relation will be ɸ
● Complement of a relation: - Let R be a relation from A to B, then the complement of
relation will be denoted by R’, RC or R. R = {(a,b)|(a,b) ϵ A*B, (a,b) ϵ! R}
o R’ = (A*B) – R
o R U R’ = A*B
o R ⋂ R’ = ɸ
● For E.g. if A*B = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3)}, R= {(a, 1), (a, 3), (b, 2)},
R’ = {(a, 2), (b, 1), (b, 3)}
● Inverse of a relation: - Let R be a relation from A to B, then the inverse of relation will
be a relation from B to A, denoted by R-1. R-1 = {(b, a) | (a, b) ∈ R}
● A*B = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3)}
● R = {(a, 1), (a, 3), (b, 2)}
● R-1 = {(1, a), (3, a), (2, b)}
● |R|=| R-1 |
Diagonal relation: - A relation R on a set A is said to be diagonal relation if, R is a set of all
ordered pair (x,x), for every ∀x ∈ A, sometimes it is also denoted by ▲A
R = {(x, x) | ∀ x ∈ A}
Q The number of binary relations on a set with n elements is: (GATE-1999) (1 Marks)
(A) n² (B) 2^n (C) 2^n² (D) None of the above
Answer: (C)
Types of a Relation
• To further study types of relations, we consider a set A with n elements, then a
cartesian product A*A will have n2 elements(pairs). Therefore, total number of
relation possible is 2n * n
Q consider a set A = {1,2,3}, find which of the following relations are reflexive and
Irreflexive?
Relation Reflexive Irreflexive
A*A Yes No
ɸ No Yes
{(1,1), (2,2), (3,3)} Yes No
{(1,2), (2,3), (1,3)} No Yes
{(1,1), (1,2), (2,1), (2,2)} No No
{(1,1), (2,2), (3,3), (1,3), (2,1)} yes No
{(1,3), (2,1), (2,3), (3,2)} no yes
Q Consider a set A = {a, b, c} and R1, R2, R3 and R4 are relations on A which of the following
is not true?
Symmetric Anti-Symmetric Asymmetric
R1 = {(a, a), (c, c)} y Y T
R2 = {(a, b), (b, a), (a, c)} n N T
R2 = {(a, b), (b, c), (a, c)} n Y T
R2 = {(a, b), (b, a), (c, c)} y n T
Q Consider the binary relation R = {(x, y), (x, z), (z, x), (z, y)} on the set {x, y, z}. Which one of
the following is TRUE? (GATE-2009) (1 Marks)
(A) R is symmetric but NOT antisymmetric
(B) R is NOT symmetric but antisymmetric
(C) R is both symmetric and antisymmetric
(D) R is neither symmetric nor antisymmetric
Answer: (D)
Q Let R be a relation on the set of ordered pairs of positive integers such that ((p, q), (r, s))
∈ R if and only if p–s = q–r. Which one of the following is true about R? (GATE-2015) (2
Marks)
(A) Both reflexive and symmetric
(B) Reflexive but not symmetric
(C) Not reflexive but symmetric
(D) Neither reflexive nor symmetric
Answer: (C)
Q How many relations are there on a set with n elements that are symmetric and a set with
n elements that are reflexive and symmetric? (NET-Dec-2012)
a) 2n(n+1)/2 and 2n.3n(n–1)/2 b) 3n(n–1)/2 and 2n(n–1)
C) 2n(n+1)/2 and 3n(n–1)/2 D) 2n(n+1)/2 and 2n(n–1)/2
Answer: (d)
Transitive relation: - A relation R on a set A with cartesian product A*A is said to be
Transitive,
If ∀ a, b ∈ A
(a, b) ∈ R
(b, c) ∈ R
……………………………
(a, c) ∈ R
……………………………
• Smallest Asymmetric relation is ɸ
• Largest Asymmetric relation will contain A*A elements
• If two relations R1 and R2 are Transitive then their union need not to be transitive
but intersection will also be transitive.
Relation Transitive
A*A Y
ɸ N
{(1,1), (2,2), (3,3)} Y
{(1,2), (2,3), (1,3)} y
{(1,1), (1,2), (2,1), (2,2)} y
{(1,1), (2,2), (3,3), (1,3), (2,1)} n
{(1,3), (2,1), (2,3), (3,2)} N
{(1,2)} y
{(1,3), (2,3)} Y
{(1,2), (1,3)} Y
{(2,3), (1,2)} n
1 2 3
Column (1,3) (2,3) (1,3)
Row (1,3) (2) (1,2,3)
(1,1), (1,3), (3,1), (2,2), (3,2) (1,1), (1,2), (1,3),
(3,3) (3,1), (3,2), (3,3)
Q Let R be the relation on the set of positive integers such that a R b if and only if a and b
are distinct and have a common divisor other than 1. Which one of the following
statements about R is True? (GATE-2015) (1 Marks)
(A) R is symmetric and reflexive but not transitive
(B) R is reflexive but not symmetric and not transitive
(C) R is transitive but not reflexive and not symmetric
(D) R is symmetric but not reflexive and not transitive
Answer: (D)
Q A relation R in {1, 2,3,4,5,6} is given by {(1,2), (2,3), (3,4), (4,4), (4,5)}. This relation is:
(NET-Dec-2008)
a) Reflexive b) Symmetric
c) Transitive d) not reflexive, not symmetric and not transitive
Answer: (a)
0 1 0
Q the transitive closure of a relation R on a set A whose relation matrix 0 0 1 is: (NET-
1 0 0
June-2005)
0 1 0 1 1 0 1 1 1 0 1 1
a) 0 0 1 b) 1 1 0 c) 1 1 1 d) 0 1 1
1 0 0 1 1 0 1 1 1 0 1 1
Ans: c
Q The transitive closure of the relation {(1,2), (2,3), (3,4), (5,4)} on the set {1,2,3,4,5} is
___________. (GATE-1989) (2 Marks)
The transitive closure of the relation R = {(1,2),(2,3),(1,3) ,(3,4),(2,4),(1,4),(5,4)}
Equivalence Relation: - A relation R on a set A with cartesian product A*A is said to be
Equivalence, if it is
• Reflexive
• Symmetric
• Transitive
If two relations R1 and R2 are Equivalence then their union need not to be equivalence but
intersection will also be Equivalence.
Q Let R and S be any two equivalence relations on a non-empty set A. Which one of the
following statements is TRUE? (GATE-2005) (2 Marks)
(A) R ∪ S, R ∩ S are both equivalence relations
(B) R ∪ S is an equivalence relation
(C) R ∩ S is an equivalence relation
(D) Neither R ∪ S nor R ∩ S is an equivalence relation
Answer: (C)
Q Let R1 and R2 be two equivalence relations on a set. Consider the following assertions
(GATE-1998) (1 Marks)
(i) R1 U R2 is an equivalence relation
(ii) R1 ∩ R2 is an equivalence relation
Which of the following is correct?
a) Both assertions are true
b) Assertions (i) is true but assertions (ii) is not true
c) Assertions (ii) is true but assertions (i) is not true
d) Neither (i) nor (ii) is true
Answer: C
Q Let A = {1,2,3,4,5} is a set having partitions as {1, 4}, {2, 3, 5} , find the equivalence
relation from which these partitions are created?
R = {(1, 4)* (1, 4), (2, 3, 5)* (2, 3, 5)}
R = {(1,1),(2,2),(3,3),(4,4),(5,5),(1,4),(4,1),(2,3),(3,2),(2,5),(5,2)(3,5)(5,3)}
Q A relation R is defined on the set of integers as x Ry iff (x + y) is even. Which of the
following statements is true? (GATE-2000) (2 Marks)
(a) R is not an equivalence relation
(b) R is an equivalence relation having 1 equivalence class
(c) R is an equivalence relation having 2 equivalence classes
(d) R is an equivalence relation having 3 equivalence classes
Answer: C
Q Let S be a set of n elements. The number of ordered pairs in the largest and the smallest
equivalence relations on S are (GATE-2007) (1 Marks)
(A) n and n (B) n2 and n (C) n2 and 0 (D) n and 1
Answer: (B)
Q Suppose A is a finite set with n elements. The number of elements in the largest
equivalence relation of A is? (GATE-1998) (1 Marks)
(a) n (b) n2 (c) 1 (d) n + 1
Ans: c
Q How many different equivalence relations with exactly three different equivalence
classes are there on a set with five elements? (NET-July-2016)
(A) 10 (B) 15 (C) 25 (D) 30
Answer: (C)
Q “x^1 is a clone of x” means x^1 is identical to x in terms of the physical attributes namely,
height, weight and complexion. Given, height, weight and complexion only form a complete
set of attributes for an entity, cloning is an equivalence relation. What is your impression
about this statement? (NET-June-2010)
a) The statement is true b) The statement is false
c) The truth value of the statement cannot be computed d) None of these
Answer: (a)
Partial Order Relation: - A relation R on a set A with cartesian product A*A is said to be
partial order, if it is
• Reflexive
• Anti - Symmetric
• Transitive
Partial ordering set (Poset): - a set A with partial ordering relation R defined on A is called a
POSET and is denoted by [A; R]
For e.g. [A, /], [A, <=], [P(S), ⊑]
Total order relation: - A Poset [A; R] is called a total order set, if every pair of elements are
comparable i.e. either (a, b) or (b, a) x ∈ R, for ∀ a, b ∈ A
For e.g. A = {1, 2, 3, 6}, then Poset [A,/] is not a total order relation but A = {1248} will be
Q A relation R is defined on ordered pairs of integers as follows: (x, y) R (u, v) if x < u and y >
v. Then R is (GATR-2006) (1 Marks)
(A) Neither a Partial Order nor an Equivalence Relation
(B) A Partial Order but not a Total Order
(C) A Total Order
(D) An Equivalence Relation
Answer: A
Q A partial order P is defined on the set of natural numbers as follows. Here x/y denotes integer division.
(GATE-2007) (2 Marks)
(1) (0,0) ∈ P (2) (a, b) ∈ P if and only if a % 10 <= b % 10 and (a/10, b/10) ∈ P.
Consider the following ordered pairs:
(i) (101,22) (ii) (22,101) (iii) (145,265) (iv) (0,153)
a) I & iii b) ii & iv c) I & iv d) iii & iv
Ans : d
Conversion of poset into a Hasse Diagram
If we want to study Partial order relation further then it will be better to convert it into
more convinent notation so that it can be studied easily. This graphical representation is
called Hasse Diagram
Stepts to convert partial order relation into hasse diagram
1- Draw a vertex for each element in the Set
2- If (a,b) ϵ R then draw an edge from a to b
3- Remove all Reflexive and Transitive edges
4- Remove the direction of edges and arrange them in the increasing order of heights.
Q Consider a Partial order relation and convert it into hasse diagram?
R = {(1,1), (1,2), (1,4), (1,8), (2,2), (2,4), (2,8), (4,4), (4,8), (8,8)}
Q Consider the Poset ({3,5,9,15,24,45}, /). Which of the following is correct for the given
Poset? (NET-JUNE-2019)
a) There exist a greatest element and a least element
b) There exist a greatest element but not a least element
c) There exist a least element but not a greatest element
d) There does not exist a greatest element and a least element
Ans: d
Lattice
Join Semi Lattice :- A hasse diagram/Partial order relation is called Join Semi Lattice if for
every elements their exists a Join.
Meet Semi Lattice :- A hasse diagram/Partial order relation is called Meet Semi Lattice if for
every elements their exists a Meet.
Lattice :- A hasse diagram/Partial order relation is called Lattice if their exist a Join and
Meet for every pair of element. Or A hasse diagram/Partial order relation is called Latice if
it is both Join Semi Lattice and Meet Semi Lattice.
Q Consider the following hasse diagram, find which of the following is true?
• The area of logic that deals with propositions is called the propositional calculus or
propositional logic or predicate calculus (study of propositions). It was first developed
systematically by the Greek philosopher Aristotle more than 2300 years ago.
• We now turn our attention to methods for producing new propositions from those
that we already have. These methods were discussed by the English mathematician
George Boole in 1854 in his book The Laws of Thought.
If a set of Premises(P) yield another proposition Q(Conclusion), then it is called an Argument
and it is denoted by
{P1, P2, P3..., PN} |- Q
P1
P2
P3
.
.
PN
……
Q
…….
An argument is said to be valid if the conclusion Q can be derived from the premises by
applying the rules of inference. Premises is a statement that provides reason or support for
the conclusion.
A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either
true or false, but not both.
For e.g.
• Delhi is the capital of USA
• How are you doing
• 5<= 11
• Temperature is less than 10 C
• It is cold today
• Read this carefully
• X+y=z
• Law of contradiction - the law of non-contradiction (LNC) (also known as the law of
contradiction, principle of non-contradiction (PNC), or the principle of contradiction)
states that contradictory propositions cannot both be true in the same sense at the same
time. e.g. the two propositions "A is B" and "A is not B" are mutually exclusive.
• Law of excluded middle - the law of excluded middle (or the principle of excluded middle)
states that for any proposition, either that proposition is true or its negation is true.
•
Types of proposition
We use letters to denote propositional variables (or statement variables), that is, variables
that represent propositions, just as letters are used to denote numerical variables. The
conventional letters used for propositional variables are p, q, r, s. The truth value of a
proposition is true, denoted by T, if it is a true proposition, and the truth value of a
proposition is false, denoted by F, if it is a false proposition.
Many mathematical statements are constructed by combining one or more propositions.
New propositions, called compound propositions, are formed from existing propositions
using logical operators.
Operators / Connectives
Negation: - let p be a proposition. The negation of p, denoted by ¬p, is the statement “it is
not the case that p”.
The truth value of the negation of p, ¬p, is the opposite of the truth value of p.
e.g. “Michael’s PC runs Linux” = “It is not the case that Michael’s PC runs Linux.” = “Michael’s
PC does not run Linux.”
“Vandana’s smartphone has at least 32GB of memory” = “It is not the case that Vandana’s
smartphone has at least 32GB of memory.” = “Vandana’s smartphone does not have at least
32GB of memory” = “Vandana’s smartphone has less than 32GB of memory.”
Negation
P ¬P
F T
T F
The negation operator constructs a new proposition from a single existing proposition.
Conjunction
• 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.
Conjunction
p q p∧q
F F F
F T F
T F F
T T T
• e.g. p is the proposition “Rebecca’s PC has more than 16 GB free hard disk space” and q is
the proposition “The processor in Rebecca’s PC runs faster than 1 GHz.”
• The conjunction of , p q, is the proposition “Rebecca’s PC has more than 16 GB free hard disk
space, and the processor in Rebecca’s PC runs faster than 1 GHz.” This conjunction can be
expressed more simply as “Rebecca’s PC has more than 16 GB free hard disk space, and its
processor runs faster than 1 GHz.”
¬ (p ∧ q) ¬ (p ∧ q)
p q
¬q ¬p
(p ∧ q) P
p p∧q
¬ (p ∧ q) ¬ (p ∧ q)
¬p ¬p
q ¬q
P
q
p∧q
Disjunction
• 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.
Disjunction
p q p∨q
F F F
F T T
T F T
T T T
(p ∧ q) (p ∨ q)
(p ∨ q) (p ∧ q)
(p ∨ q) (p ∨ q)
¬p ¬q
q p
(p ∨ q) (p ∨ q)
p p
¬q q
¬ (p ∨ q) (p ∨ q)
¬p p
P
p∨q
XOR(Exclusive-OR)
• When the exclusive or is used to connect the propositions p and q, the proposition “p or q
(but not both)” is obtained. This proposition is true when p is true and q is false, and when
p is false and q is true, denoted by p ⊕ q. It is false when both p and q are false and when
both are true.
XOR(Exclusive-OR)
p q p⊕q
F F F
F T T
T F T
T T F
(p ⊕ q) (p ∨ q)
(p ∨ q) (p ⊕ q)
(p ⊕ q) (p ⊕ q)
p ¬p
¬ (p ∨ q) (p ∧ q)
(p ⊕ q) (p ⊕ q)
Implication
• Let p and q be propositions. The conditional statement p → q is the proposition “if p,
then q”. The conditional statement p → q is false when p is true and q is false, and true
otherwise.
• Conditional statement p → q is called the hypothesis (or antecedent or premise) and q
is called the conclusion. The statement p → q is called a conditional statement because
p → q asserts that q is true on the condition that p holds. A conditional statement is
also called an implication.
Implication
p q p→q
F F T
F T T
T F F
T T T
e.g. Let p be the statement “Maria learns discrete mathematics” and q the statement “Maria
will find a good job.” Express the statement p → q as a statement in English.
“If Maria learns discrete mathematics, then she will find a good job.” = “Maria will find a
good job when she learns discrete mathematics.” = “For Maria to get a good job, it is
sufficient for her to learn discrete mathematics.” = “Maria will find a good job unless she
does not learn discrete mathematics.”
p → q implication
q → p converse
¬p → ¬q inverse
¬q → ¬p contra positive
p → q = ¬q → ¬p
p → q will be true if either p is false or q is true, p → q = ¬p ∨ q
Modus Modus
Ponens Tollens
p →q p →q
p ¬q
q ¬p
¬p q
p →q p →q
¬ (p → q) ¬ (p → q)
¬q p
Bi-conditional
Let p and q be propositions. The biconditional statement p ↔ q is the proposition “ p if
and only q”. the biconditional statement p ↔ q is true when p and q have the same values,
and false otherwise. Biconditional statements are also called bi-implications.
p←→ q = (p → q ) ∧ ( q → p)
Implication
p q P↔q
F F T
F T F
T F F
T T T
Q Find which of the following argument is valid?
p →q
q →r p →r P
p →r q →s Q
¬r ∨ ¬s r
¬p ∨ ¬q
p ∨q
p →r
q →r
r
P
q ¬p
p ∨q q
p →r
q →s
r ∨s
Type of cases
Tautology/valid: - A propositional function which is always having truth in the last column, is
called tautology. E.g. p ∨ ¬ p
p ¬p p ∨ ¬p
F T T
T F T
p ¬p p ∧ ¬p
F T F
T F F
p q p∨q
F F F
F T T
T F T
T T T
{∧, ¬}
{∨, ¬}
Q “If my computations are correct and I pay the electric bill, then I will run out of money. If I
don’t pay the electric bill, the power will be turned off. Therefore, if I don’t run out of money
and the power is still on, then my computations are incorrect.” Convert this argument into
logical notations using the variables c, b, r, p for propositions of computations, electric bills,
out of money and the power respectively. (Where ¬ means NOT) (NET-June-2015)
A) if (c Λ b) → r and ¬b → p, then (¬r Λ p) → ¬c
B) if (c ∨ b) → r and ¬b → ¬p, then (r Λ p) → c
C) if (c Λ b) → r and ¬p → b, then (¬r ∨ p) → ¬C
D) if (c ∨ b) → r and ¬b → ¬p, then (¬r Λ p) → ¬c
Ans. A
Q the statement (¬p) ⟹ (¬q) is logically equivalent to which of the statement below? (GATE-
2017) (1 Marks)
1) p ⟹ q 2) q ⟹ p 3) (¬q) ∨ (p) 4) (¬p) ∨ q
a) 1 only b) 1 and 4 only c) 2 only d) 2 and 3 only
Answer: (D)
Q The Boolean function [~(~p ∧ q) ∧ ~( ~p ∧ ~q)] ∨ (p ∧ r)] is equal to the Boolean function:
(NET-Aug-2016)
a) q b) p ∧ r c) p ∨ q d) p
Ans. D
Q The first order logic (FOL) statement ((R ∨ Q) ∧ (P ∨ ¬Q)) is equivalent to which of the
following? (NET-Jan-2017)
A) ((R ∨ ¬Q) ∧ (P ∨ ¬Q) ∧ (R ∨ P)) B) ((R ∨ Q) ∧ (P ∨ ¬Q) ∧ (R ∨ P))
C) ((R ∨ Q) ∧ (P ∨ ¬Q) ∧ (R ∨ ¬P)) D) ((R ∨ Q) ∧ (P ∨ ¬Q) ∧ (¬R ∨ P))
Ans. B
Q An example of a Tautology is: (NET-June-2008)
a) x ∨ y b) x ∨ ¬y c) x ∨ ¬x d) (x → y) ∧ (y → x)
Q P and Q are two propositions. Which of the following logical expressions are equivalent?
(GATE-2008) (2 Marks)
A) P ∨ ¬Q B) ¬(¬P ∧ Q)
C) (P ∧ Q) ∨ (P ∧ ¬Q) ∨ (¬P ∧ ¬Q) D) (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 and IV
Answer: (B)
Q If the proposition ¬p → q is true, then the truth value of the proposition ¬p ∨ (p → q),
where ¬ is negation, ∨ is inclusive OR and → is implication, is (NET-dec-2005)
a) True b) Multiple Values c) False d) Cannot be determined
Ans: d
Q Indicate which of the following well-formed formulae are valid: (GATE-1990) (2 Marks)
a) [(P ⇒ Q) ∧ (Q ⇒ R)] ⇒ (P ⇒ R) b) (P ⇒ Q) ⇒ (¬P ⇒ ¬Q)
c) (P ∧ (¬P ∨ ¬Q)) ⇒ Q d) (P ⇒ R) ∨ (Q ⇒ R) ⇒ ((P ∨ Q) ⇒ R)
Answer: (A)
Q Consider two well-formed formulas in propositional logic
F1:P⇒¬P F2:(P⇒¬P) ∨ (¬P⇒P)
Which one of the following statements is correct? (GATE-2001) (1 Marks)
A) F1 is satisfiable, F2 is valid B) F1 unsatisfiable, F2 is satisfiable
C) F1 is unsatisfiable, F2 is valid D) F1 and F2 are both satisfiable
Answer: (A)
Q If the proposition ¬p → q is true, then the truth value of the proposition ¬p ∨ (p → q),
where ¬ is negation, ∨ is inclusive OR and → is implication, is (GATE-1995) (2 Marks)
a) True b) Multiple Values b) False c) Cannot be determined
Answer: (D)
P Q P⊙Q
T T T
T F T
F T F
F F T
Let ∼ be the unary negation (NOT) operator, with higher precedence then ⊙.
Which one of the following is equivalent to A∧B?
a) (∼A⊙B) b) ∼(A⊙∼B) c) ∼(∼A⊙∼B) d) ∼(∼A⊙B)
Answer: (D)
p →q
q →r
¬r
¬p
r →s
p →q
r∨p
s∨q
¬p → ¬r
¬S
P→w
R∨s
W
(p → (r → s))
¬r → ¬p
p
s
¬x → y
¬x ∧ ¬y
x
(p → (q → s))
¬r ∨ p
q
p
s
First order Predicate Logic
Statement involving variables
‘x > 3’
these statements is neither true nor false when the value of the variable is not specified. In
first order predicate logic we will see the ways that proposition can be produced from such
statements.
This statement has two parts first part variable x, which is the subject of the statements.
The second part predicate >3, refers to the property that the subject of the statement can
have.
First-order logic is symbolized reasoning in which each sentence, or statement, is broken
down into a subject and a predicate.
We can denote the statement x is greater than 3 by P(x), where P denotes the predicates.
“>3” and x is the variable. The statement P(x) is also said to be the value of the propositional
function P at x. once a value has been assigned to the variable, the statement p(x) becomes a
proposition and has a truth value.
In general, a statement involving then n variable x1, x2, x3…. xn can be denoted by P (x1, x2,
x3…., xn)
A statement of the form P (x1, x2, x3…., xn) is the value of the propositional function p at the
n-tuple (x1, x2, x3…, xn) and p is also called a predicate.
When all the variables in a propositional function are assigned values, the resulting
statements becomes a proposition with a certain truth value or false value. However, there is
another important way called quantification, to create a proposition from a propositional
function. The area of logic that deals with predicates and quantifiers is called the predicate
calculus.
Universal quantifiers: - the universal quantification of a propositional function is the
proposition that asserts that P(x) is true for all values of x in the universe of discourse. The
universe of discourse specifies the possible value of x.
Existential quantifiers: - with existential quantifier of a propositional that is true if and only if
P(x) is true for at least one value of x in the universe of discourse. There exists an element a x
is the universe of discourse such that P(x) is true.
Negation
In logic and mathematics second-order logic is an extension of first-order logic, which itself is
an extension of propositional logic. Second-order logic is in turn extended by higher-order
logic and type theory.
Universal specification: - is used to conclude P(c) is true, where c is a particular member of
universe of discourse, given the premise ∀x P(x).
i.e. if ∀x P(x) then P(c) is true. Where c is nay element in the universe of discourse.
Universal generalization: - is the rule of inference that states that ∀x P(x) is true given the
premise that P(c) is true for all element c in the universe of discourse. If P(c) is true for any
element c in the universe of discourse then ∀x P(x)
Existential specification: - is the rule that allows us to conclude that there is an element c. in
the universe of discourse for which P(c) is true if we know that ∃x P(x) is true. We cannot
select an arbitrary value of c here but rather it must be a c from which P(c) is true. i.e. if ∃x
P(x) then for an element a in the universe of discourse. P(a)
Existential generalization: - is the rule of inference that is used to conclude that ∃x P(x) is
true when a particular element c with P(c) true is known. i.e. if we know one element c in the
universe of discourse for which P(c) is true, then we know that ∃x P(x) is true.
GATE Practice question (Quantifier)
Q Which one of the following is NOT logically equivalent to ¬∃x(∀y(α) ∧ ∀z(β))? (GATE-2013)
(2 Marks)
a) ∀x(∃z(¬β) → ∀y(α)) b) ∀x(∀z(β) → ∃y(¬α))
c) ∀x(∀y(α) → ∃z(¬β)) d) ∀x(∃y(¬α) → ∃z(¬β))
Answer: (A & D)
Q Let a(x, y), b(x, y,) and c(x, y) be three statements with variables x and y chosen from some
universe. Consider the following statement: (GATE-2004) (2 Marks)
(∃x)(∀y) [(a(x, y) ∧ b(x, y)) ∧ ¬c(x, y)]
Which one of the following is its equivalent?
a) (∀x)(∃y) [(a(x, y) ∨ b(x, y)) → c(x, y)] b) (∃x)(∀y)[(a(x, y) ∨ b(x, y)) ∧ ¬c(x, y)]
c) ¬(∀x)(∃y)[(a(x, y) ∧ b(x, y)) → c(x, y)] d) ¬(∀x)(∃y)[(a(x, y) ∨ b(x, y))→c(x, y)]
Answer: (C)
Q Which one of the following well-formed formulae in predicate calculus is NOT valid?
a) (∀x p(x) ⟹ ∀x q(x)) ⟹ (∃x ¬p(x) ∨ ∀x q(x))
b) (∃x p(x) ∨ ∃x q(x)) ⟹ ∃x(p(x) ∨ q(x))
c) ∃x(p(x) ∧ q(x)) ⟹ (∃x p(x) ∧ ∃x q(x))
d) ∀x(p(x) ∨ q(x)) ⟹ (∀x p(x) ∨ ∀x q(x)) (GATE-2016) (2 Marks)
Answer: (D)
Q Which of the following predicate calculus statements is/are valid? (GATE-1992) (1 Marks)
a) (∀(x))P(x) ∨ (∀(x))Q(x) ⟹ (∀(x))(P(x)∨Q(x))
b) (∃(x))P(x) ∧ (∃(x))Q(x) ⟹ (∃(x))(P(x) ∧ Q(x))
c) (∀(x))(P(x) ∨ Q(x)) ⟹ (∀(x))P(x) ∨ (∀(x))Q(x)
d) (∃(x))(P(x) ∨ Q(x))⟹∼(∀(x))P(x) ∨ (∃(x))Q(x)
Answer: (A)
Q Let P(x) and Q(x) be arbitrary predicates. Which of the following statements is always
TRUE? (GATE-2005) (2 Marks)
(A) ((∀x(P(x) ∨ Q(x)))) ⟹ ((∀xP(x)) ∨ (∀xQ(x)))
(B) (∀x(P(x) ⟹ Q(x))) ⟹ ((∀xP(x)) ⟹ (∀xQ(x)))
(C) (∀x(P(x)) ⟹ ∀x(Q(x))) ⟹ (∀x(P(x) ⟹ Q(x)))
(D) (∀x(P(x)) ⇔ (∀x(Q(x)))) ⟹ (∀x(P(x) ⇔ Q(x)))
Answer: (B)
Q Which of the following is a valid first order formula? (Here α and β are first order formulae
with x as their only free variable) (GATE-2003) (2 Marks)
a) {(∀x)[α] ⇒ (∀x)[β]} ⇒ {(∀x)[α ⇒ β]}
b) (∀x)[α]⇒(∃x)[α∧β]
b) {(∀x)[α ∨ β]} ⇒ {(∃x)[α]) ⇒ (∀x)[α]}
c) (∀x)[α ⇒ β] ⇒ (((∀x)[α]) ⇒ (∀x)[β])
Answer: (D)
Q Let P(m, n) be the statement “m divides n” where the universe of discourse for both the
variables is the set of positive integers. Determine the truth values of each of the following
propositions: (NET-Dec-2013)
I. ∀m ∀n P(m, n), II. ∃m ∀n P(m, n)
(A) Both I and II are true (B) Both I and II are false
(C) I – false & II – true (D) I – true & II – false
ANS: C
Q Let P(m, n) be the statement “m divides n” where the Universe of discourse for both the
variables is the set of positive integers. Determine the truth values of the following
propositions. (NET-Dec-2015)
(a)∃m ∀n P(m, n) (b)∀n P(1, n) (c) ∀m ∀n P(m, n)
Codes:
A) (a) - True; (b) - True; (c) – False B) (a) - True; (b) - False; (c) – False
C) (a) - False; (b) - False; (c) – False D) (a) - True; (b) - True; (c) – True
Ans. A
Q The CORRECT formula for the sentence, “not all rainy days are cold” is (GATE-2014) (2
Marks)
a) ∀d (Rainy(d) ∧ ~Cold(d)) b) ∀d (~Rainy(d) → Cold(d))
c) ∃d (~Rainy(d) → Cold(d)) d) ∃d (Rainy(d) ∧ ~Cold(d)
Answer: (D)
Q Which one of the following is the most appropriate logical formula to represent the
statement? “Gold and silver ornaments are precious”. The following notations are used:
G(x): x is a gold ornament
S(x): x is a silver ornament
P(x): x is precious (GATE-2009) (2 Marks)
(A) ∀x (P(x) → (G(x) ∧ S(x))) (B) ∀x ((G(x) ∧ S(x)) → P(x))
(C) ∃x ((G(x) ∧ S(x)) → P(x) (D) ∀x ((G(x) ∨ S(x)) → P(x))
Answer: (D)
Q Suppose the predicate F (x, y, t) is used to represent the statement that person x can fool
person y at time t. which one of the statements below expresses best the meaning of the
formula ∀x∃y ∃t (¬F (x, y, t))? (GATE-2010) (2 Marks)
(A) Everyone can fool some person at some time
(B) No one can fool everyone all the time
(C) Everyone cannot fool some person all the time
(D) No one can fool some person at some time
Answer: (B)
Q What is the correct translation of the following statement into mathematical logic?
Q What is the first order predicate calculus statement equivalent to the following?
Q Identify the correct translation into logical notation of the following assertion.
Some boys in the class are taller than all the girls
Q Let fsa and pda be two predicates such that fsa(x) means x is a finite state automaton, and
pda(y) means that y is a pushdown automaton. Let equivalent be another predicate such that
equivalent (a, b) means a and b are equivalent. Which of the following first order logic
statements represents the following. Each finite state automaton has an equivalent
pushdown automaton. (GATE-2008) (1 Marks)
a) (∀x fsa(x)) ⟹ (∃y pda(y) ∧ equivalent(x, y))
b) ¬∀y(∃x fsa(x) ⟹ pda(y) ∧ equivalent(x, y))
c) ∀x∃y (fsa(x) ∧ pda(y) ∧ equivalent(x, y))
d) ∀x∃y(fsa(y) ∧ pda(x) ∧ equivalent(x, y))
Answer: (A)
Q Which one of the first order predicate calculus statements given below correctly express
the following English statement? (GATE-2006) (2 Marks)
Q The truth value of the statements : ∃!xP(x) → ∃xP(x) and ∃!x~ P(x) → ~∀xP(x), (where the
notation ∃!xP(x) denotes the proposition “There exists a unique x such that P(x) is true”) are :
(NET-Dec-2013)
(A) True and False (B) False and True
(C) False and False (D) True and True
Q The notation ∃!xP(x) denotes the proposition “there exists a unique x such that P(x) is
true”. Give the truth values of the following statements: (NET-June-2014)
I. ∃!xP(x) → ∃xP(x) II. ∃!x ¬ P(x) → ¬∀xP(x)
(A) Both I & II are true. (B) Both I & II are false.
(C) I – false, II – true (D) I – true, II – false
Q Which one of the following options is CORRECT given three positive integers x, y and z, and
a predicate? (GATE-2011) (2 Marks)
P(x) = ¬(x=1) ∧∀y(∃z(x=y*z) ⇒(y=x) ∨(y=1))
(A) P(x) being true means that x is a prime number
(B) P(x) being true means that x is a number other than 1
(C) P(x) is always true irrespective of the value of x
(D) P(x) being true means that x has exactly two factors other than 1 and x
Answer: (A)
Group Theory
• Group theory is very important mathematical tool which is used in a number of areas
in research and application. Using group theory, we can estimate the strength of a
set with respect to an operator.
• This idea will further help us in research field to identify the correct mathematical
system to work in a particular research area. E.g. can we use natural in complex
problem area like soft computing or studying black holes.
• now we will directly study some of the basic set related properties and will define
some structure based on the properties and will check those properties on basics
number systems like natural numbers, integers, real numbers etc.
Closure property: - consider a non-empty set A and a binary operation * on A. A is said to
be closed with respect to *, if ∀ a, b ∈ A, then a*b ∈ A.
Algebraic Structure: - A non-empty set A is said to be an algebraic structure with respect to
a binary operation *, if A satisfy closure property with respect to *.
Associative property: - Consider a non-empty set A and a binary operation * on A. A is said
to be associative with respect to *, if ∀ a, b, c ∈ A, then (a*b) *c = a*(b*c)
Semi-Group: - A non-empty set A is said to be a Semi-group with respect to a binary
operation *, if A satisfy closure, Associative property with respect to *.
Identity property: - Consider a non-empty set A and a binary operation * on A. A is said to
satisfy identity property with respect to *, if ∀ a ∈ A, there must be unique e ∈ A, such that
a*e = e*a = a
• If there exist an identity element in a set with respect to *, it will be exactly one.
Monoid: - A non-empty set A is said to be a Monoid with respect to a binary operation *, if
A satisfy closure, Associative, identity property with respect to *.
Inverse property: - Consider a non-empty set A and a binary operation * on A. A is said to
satisfy inverse property with respect to *, if ∀ a ∈ A, there must be unique element a-1 ∈ A,
such that
a* a-1 = a-1*a = e
• Every element has a unique inverse, and no two elements will have the same inverse
• Identity element is its own inverse.
Group: - A non-empty set A is said to be a group with respect to a binary operation *, if A
satisfy closure, Associative, identity, inverse property with respect to *.
• Identity element is always the inverse of itself
• If the total number of elements in a group is even then there exists at least one
element in the group who is the inverse of itself
• Some time it is also possible that every element is inverse of itself in a group
• In a group (a * b)-1 = b-1 * a-1 for ∀ a, b ∈ A
• Cancelation law holds good
a*b=a*c → b=c
a*c=b*c → a=b
Commutative property: - Consider a non-empty set A and a binary operation * on A. A is
said to satisfy commutative property with respect to *, if ∀ a, b ∈ A, such that
a* b = b*a
Abelian Group: - A non-empty set A is said to be a group with respect to a binary operation
*, if A satisfy closure, Associative, identity, inverse, commutative property with respect to *.
Q Some group (G,o) is known to be abelian. Then, which one of the following is true for G?
(GATE-1994) (2 Marks)
A) g = g−1 for every g ∈G B) g=g2 for every g ∈ G
B) (goh)2=g2oh2 for every g, h ∈ G D) G is of finite order
Answer: (c)
Q Which of the following properties a Group G must hold, in order to be an Abelian group?
(a)The distributive property
(b)The commutative property
(c)The symmetric property
a) (a) and (b) b) (b) and (c)
c) (a) and (b) d) (a), (b) and (c)
Ans. D
Q Let A be the set of all non-singular matrices over real number and let ∗ be the matrix
multiplication operation. Then (GATE-1994) (2 Marks)
a) A is closed under ∗ but ⟨A,∗⟩ is not a semigroup.
b) ⟨A,∗⟩ is a semigroup but not a monoid.
c) ⟨A,∗⟩ is a monoid but not a group.
d) ⟨A,∗⟩ is a a group but not an abelian group.
Answer: (d)
Q Which of the following statements is FALSE? (GATE-1996) (1 Marks)
a) The set of rational numbers is an abelian group under addition
b) The set of integers in an abelian group under addition
c) The set of rational numbers form an abelian group under multiplication
d) The set of real numbers excluding zero is an abelian group under multiplication
Answer: (c)
Algebraic Semi-Group Monoid Group Abelian
Structure Group
(N, +) YES YES NO NO NO
(N, -) NO NO NO NO NO
(N, /) NO NO NO NO NO
(N, *) YES YES YES NO NO
(Z, +) YES YES YES YES YES
(Z, -) YES NO NO NO NO
(Z, /) NO NO NO NO NO
(Z, *) YES YES YES NO NO
(R, +) YES YES YES YES YES
(R, -) YES NO NO NO NO
(R, /) NO NO NO NO NO
(R, *) YES YES YES NO NO
(M, +) YES YES YES YES YES
(M, *) YES YES YES NO NO
(E, +) YES YES YES YES YES
(E, *) YES YES NO NO NO
(O, +) NO NO NO NO NO
(O, *) YES YES YES NO NO
(Z*, /) YES YES YES YES NO
(R*, /) YES YES YES YES YES
(M*, *) YES YES YES YES NO
Q let A = {1, 3, 5, ……., ∞} and B = {2, 4, 6, ……., ∞}, what is the highest structure achieved
by each of them?
1) (A,+) 2) (A,*) 3) (B,+) 4) (B,*)
Q Consider a set of natural numbers N, with respect to *, such that a * b = ab which of the
following is true?
a) semi group but not monoid b) A monoid but not a group
c) A group d) not a semi group
Ans: d
Q The binary operator ≠ is defined by the following truth table (GATE-2015) (1 Marks)
p q P! = q
0 0 0
0 1 1
1 0 1
1 1 0
Which one of the following is true about the binary operator ≠?
(A) Both commutative and associative (B) Commutative but not associative
(C) Not commutative but associative (D) Neither commutative nor associative
Answer: (A)
Q let {p, q, r, s} be the set. A binary operation * is defined on the set and is given by the
following table:
* p q r s
P p r s p
q p q r s
r p q p r
S p q q q
Q Consider a set of integers Z, with respect to *, such that a * b = max (a, b) which of the
following is true?
a) Algebraic structure b) semi-group
c) Monoid d) group
Ans: b
Q Consider a set of integers Z, with respect to *, such that a * b = min (a, b) which of the
following is true?
a) Algebraic structure b) semi-group
c) Monoid d) group
Ans: b
Q Consider a set of positive rational number with respect to an operation *, such that a*b =
(a.b)/3, it is known that the it is an abelian group, which of the following is not true?
a) identity element e = 3 b) inverse of a = 9/a
c) inverse of 2/3 = 6 d) inverse of 3 = 3
Ans: c
Q Consider the set ∑* of all strings over the alphabet ∑ = {0, 1}. ∑* with the concatenation
operator for strings (GATE-2003) (1 Marks)
(A) does not form a group
(B) forms a non-commutative group
(C) does not have a right identity element
(D) forms a group if the empty string is removed from ∑*
Answer: (A)
Q Consider the set {a, b, c} with binary operators + and × defined as follows:
+ a b c × a b c
a b a c a a b c
b a b c b b c a
c a c b c c c b
* ea bc
E ea bc
Aabc e
B
C
Q consider a group G = {1,3,5, 7}, *8 which of the following sub set of this set does not form
is sub group?
a) {0,1} b) {1,3} c) {1,5} d) {1,7}
Ans: a
Q G = {1,3,5,7}, *8
then G = {1,3}, *8 G = {1,5}, *8
Q let (A, *) be a group of prime order, how many proper-subgroups are possible for A?
a) 0 b) 1 c) P-1 d) P
Q Let G be a finite group on 84 elements. The size of a largest possible proper subgroup of
G is _______ . (GATE-2014) (1 Marks)
Answer: (42)
Order of an element: - (A, *) be a group, then ∀ a ∈ A, order of a is denoted by O(a)
O(a) = smallest positive Let integer n, such that an = e
• order of identity element is always one
• order of an element and its inverse is always same
• order of an element in an infinite group does not exist or infinite expect identity
Cyclic group: - A group (A, *) is said to be a cyclic group if it contains at least one generator.
• In a cyclic group if an element is a generator than its inverse will also be a generator
• The order of a cyclic group is always the order of the generating element of G
Q consider a set on cube root of unity {1, w, w2}, * and find the order of each element?
Q consider a set on forth root of unity {-1, 1, I, -i}, * and find the order of each element?
Q consider a group {0,1,2,3}, +4 and find the order of each element?
Q consider a group {1,3,5,7}, *8 and find the order of each element {1, w, w2}, *
Q consider a group {1,2,4,7,8,11,13,14}, *15 and find the order of each element?
* a b c d
a a b c d
b b a d c
c c d b A
d d c a b
Number of generators
Lagrange’s theorem: - let A be a cyclic group of order n, number of Generator in A is
denoted by ɸ(n) = {n(p1-1) (p2-1) (p3-1) ………. (pk-1)} / (p1p2p3………pk)
Q There are two elements x, y in a group (G, ∗) such that every element in the group can be
written as a product of some number of x’s and y’s in some order. It is known that
x ∗ x = y ∗ y = x ∗ y ∗ x ∗ y = y ∗ x ∗ y ∗ x = e where e is the identity element. The maximum
number of elements in such a group is __________. (GATE-2014) (2 Marks)
Answer: 4
x * x = e, x is its own inverse
y * y = e, y is its own inverse
(x*y) * (x* y) = e, x*y is its own inverse
(y*x) * (y*x) = e, y*x is its own inverse
also x*x*e = e*e can be rewritten as follows
x*y*y*x = e*y*y*e = e, (Since y *y = e)
(x*y) * (y*x) = e shows that (x *y) and (y *x)
are each other’s inverse and we already know that
(x*y) and (y*x) are inverse of its own.
As per (G,*) to be group any element should have
only one inverse element (unique)
This implies x*y = y*x (is one element)
So the elements of such group are 4 which are
{x, y, e, x*y}.
Graph Theory
• A graph G (V, E) consist of a set off objects V = {V1, V2, V3….,VN} called vertices and
another set E = {E1, E2, E3,….,En} whose elements are called edges.
• Each edge ek is identified with an unordered pair (vi, vj) of vertices.
• The vertices vi, vj associated with edge ek are called the end vertices of ek.
• Self-Loop: Edge having the same vertex (vi, vi) as both its end vertices is called self-loop.
• Parallel Edge: When more than one edge associated with a given pair of vertices such
edges are referred as parallel edges.
• Adjacent Vertices: If two vertices are joined by the same edges, they are called adjacent
vertices.
• Adjacent Vertices: If two edges are incident on some vertex, they are called adjacent
edges.
• Trivial Graph: A graph with only one vertex without an edge is called trivial graph. It is
the smallest possible.
• Complete or Full Graph or universal graph: In a simple graph there exist an edge
between each and every pair of vertices i.e. every vertex are adjacent to each other,
then the graph is said to be a complete graph, denoted by Kn.
o A simple graph with maximum number of edges are called Complete Graph.
o Number of edges in a simple graph is n(n-1)/2
Q The number of edges in a complete graph with N vertices is equal to: (NET-DEC-2006) (NET-
DEC-2007)
a) N (N - 1) b) [N(N-1)]/2 c) N2 d) 2N-1
Answer: (A)
Q The complete graph with four vertices has k edges where k is: (NET-JUNE-2009)
a) 3 b) 4 c) 5 d) 6
Answer: (d)
Q The number of distinct simple graphs with up to three nodes is (GATE-1994) (1 Marks)
a) 15 b) 10 c) 7 d) 9
Answer: (C)
Q How many undirected graphs (not necessarily connected) can be constructed out of a given
set V = {v1, v2, … vn} of n vertices? (GATE-2001) (2 Marks)
(A) n(n-1)/2 (B) 2n (C) n! (D) 2n(n-1)/2
Answer: (D)
Q A simple Graph with ‘n’ vertices and ‘k’ components can have at most (n - k) (n – k + 1)/2
edges?
Ans: The maximum number of edges is clearly achieved when all the components are
complete. Moreover, the maximum number of edges is achieved when all of the components
except one have one vertex.
so if there are k components one component will have n – (k - 1) vertices all the other
components k -1 will have one vertex. So, if a graph has n vertex can have maximum n(n-1)/2
edges, then graph with n – (k - 1) edges will have maximum (n - k) (n – k + 1)/2 edge.
Q Let G be a complete undirected graph on 6 vertices. If vertices of G are labeled, then the
number of distinct cycles of length 4 in G is equal to (GATE-2012) (2 Marks)
(A) 15 (B) 30 (C) 90 (D) 360
Answer: (C)
Q Consider an undirected graph G where self-loops are not allowed. The vertex set of G is {(i,
j): 1 <= i <= 12, 1 <= j <= 12}. There is an edge between (a, b) and (c, d) if |a − c| <= 1 and |b −
d| <= 1. (GATE-2014) (2 Marks) (NET-AUG-2016)
The number of edges in this graph is __________.
Answer: (506)
Q Consider an undirected random graph of eight vertices. The probability that there is an edge
between a pair of vertices is 1/2. What is the expected number of unordered cycles of length
three? (GATE-2013) (1 Marks)
(A) 1/8 (B) 1 (C) 7 (D) 8
Answer: (C)
Q How many graphs on n labeled vertices exist which have at least (n2 – 3n)/2 edges? (GATE-
2004) (2 Marks)
((n^2) – 3n)/2
a) ((n2 - n)/2)C((n2) – 3n)/2 b)∑𝐾=0 ((n2 - n)/2)CK
c) ((n2) - n)/2)Cn d) ∑n𝐾=0 ((n2 - n)/2)CK
Answer: (D)
Q The 2n vertices of a graph G corresponds to all subsets of a set of size n, for n >= 6. Two
vertices of G are adjacent if and only if the corresponding sets intersect in exactly two
elements. The number of vertices of degree zero in G is (GATE-2006) (2 Marks)
(A) 1 (B) n (C) n+1 (D) 2n
Answer: (C)
Explanation: There are n nodes which are single and 1 node which belong to empty set. And
since they are not having 2 or more elements so they won’t be connected to anyone hence
total number of nodes with degree 0 are n+1 hence answer should be none.
Degree of a Vertex
• Degree of a Vertex: The degree of a vertex in an undirected graph is the number of
edges associated with it, denoted by deg(vi).
• Isolated vertex: A vertex with degree zero is called isolated vertex.
• Pendant vertex: A vertex with degree one is called pendant vertex.
• Hand-shaking theorem: - Since each edge contribute two degree in the graph, the sum
of the degree of all vertices in G is twice the number of edges in g. ∑𝑛𝑖=1 𝑑(𝑣𝑖) = 2|E|
• The number of vertices of odd degree in a graph is always even. ∑𝑛𝑖=1 𝑑(𝑣𝑖) =
∑𝑒𝑣𝑒𝑛 𝑑(𝑣𝑖) + ∑𝑜𝑑𝑑 𝑑(𝑣𝑖)
• δ(G) * |V(G)| <= 2|E| <= Δ(G)*|V(G)|, where δ(G) is the minimum possible degree of
any vertex in a graph, where Δ(G) is the maximum possible degree of any vertex in a
graph.
• Regular graph: - A graph in which all the vertices are of equal degree is called a regular
graph. E.g. 2-regular graph, 3-regular graph.
Q Which of the following statements is/are TRUE for undirected graphs? (GATE-2013) (1
Marks)
P: Number of odd degree vertices is even.
Q: Sum of degrees of all vertices is even.
a) P only b) Q only
c) Both P and Q d) Neither P nor Q
Answer: (C)
Q Which one of the following is TRUE for any simple connected undirected graph with more
than 2 vertices?(GATE-2009) (1 Marks)
(A) No two vertices have the same degree.
(B) At least two vertices have the same degree.
(C) At least three vertices have the same degree.
(D) All vertices have the same degree.
Answer: (B)
Q A simple graph G contains 21 edges, 3 vertices pf degree 4 and all the remaining vertices are
of degree 2. Then number of vertices |v| is?
Q A simple non-directed graph G has 24 edges and degree of each vertex is 4, then find the
|v|?
Q Consider a simple graph with 35 edges such that 4 vertex of degree 5, 5 vertex of degree 4, 4
vertex of degree 3, find the number of vertices with degree 2?
Q What is the number of vertices in an undirected connected graph with 27 edges, 6 vertices
of degree 2, 3 vertices of degree 4 and remaining of degree 3? (GATE-2004) (2 Marks)
(A) 10 (B) 11 (C) 18 (D) 19
Answer: (D)
Q simple non-directed graph G has 24 edges and degree of each vertex is K, the which of the
following is possible no of vertices?
a) 20 b) 15 c) 10 d) 8
Q G is undirected graph with n vertices and 25 edges such that each vertex has degree at least
3. Then the maximum possible value of n is ________ (GATE-2017) (2 Marks)
Answer: (16)
Q Maximum no of vertex in a simple graph with 35 edges and degree of each vertex is at least
3 is ________?
Q Minimum number of vertices possible in a simple graph if 41 edges and degree of each
vertex is at most 5?
Q The degree sequence of a simple graph is the sequence of the degrees of the nodes in the
graph in decreasing order. Which of the following sequences cannot be the degree sequence
of any graph? (GATE-2010) (2 Marks)
I. 7, 6, 5, 4, 4, 3, 2, 1 II. 6, 6, 6, 6, 3, 3, 2, 2
III. 7, 6, 6, 4, 4, 3, 2, 2 IV. 8, 7, 7, 6, 4, 2, 1, 1
(A) I and II (B) III and IV (C) IV only (D) II and IV
Answer: (D)
Q An ordered n-tuple (d1, d2, …, dn) with d1 >= d2 >= ⋯ >= dn is called graphic if there exists a
simple undirected graph with n vertices having degrees d1, d2, …, dn respectively. Which of
the following 6-tuples is NOT graphic? (GATE-2014) (2 Marks)
(A) (1, 1, 1, 1, 1, 1) (B) (2, 2, 2, 2, 2, 2)
(C) (3, 3, 3, 1, 0, 0) (D) (3, 2, 1, 1, 1, 0)
Answer: (C)
Some Popular Graph
• Bi-partite graph: - A graph G(V, E) is called bi-partite graph if it’s vertex set V(G) can be
partitioned into two non-empty disjoint subset V1(G) and V2(G) in such a way that each
edge e ϵ E(G) has it’s one end point in V1(g) and other end point in V2(g). The partition V
= V1 U V2 is called bipartition of G.
• Complete Bi-partite graph: - A Bi-partite graph G(V, E) is called Complete bi-partite
graph if every vertex in the first partition is connected to every vertex in the second
partition, denoted by Km,n.
• Cycle Graph: - A cycle graph or circular graph is a graph that consists of a single cycle, or
in other words, some number of vertices (at least 3) connected in a closed chain. The
cycle graph with n vertices is called Cn. The number of vertices in Cn equals the number
of edges, and every vertex has degree 2; that is, every vertex has exactly two edges
incident with it.
• Wheel graph: - A wheel graph is a graph formed by connecting a single universal
vertex to all vertices of a cycle. Some authors write Wn to denote a wheel graph
with n vertices (n ≥ 4); other authors instead use Wn to denote a wheel graph with n+1
vertices (n ≥ 3), which is formed by connecting a single vertex to all vertices of a cycle of
length n.
Q the graph K3,4 has: (NET-DEC-2008)
a) 3 edges b) 4 edges c) 7 edges d) 12 edges
The two distinct sets of vertices, which make the graph bipartite are:
a) (v1, v4, v6); (v2, v3, v5, v7, v8) b) (v1, v7, v8); (v2, v3, v5, v6)
c) (v1, v4, v6, v7); (v2, v3, v5, v8) d) (v1, v4, v6, v7, v8); (v2, v3, v5)
Answer: (C)
Complement of a Graph
• The complement of a simple graph G (V, E) is a graph Gc (V, E) on the same vertices set
as of G, such that there will be an edge between two vertices u, v in Gc if and only if
there is no edge between u, v in G. i.e. two vertices of Gc are adjacent if they are not
adjacent in G.
• V(G) = V(Gc)
• E(Gc) = {(u, v) | (u, v) ∉ E(G)}
• E(Gc) = E(Kn) - E(G)
Properties
• G U Gc = Kn
• G ⋂ Gc = null graph
• |E(G)| + |E(Gc)| = E(Kn) = n(n-1)/2
Q A simple graph G has 30 edges and Gc has 36 edges, the number of vertices in G will be?
Q a simple graph G has |v|=8 and |E|=12, find number of edges in |E(Gc)|?
Q A simple graph G has 56 edges and Gc has 80 edges, the number of vertices in G will be?
Traversal
Walk / Edge Train / Chain: -A Walk is defined as a finite alternating sequence of vertices and
edges, beginning and ending with vertices, such that each edge is incident with the vertices
preceding and following it. No edge is allowed to appear more than once in a walk. A vertex,
however, may appear more than once.
• Vertices with which a walk begins and ends are called its terminal vertices. It is possible
for a walk to begin and end at the same vertex. Such a walk is called a closed walk. A
walk that is not closed is called an open walk.
• An open walk in which no vertex appears more than once is called a path (a path does
not interact itself). Number of edges in a path is called length of a path.
Connected Graph: A graph is said to be connected if there is at one path between every pair of
vertices in G.
Q Consider an undirected graph G with 100 nodes. The maximum number of edges to be
included in G so that the graph is not connected is (NET-SEP-2013)
(A) 2451 (B) 4950 (C) 4851 (D) 9900
Euler Graph
Euler Graph: - If some closed walk in a graph contains all the edges of the graph(connected),
then the walk is called a Euler line and the graph a Euler Graph.
• A given connected graph G is a Euler graph if and only if all vertices of G are of even
degree.
• A connected graph G is Eulerian if and only if its edge set can be decomposed into
cycles.
• The number of edge−disjoint paths between any two vertices of an Euler graph is even.
• An open walk that includes (or traces) all edges of a graph without retracing any edge is
called a unicursal line or open Euler line. A connected graph that has a unicursal line is
called a unicursal graph.
• Clearly by adding an edge between the initial and final vertices of a unicursal line, we
get an Euler line.
Q G is a simple undirected graph. Some vertices of G are of odd degree. Add a node v to G and
make it adjacent to each odd degree vertex of G. The resultant graph is sure to be (GATE-
2008) (2 Marks)
(A) regular (B) Complete (C) Hamiltonian (D) Euler
Answer: (D)
Q An undirected graph possesses an eulerian circuit if and only if it is connected and its vertices
are (NET-DEC-2010)
(A) all of even degree (B) all of odd degree
(C) of any degree (D) even in number
a) (a) only b) (b) and (c) c) (c) only d) (d) only
Answer: (D)
Q Let G be an undirected complete graph on n vertices, where n > 2. Then, the number of
different Hamiltonian cycles in G is equal to (GATE-2019) (2 Marks)
(A) n! (B) n – 1! (C) 1 (D) (n-1)! / 2
Answer: (D)
A simple circuit in a graph G that passes through every vertex exactly once is called
a Hamiltonian circuit.
In an undirected complete graph on n vertices, there are n permutations are possible to visit
every node. But from these permutations, there are: n different places (i.e., nodes) you can
start; 2 (clockwise or anticlockwise) different directions you can travel.
So any one of these n! cycles is in a set of 2n cycles which all contain the same set of edges. So
there are,
= (n)! / (2n)
= (n−1)! / 2 distinct Hamilton cycles.
Q Consider a complete bipartite graph km,n. For which values of m and n does this, complete
graph have a Hamilton circuit (NET-JUNE-2014)
(A) m = 3, n = 2 (B) m = 2, n = 3 (C) m = n > 2 (D) m = n > 3
Q for which values of m and n does the complete bipartite graph km,n have a Hamilton circuit?
(NET-JULY-2019)
a) m! = n, m, n >=2 b) m! = n, m, n>=3
c) m = n, m, n>=2 d) m = n, m, n>=3
Q Consider a Hamiltonian Graph (G) with no loops and parallel edges. Which of the following is
true with respect to this Graph (G)? (NET-JUNE-2015) (NET-JAN-2017) (NET-DEC-2018)
(a) deg (v) ≥ n / 2 for each vertex of G
(b) |E(G)| ≥ 1 / 2 (n - 1) (n - 2) + 2 edges
(c) deg (v) + deg (w) ≥ n for every v and w not connected by an edge.
a) (a) and (b) b) (b) and (c) c) (a) and (c) d) (a), (b) and (c)
Answer: (C)
In an Hamiltonian Graph (G) with no loops and parallel edges: According to Dirac's theorem
in a n vertex graph, deg (v) ≥ n / 2 for each vertex of G. According to Ore's theorem deg (v) +
deg (w) ≥ n for every n and v not connected by an edge is sufficient condition for a graph to
be hamiltonian. If |E(G)| ≥ 1 / 2 * [(n - 1) (n - 2)] then graph is connected but it doesn't
guaranteed to be Hamiltonian Graph. (a) and (c) is correct regarding to Hamiltonian Graph.
Q if a graph(g) has no loops or parallel edges, and if the number of vertices(n) in the graph is
n>=3 , then graph G is Hamiltonian if (NET-DEC-2018)
(i) deg(v) ≥ n/3 for each vertex v
(ii) deg(v) + deg(w) ≥ n whenever v and w are not connected by an edge.
(iii) |E(G)| ≥ 1/3(n–1)(n–2) + 2
a) (i) and (iii) only b) (ii) only c) (ii) and (iii) only d) (ii) only
Planer Graph
Planer Graph: - A graph is called a planer graph if it can be drawn on a plan in such a way that
no edges cross each other, otherwise it is called non-planer.
Application: civil engineering, circuit designing
Q Which of the following graphs is/are planner? (GATE-19) (2 Marks)
a) G1 only b) G1 and G2
c) G2 only d) G2 and G3
Answer: (C)
Q (GATE-2010) (2 Marks)
Q Two graphs A and B are shown below: Which one of the following statements is true? (NET-
DEC-2015)
a) Both A and B are planar b) Neither A nor B is planar
c) A is planar and B is not d) B is planar and A is not
Q Let G be the non-planar graph with the minimum possible number of edges. Then G has
(GATE-1992) (1 Marks) (GATE-2007) (1 Marks)
(A) 9 edges and 5 vertices (B) 9 edges and 6 vertices
(C) 10 edges and 5 vertices (D) 10 edges and 6 vertices
Answer: (B)
• A finite graph is planar if and only if it does not contain a subgraph that is
a subdivision(homorphism) of the complete graph K5 or the complete bipartite graph. In
practice, it is difficult to use Kuratowski's criterion to quickly decide whether a given
graph is planar.
• A finite graph is planar if and only if it does not have K5 or K3,3 as a minor. A minor of a
graph results from taking a subgraph and repeatedly contracting an edge into a vertex,
with each neighbor of the original end-vertices becoming a neighbor of the new vertex.
(Wanger’s theorem)
Further Analysis
• A planer graph divides the plane into number or regions (faces, planer embedding),
which are further divided into bounded(internal) and unbounded region(external).
• Euler's formula states that if a finite, connected, planar graph with v is the number of
vertices, e is the number of edges and r is the number of faces (regions bounded by
edges, including the outer, infinitely large region), then
r=e–v+2
• Euler's formula can be proved by mathematical induction
Q suppose that a connected planar graph has six vertices, each of degree four, into how many
regions is the plane divided by a planner representation of this graph? (NET-JULY-2019)
a) 6 b) 8 c) 12 d) 20
Q Let G be a simple connected planar graph with 13 vertices and 19 edges. Then, the number
of faces in the planar embedding of the graph is (GATE-2005) (2 Marks)
(A) 6 (B) 8 (C) 9 (D) 13
Answer: (B)
Answer: (3)
Q The minimum number of colors required to color the following graph, such that no two
adjacent vertices are assigned the same color, is (GATE-2004) (2 Marks)
Q The minimum number of colors that is sufficient to vertex color any planar graph is
_______________(GATE-2016) (1 Marks)
Answer: (4)
Q What is the chromatic number of an n-vertex simple connected graph which does not
contain any odd length cycle? Assume n >= 2. (GATE-2009) (1 Marks)
(A) 2 (B) 3 (C) n-1 (D) n
Answer: (A)
Q The minimum number of colors required to color the vertices of a cycle with η nodes in such
a way that no two adjacent nodes have the same color is (GATE-2002) (1 Marks)
(A) 2 (B) 3 (C) 4 (D) n – 2⌊n/2⌋ + 2
Answer: (D)
Explanation: We need 3 colors to color a odd cycle and 2 colors to color an even cycle.
Q The number of colors required to properly color the vertices of every planer graph is (NET-
JUNE-2012)
a) 2 b) 3 c) 4 d) 5
• There is one and only one path between every pair of vertices in a tree
• If in a graph G, there is one and only one path between every pair of vertices then G is a
tree
• A tree with n vertices has n-1 edges
• Any connected graph with n vertices and n-1 edges in a tree
• A graph is a tree if and only if it is minimally connected
• A graph G with n vertices and n-1 edges and no circuit is connected
Q T is a graph with n vertices. T is connected and has exactly n-1 edges, then: (NET-DEC-2005)
a) T is a tree
b) T contains no cycles
c) Every pairs of vertices in T is connected by exactly one path
d) All of these
Q What is the maximum number of edges in an acyclic undirected graph with n vertices?
(GATE-2004) (1 Marks)
(A) n-1 (B) n (C) n + 1 (D) 2n-1
Answer: (A)
Q The minimum number of edges in a connected graph with ‘n’ vertices is equal to (NET-DEC-
2010)
(A) n (n – 1) (B) n (n – 1)2 (C) n2 (D) n – 1
Q which two of the following are equivalent for an undirected graph G? (NET-JUNE-2009)
i) G is a tree
ii) There is at least one path between any two distinct vertices of G
iii) G contains no cycles and has (n-1) edges
iv) G has n edges
a) (i) and (ii) b) (i) and (iii) c) (i) and (iv) d) (ii) and (iii)
Q Let T be a tree with 10 vertices. The sum of the degrees of all the vertices in T is _____.
(GATE-2017) (1 Marks)
Answer: (18)
Q A certain tree has two vertices of degree 4, one vertex of degree 3 and one vertex of degree
2. If the other vertices have degree 1, how many vertices are there in the graph? (NET-DEC-
2014)
a) 5 b) n–3 c) 20 d) 11
Q Consider the undirected graph G defined as follows. The vertices of G are bit strings of
length n. We have an edge between vertex u and vertex v if and only if u and v differ in exactly
one-bit position (in other words, v can be obtained from u by flipping a single bit). The ratio of
the chromatic number of G to the diameter of G is (GATE-2006) (2 Marks)
(A) 1/(2n-1) (B) 1/n (C) 2/n (D) 3/n
Answer: (C)
Q How many edges are there in a forest of t-trees containing a total of n vertices? (NET-DEC-
2013)
(A) n + t (B) n – t (C) n ∗ t (D) nt
Q A tree with n vertices is called graceful, if its vertices can be labeled with integers 1, 2,....n
such that the absolute value of the difference of the labels of adjacent vertices are all
different. Which of the following trees are graceful? (NET-DEC-2015)
a) (a) and (b) b) (b) and (c) c) (a) and (c) d) (a), (b) and (c)
Ans: D
Spanning tree
• A tree T is said to be spanning tree of a connected graph G, if T is a subgraph of G and T
contains all vertices of G.
• An edge in a spanning tree T is called a branch of T
• An edge that is not in the given spanning tree T is called a chord.
• Branch and Chord are defined with respect to a given spanning tree.
• With respect to any of its spanning tree, a connected graph of n vertices and e edges
has n-1 branches and e-n+1 chord
• A connected graph G is a tree if and only if adding an edge between any two vertices
in g creates exactly one cycle.
• Rank(r) = n-1
• Nullity(µ) = e – n + 1
• Rank + nullity = number of edges in G
Spanning Forest: - if a graph is not connected, then there is no possibility of finding a spanning
tree, but we can find a spanning forest. If a graph is not connected then we can find connected
components, finding a spanning tree in each component we can find spanning forest.
Fundamental circuit: - With respect to a spanning tree T in a connected graph G, adding any
one chord to T will create exactly one circuit such a circuit formed by adding a chord to a
spanning tree is called fundamental circuit.
Q for a complete graph with N vertices, the total number of spanning tree is given by: (NET-
DEC-2006)
a) 2N-1 b) NN-1 c) NN-2 d) 2N+1
Q How many edges must be removed to produce the spanning forest of a graph with N
vertices, M edges and C connected components? (NET-JUNE-2013)
(A) M+N–C (B) M–N–C (C) M–N+C (D) M+N+C
Q Which of the following connected simple graph has exactly one spanning tree? (NET-JUNE-
2013)
(A) Complete graph (B) Hamiltonian graph
(C) Euler graph (D) None of the above
Q The number of different spanning trees in complete graph, K4 and bipartite graph, K2,2
have ______ and _______ respectively. (NET-JULY-2016)
a) 14, 14 b) 16, 14 c) 16, 4 d) 14, 4
Ans. C
Cut-Set (edge and vertex connectivity)
Cut-Set (Edges)
Cut Set: - In a connected graph G, a cut set is a set of edges whose removal from g leaves G
disconnected, provided removal of no proper subset of these edges disconnects G.
,
Q if G is a forest with n vertices and k connected components, how many edges does G have?
(GATE-2014) (2 Marks)
(A) floor(n/k) (B) ceil(n/k) (C) n-k (D) n-k+1
Answer: (C)
Q The maximum number of possible edges in an undirected graph with ‘a’ vertices and ‘k’
components is ______. (GATE-1991) (2 Marks)
Answer: ((a-k+1)(a-k))/2
Hence the maximum is achieved when only one of the components has more than one vertex.
How many vertices does this graph have? the big component has n−k+1n−k+1 vertices and is
the only one with edges. So it has (n−k+1)(n−k)2 edges.
Q G is a graph on n vertices and 2n – 2 edges. The edges of G can be partitioned into two edge-
disjoint spanning trees. Which of the following is NOT true for G? (GATE-2008) (2 Marks)
(A) For every subset of k vertices, the induced subgraph has at most 2k-2 edges
(B) The minimum cut in G has at least two edges
(C) There are two edge-disjoint paths between every pair to vertices
(D) There are two vertex-disjoint paths between every pair of vertices
Answer: (D)
Q Let G be an arbitrary graph with n nodes and k components. If a vertex is removed from G,
the number of components in the resultant graph must necessarily lie between(GATE-2003) (1
Marks) (k-1)(n-1)
(A) k and n (B) k – 1 and k + 1
(C) k – 1 and n – 1 (D) k + 1 and n – k
Answer: (A)
Explanation: Minimum: It may be possible that the removed vertex doesn’t disconnect its
component. Maximum: It may be possible that the removed vertex disconnects all
components. For example the removed vertex is center of a star.
Q Let G be a graph with 100! vertices, with each vertex labelled by a distinct permutation of
the numbers 1, 2, …, 100. There is an edge between vertices u and v if and only if the label of u
can be obtained by swapping two adjacent numbers in the label of v. Let y denote the degree
of a vertex in G, and z denote the number of connected components in G. Then y + 10z =
_______. (GATE-2018) (2 Marks)
Answer: (109)
G is a graph with 100! vertices. Label of each vertex obtains from distinct permutation of
numbers “1, 2, … 100”.
There exists an edge between two vertices iff label of ‘u’ is obtained by swapping two adjacent
numbers in label of ‘v’.
Example:
12 & 21, 23 & 34
The sets of the swapping numbers be (1, 2) (2, 3) (3, 4) … (99).
The no. of such sets are 99 i.e., no. of edges = 99.
As this is regular, each vertex has ‘99’ edges correspond to it.
So degree of each vertex = 99 = y.
As the vertices are connected together, the number of components formed = 1 = z
y + 102 = 99 + 10(1) = 109 )
Q Let G = (V, E) be a directed graph where V is the set of vertices and E the set of edges. Then
which one of the following graphs has the same strongly connected components as G? (GATE-
2014) (1 Marks)
a) G1 = (V,E1) where E1={(u, v)∣(u, v)∉E}
b) G2 = (V,E2) where E2={(u, v)∣(v, u)∈E}
c) G3 = (V,E3) where E3={(u, v)∣ there is a path of length ≤2 from u to v in E}
d) G4 = (V4,E) where V4 is the set of vertices in G which are not isolated
Answer: (B)
(A) is false. Consider just two vertices connected to each other. So, we have one SCC. The new
graph won't have any edges and so 22 SCC.
(B) is true. In a directed graph an SCC will have a path from each vertex to every other vertex.
So, changing the direction of all the edges, won't change the SCC.
(D) is false. Consider any graph with isolated vertices- we loose those components.
(C) is a bit tricky. Any edge is a path of length 11. So, the new graph will have all the edges
from old one. Also, we are adding new edges (u,v)(u,v). So, does this modify any SCC? No,
because we add an edge (u,v)(u,v), only if there is already a path of
length <=2<=2 from uu to vv- so we do not create a new path. So, both (B) and (C) must
answer, though GATE key says only B.
Isomorphism
• In general, two graphs are said to be isomorphic if they are perhaps the same graphs,
but just drawn differently with different names. i.e. two graphs are thought of as
isomorphic if they have identical behavior in terms of graph-theoretic properties.
• Formally speaking: - Two graphs G and G’ are said to be isomorphic, if there is a one to
one correspondence between their vertices and between their edges such that the
incidence relationship is preserved.
• More Formally speaking: Two graph G1(V1,E1) and G2(V2,E2) are isomorphism to each
other if there is a bijection function :
ƒ: V1(G1) → V2(G2)
• such that any two vertices u, v ϵ V1(G1), if u, v ϵ E1(G1) iff (ƒ(u), ƒ(v)) ϵ E2(G2)
• i.e. if u,v are adjacent in G1 then, ƒ(u) and ƒ(v) will be adjacent in G2.
• Time Complexity two find weather two graphs are isomorphic or not Determining if
two graphs are isomorphic is thought to be neither an NP-complete problem nor a P-
problem, although this has not been proved (Skiena 1990, p. 181). In fact, there is a
famous complexity class called graph isomorphism complete which is thought to be
entirely disjoint from both NP-complete and from P.
Q How many simple non isomorphic graphs are possible with 3 vertices?
Q How many simple non isomorphic graphs are possible with 4 vertices and 2 edges?
Q How many simple non isomorphic graphs are possible with 4 vertices and 3 edges?
Q How many simple non isomorphic graphs are possible with 5 vertices and 3 edges?
Q How many simple non isomorphic graphs are possible with 6 vertices and 6 edges, such that
degree of every vertex must be same?
Q How many simple non isomorphic graphs are possible with 8 vertices and 8 edges, such that
degree of every vertex must be same?
How to check weather two graphs are isomorphic or not
• Number of vertices
• Number of edges
• Number of vertices with a given degree
• Check degree property of vertices with their neighbor
• Check minimum cycle length, maximum cycle length, or number of cycles with a specific
length
• Can check isomorphism for complement of the graph
• Planer, non-planer
• Connected disconnected
• Chromatic number
• Matching number, covering number
• Edge connectivity, vertex connectivity
If it seems that graphs are isomorphic to each other than identify the similar vertex and delete
both, and keep repeating the process until we are sure.
Q Which of the following graphs is isomorphic to (GATE-2012) (2 Marks)
Answer: (B)
Q (NET-JUNE-2014)
Q A graph is self-complementary if it is isomorphic to its complement. For all self-
complementary graphs on n vertices, n is (GATE-2015) (2 Marks)
(A) A multiple of 4 (B) Even
(C) Odd (D) Congruent to 0 mod 4, or 1 mod 4
Answer: (D)
M1 M2 M3 M4
Q How many perfect matchings are there in a complete graph of 6 vertices? (GATE-2003) (2
Marks)
(A) 15 (B) 24 (C) 30 (D) 60
Answer: (A)
Covering
Line Covering: - Let G (V, E) be a graph, a subset C of E is called a line covering of G, if every
vertex of G is incident with at least one edge in C. (deg at least one)
deg(v) >= 1
C1 C2 C3 C4
Minimal Line covering: - A line covering is said to be minimal if no edge can be deleted from
the line covering, without destroying its ability to cover the graph.
Minimum line covering: - A line covering with minimum no of edges is called a minimum line
covering.
L1 = {(b, d)}
L2 = {(b, d), (e, f)}
L3 = {(a, d), (b, c), (e, f)}
L4 = {(a, b), (e, f)}
Maximal independent Line set: - An independent line set L of a graph G is said to be maximal
if no other edges of G can be added to L.
Maximum independent line set: - An independent line set L of a graph G, with maximum no of
edges is called maximum independent line set.
K1 = {b, d}
K2 = {a, b, c}
K3 = {b, c, d}
Minimal vertex cover: - Vertex covering K of a graph G is said to be minimal if no vertex can be
deleted from K, without violating the condition.
Minimum vertex covering: - A vertex covering of a graph G with minimum number of vertices
is called as minimum vertex covering.
S1 = {b}
S2 = {d, e}
S3 = {a, c}
Maximum independent vertex set: - An independent vertex set of graph G with maximum no
of vertices is called maximum independent vertex set.
Q What is the size of the smallest MIS (Maximal Independent Set) of a chain of nine nodes?
(GATE-2008) (1 Marks)
(A) 5 (B) 4 (C) 3 (D) 2
Answer: (C)
Q A vertex cover of an undirected graph G(V, E) is a subset V1 ⊆ V vertices such that (NET-
JUNE-2013)
(A) Each pair of vertices in V1 is connected by an edge
(B) If (u, v) ∈ E then u ∈ V1 and v ∈ V1
(C) If (u, v) ∈ E then u ∈ V1 or v ∈ V1
(D) All pairs of vertices in V1 are not connected by an edge
Q Let G be a simple graph with 20 vertices and 100 edges. The size of the minimum vertex cover
of G is 8. Then, the size of the maximum independent set of G is (GATE-2005) (1 Marks)
(A) 12 (B) 8 (C) Less than 8 (D) More than 12
Answer: (A)
Q A clique in a simple undirected graph is a complete subgraph that is not contained in any
larger complete subgraph. How many cliques are there in the graph shown below? (NET-JULY-
2016)
a) 2 b) 4 c) 5 d) 6
Q In a connected graph, a bridge is an edge whose removal disconnects a graph. Which one of
the following statements is True? (GATE-2015) (2 Marks)
(A) A tree has no bridge
(B) A bridge cannot be part of a simple cycle
(C) Every edge of a clique with size ≥ 3 is a bridge (A clique is any complete subgraph of a
graph)
(D) A graph with bridges cannot have a cycle
Answer: (B)
Q Suppose X and Y are sets and |X| and |Y| are their respective cardinalities. It is given that
there are exactly 97 functions from X to Y. From this one can conclude that (GATE-1996) (1
Marks)
(A) |X|=1, |Y|=97 (B) |X|=97, |Y|=1
(C) |X|=97, |Y|=97 (D) None of the above
Answer: (A)
Q Let X, Y, Z be sets of sizes x, y and z respectively. Let W = X x Y. Let E be the set of all
subsets of W. The number of functions from Z to E is (GATE-2006) (1 Marks)
(A) Z2xy (B) Z x 2 xy (C) 2z (D) 2xyz
Answer: (D)
Q Let S denote the set of all functions f: {0,1}4 -> {0,1}. Denote by N the number of functions
from S to the set {0,1}. The value of Log2Log2N is ______. (GATE-2014) (2 Marks)
Answer: 16
Q A function f:N+→N+, defined on the set of positive integers N+, satisfies the following
properties:
f(n)=f(n/2) if n is even
f(n)=f(n+5) if n is odd
Let R={i ∣ ∃j : f(j)=i} be the set of distinct values that f takes. The maximum possible size
of R is ___________. (GATE-2016) (2 Marks)
Ans: 2
Q Let X and Y be finite sets and f: X -> Y be a function. Which one of the following
statements is TRUE? (GATE-2014) (1 Marks)
a) For any subsets A and B of X,| f(A ∪ B)| = |f(A)| + |f(B)|
b) For any subsets A and B of X, f(A ∩ B) = f(A) ∩ f(B)
c) For any subsets A and B of X,| f(A ∩ B)| = min{|f(A)|, |f(B)|}
d) For any subsets S and T of Y,f−1(S ∩ T) = f−1(S) ∩ f−1(T)
Answer: (D)
A)
LHS: |f(A∪B)| = |f({a, b, c})|= |{1}| =1
RHS: |f(A)|+|f(B)| = 1+1 = |f(A)|+|f(B)| =1 + 1 = 2,
B)
LHS: f(A∩B) = f({})={}
RHS: f(A)∩f(B) = {1} ∩ {1} = {1}
C)
LHS: |f(A∩B)|=|f({})|=|{}|=0
RHS: min{|f(A)|,|f(B)|} = min(1,1) = 1
D) Its easy to see that this is true because in a function a value can be mapped only to one
value. The option assumes inverse of function ff exists.
Q Let f: A→B be a function, and let E and F be subsets of A. Consider the following
statements about images.
S1: f (E ∪ F) = f (E) ∪ f (F)
S2: f (E ∩ F) = f (E) ∩ f (F)
Which of the following is true about S1 and S2? (GATE-2001) (2 Marks)
(A) Only S1 is correct (B) Only S1 is correct
(C) Both S1 and S2 are correct (D) None of S1 and S2 is correct
Answer: (B)
Function composition
fog(x) = f(g(x))
gof(x) = g(f(x))
Q If g(x) = 1−x and h(x)=x / (x−1), then g(h(x)) / h(g(x)) is: (GATE-2015) (1 Marks)
a) h(x) / g(x) b) −1 / x c) g(x) / h(x) d) x / (1−x)2
Answer: (a)
Q Let f and g be the functions from the set of integers defined by f(x)=2x+3 and g(x)=3x+2.
Then the composition of f and g and g and f is given as (NET-Jan-2013)
a) 6x+7, 6x+11 b) 6x+11, 6x+7
c) 5x+5, 5x+5 d) None of the above
Answer: (a)
One-to-One (Injection)
A function F: A→B is said to be one-to-one function if every element of A has distinct image
in B. i.e. no two elements of the set B can have the same Pre-image in A.
Q Let X and Y denote the sets containing 2 and 20 distinct objects respectively and F denote
the set of all possible functions defined from X and Y. Let f be randomly chosen from F. The
probability of f being one-to-one is _________ (GATE-2015) (2 Marks)
Answer: 0.95
Onto (surjection)
A function f: A → B is said to be onto if and only if every element of B is mapped by at least
one element of A.
Range of f = B
If A and B are finite sets, then onto function from A→B is possible, |B|<=|A|
If |A| = |B|, then every onto function from A to B is also one-to-one function.
Q The number of onto functions (surjective functions) from set X = {1, 2, 3, 4} to set Y = {a,
b, c} is ________________ (GATE-2015) (2 Marks)
Answer: 36
Q How many onto (or surjective) functions are there from an n-element (n >= 2) set to a 2-
element set? (GATE-2014) (2 Marks)
(A) 2n (B) 2n – 1 (C) 2n – 2 (D) 2(2n – 2)
Answer: (C)
Q Consider the set of all functions f: {0,1, … ,2014} → {0,1, … ,2014} such that f(f(i)) = i, for
all 0 ≤ i ≤ 2014. Consider the following statements: (GATE-2014) (2 Marks)
P. For each such function it must be the case that for every i, f(i)=i
Q. For each such function it must be the case that for some i, f(i)=i
R. Each function must be onto.
Which one of the following is CORRECT?
(A) P, Q and R are true (B) Only Q and R are true
(C) Only P and Q are true (D) Only R is true
Answer: (B)
Q Let f be a function from a set A to a set B, g a function from B to C, and h a function from
A to C, such that h(a) = g(f(a)) for all a ∈ A. Which of the following statements is always true
for all such functions f and g? (GATE-2005) (2 Marks)
(A) g is onto => h is onto (B) h is onto => f is onto
(C) h is onto => g is onto (D) h is onto => f and g are onto
Answer: (C)
Bijection
A function f: A→B is said to be bijection if f is one-to-one and onto.
No of Bijection from A to B = n!
Inverse of a function
Let f: A→B, if the inverse relation f-1 from B to A is also a function f-1: B→A
Q Let R denote the set of real numbers. Let f: R×R→R×R be a bijective function defined by f
(x, y) = (x + y, x− y). The inverse function of f is given by (GATE-1996) (2 Marks)
a) f−1(x, y)=(1 / (x + y), 1 / (x − y))
b) f−1(x, y)=(x − y, x + y)
c) f−1(x, y)=( (x + y) / 2, (x – y) / 2)
d) f−1(x, y)=[2(x − y),2(x + y)]
Answer: (C)
Constant function: A function f: A→B is a constant function if f(x) = c, ∀x ϵ A