By the end of this chapter you'll be able to…

  • 1State when an implication is false and explain vacuous truth
  • 2Distinguish converse, inverse and contrapositive and state which is equivalent
  • 3Rewrite an implication as a disjunction and apply De Morgan's laws
  • 4Decide tautology, contradiction and satisfiability by the assume-false method
  • 5Explain why unlike quantifiers do not commute
  • 6Negate a quantified statement by moving negation inward
  • 7Count relations, reflexive relations and symmetric relations on a finite set
  • 8Check the five relation properties mechanically
  • 9Explain why antisymmetric is not the negation of symmetric
  • 10Connect equivalence relations to partitions
  • 11Count total, injective, surjective and bijective functions
  • 12State when injective and surjective coincide and when they do not
  • 13Identify a poset and read a Hasse diagram
  • 14Decide whether a poset is a lattice by finding a missing meet or join
  • 15Recognise a Boolean algebra as a complemented distributive lattice
  • 16Distinguish semigroup, monoid, group and abelian group by axioms
  • 17Apply Lagrange's theorem to constrain subgroup and element orders
  • 18Apply inclusion-exclusion with the correct alternating signs
  • 19Apply stars and bars with and without a non-empty constraint
  • 20Choose the boxes in a pigeonhole argument
  • 21Solve a linear recurrence via its characteristic equation
  • 22Handle a repeated characteristic root correctly
  • 23Use the handshaking lemma and its parity consequence
  • 24State the Euler circuit condition and why Hamiltonian has none
  • 25Connect bipartiteness to the absence of odd cycles
  • 26Apply Euler's formula and the planar edge bounds
💡
Why this chapter matters in GATE
Every object in discrete mathematics is defined entirely by its axioms. A relation is transitive or it is not, according to a condition you can check mechanically. A structure is a group or it is not, according to four properties. Nothing depends on what the objects really are. That has an immediate consequence for how questions are answered: a claim is established by verifying the definition on every case, and refuted by exhibiting one counterexample. GATE is built almost entirely around the second half of that sentence, because a single well-chosen counterexample settles a statement that would otherwise need a proof. The working method is therefore to state the definition precisely and then hunt for the smallest object that could break the claim, and the empty set, the one-element set, the identity element and the two-vertex graph are where most counterexamples live. The reach of this chapter also extends well past its own marks, since Theory of Computation, Algorithms, Databases and Compiler Design all rest on these definitions.

Before you start — revise these

🔗
School algebra and set notation
Set operations, functions and basic counting are assumed; this chapter builds the axiomatic treatment GATE examines.
🔗
Analytical Aptitude
Syllogistic reasoning and the discipline of refuting a claim with a counterexample are developed there in verbal form and are formalised here.

Discrete Mathematics

Discrete Mathematics is the largest single contributor inside the 13-mark Engineering Mathematics block, and its reach extends far beyond that. Theory of Computation, Algorithms, Databases and Compiler Design all rest on the definitions established here, so a gap in this chapter is paid for repeatedly.

Every object in discrete mathematics is defined entirely by its axioms. A relation is transitive or it is not, according to a condition you can check mechanically. A structure is a group or it is not, according to four properties. Nothing depends on what the objects "really are".

That has an immediate consequence for how questions are answered. A claim is established by verifying the definition on every case, and refuted by exhibiting one counterexample. GATE questions are built almost entirely around the second half of that sentence, because a single well-chosen counterexample settles a statement that would otherwise need a proof.

So the working method is: state the definition precisely, then hunt for the smallest object that could break the claim. The empty set, the one-element set, the identity element and the two-vertex graph are where most counterexamples live.

1. Propositional Logic

A proposition is a statement with a definite truth value. Connectives combine propositions, and implication is the one that causes trouble.

Implication is false only when is true and is false. In particular it is true whenever is false, regardless of , which is the vacuous truth that most confuses candidates.

Three related forms must be kept distinct.

FormStatementEquivalent to original?
Original
ConverseNo
InverseNo
ContrapositiveYes

Only the contrapositive is equivalent to the original. The converse and inverse are equivalent to each other but not to the original, and this is examined directly.

Two identities carry most of the manipulation work.

The second is De Morgan's law, and its dual negates a disjunction into a conjunction.

A formula is a tautology if it is true under every assignment, a contradiction if false under every one, and satisfiable if true under at least one. These three are what questions actually ask about, and the fastest route is usually to assume the formula is false and derive a contradiction.

For a formula with variables the truth table has rows, so building it is only practical up to about three variables. Beyond that, the assume-false method or algebraic simplification is required.

2. Predicate Logic and Quantifiers

Predicate logic adds quantifiers over a domain, and the order of unlike quantifiers changes the meaning.

says every has some , possibly a different one each time. says one single works for every . The second implies the first; the first does not imply the second.

Negation moves inward by flipping each quantifier and negating the body:

A universally quantified statement over an empty domain is vacuously true, which is the source of many counterexamples. "All elements of the empty set are prime" is true.

Like quantifiers commute freely — two consecutive can be swapped, as can two consecutive — but unlike quantifiers never can.

3. Sets, Relations and Functions

For a set with elements, the power set has elements, and the number of relations on is , since a relation is any subset of .

A relation on can hold five properties, and each is a mechanical check.

PropertyCondition
Reflexive for all
Irreflexive for any
Symmetric implies
Antisymmetric and in implies
Transitive and in implies

Antisymmetric is not the negation of symmetric. A relation can be both, as the identity relation is, and it can be neither.

An equivalence relation is reflexive, symmetric and transitive, and it partitions the set into disjoint equivalence classes. The correspondence runs both ways: every partition induces an equivalence relation and vice versa, so counting equivalence relations on an -set is counting its partitions, which is the Bell number .

For functions with and :

  • Total functions:
  • Injective functions: , requiring
  • Surjective functions: by inclusion-exclusion, and zero unless
  • Bijections: when , and none otherwise

A function on a finite set is injective if and only if it is surjective. This fails on infinite sets, where the successor function on the natural numbers is injective but not surjective — a standard source of counterexamples.

4. Partial Orders and Lattices

A partial order is reflexive, antisymmetric and transitive. The pair of a set with such a relation is a poset, and a Hasse diagram draws it with reflexive and transitive edges omitted and direction implied upward.

Two elements are comparable if one is related to the other. In a total order every pair is comparable; in a general poset some pairs are not, and those incomparable pairs are what most questions turn on.

The least upper bound of two elements is their join, written , and the greatest lower bound is their meet, .

A lattice is a poset in which every pair of elements has both a meet and a join. A poset with a missing join anywhere is not a lattice, and finding that one pair is how such questions are answered.

Every finite lattice has a greatest and a least element. A lattice is distributive if meet distributes over join and vice versa, and it is complemented if every element has a complement relative to the bounds. A Boolean algebra is a complemented distributive lattice.

The divisibility relation on the divisors of is a lattice in which meet is the greatest common divisor and join is the least common multiple, and it is the standard example questions are built from.

5. Groups and Algebraic Structures

Structures are distinguished by which axioms they satisfy, and the hierarchy is cumulative.

StructureAxioms
SemigroupClosure, associativity
MonoidSemigroup plus identity
GroupMonoid plus inverses for all elements
Abelian groupGroup plus commutativity

Closure must be checked first and is where most examples fail. The set of odd integers under addition is not closed, so it is not even a semigroup.

In a group, the identity is unique and each element has a unique inverse. The cancellation laws hold in any group, so implies , and this is often all a question needs.

Lagrange's theorem states that the order of a subgroup divides the order of the group. The immediate consequence is that a group of prime order has no proper subgroups and must be cyclic, which answers a whole family of questions in one step.

The order of an element is the smallest positive with , and by Lagrange it divides the group's order.

6. Counting and the Pigeonhole Principle

Beyond the standard permutation and combination counts, three techniques carry most GATE questions.

Inclusion-exclusion corrects for over-counting overlaps:

The alternating pattern continues for more sets, and the term for sets carries sign .

Distributing identical objects into distinct boxes is the stars-and-bars count , and requiring each box to be non-empty gives .

The pigeonhole principle states that placing objects into boxes with forces some box to hold at least two. The generalised form guarantees a box with at least objects.

The difficulty in pigeonhole questions is never the principle; it is choosing what the boxes are. The boxes are almost always defined by a remainder, a range, or a pair-sum, and once named the question collapses.

7. Recurrence Relations

A linear homogeneous recurrence with constant coefficients is solved through its characteristic equation.

For , write and solve for the roots.

With distinct roots and , the solution is , with and fixed by the initial conditions.

With a repeated root , the solution is . The extra factor of is required because two independent solutions are needed and alone supplies only one.

For a non-homogeneous recurrence, the general solution is the homogeneous solution plus a particular solution matching the form of the driving term.

Generating functions convert a recurrence into an algebraic equation. Multiplying each term by and summing gives a closed form in , from which the coefficient of is recovered by partial fractions. Two expansions cover almost every case:

8. Graph Theory

A graph is a set of vertices with a set of edges. The single most useful fact is the handshaking lemma.

The sum of degrees is twice the number of edges, from which it follows immediately that the number of odd-degree vertices is even.

Several standard results are examined directly.

A simple graph on vertices has at most edges. A tree on vertices has exactly edges, is connected, and is acyclic — and any two of those three properties imply the third.

A graph has an Euler circuit if and only if it is connected and every vertex has even degree, and an Euler path if exactly two vertices have odd degree. The condition is checkable in one pass.

Hamiltonian circuits have no such characterisation, which is precisely why the problem is hard. Dirac's condition — every vertex of degree at least in a graph on vertices — is sufficient but not necessary.

A graph is bipartite if and only if it contains no odd cycle, which is equivalent to being 2-colourable. This equivalence answers most colouring questions about bipartite graphs in one line.

The chromatic number of a complete graph is , of any cycle of even length is 2, and of any cycle of odd length is 3.

A planar graph satisfies Euler's formula relating vertices, edges and faces:

for a connected planar graph. From it follows for a simple planar graph with , and if the graph is additionally triangle-free.

Applying these bounds shows immediately that and are non-planar, and Kuratowski's theorem states that these two are the only obstructions up to subdivision.

The number of labelled trees on vertices is , by Cayley's formula, which appears regularly as a direct question.

9. Worked Examples

Example 1. How many binary relations on a set of 3 elements are both reflexive and symmetric?

A relation is a subset of , which has 9 pairs for .

Reflexivity forces the 3 diagonal pairs to be present, so they are not free choices.

The remaining 6 off-diagonal pairs come in 3 symmetric couples: with , and similarly for the other two pairs of distinct elements. Symmetry forces each couple to be included or excluded together, so each couple is one free binary choice.

The count is therefore .

The general formula follows by the same reasoning: for an -set, the number of reflexive symmetric relations is .

Example 2. Consider the poset of divisors of 30 under divisibility. Is it a lattice, and what is its greatest element?

The divisors are 1, 2, 3, 5, 6, 10, 15, 30.

Under divisibility, the meet of two elements is their greatest common divisor and the join is their least common multiple. Both always exist within this set, because any gcd or lcm of two divisors of 30 is itself a divisor of 30.

So every pair has a meet and a join, and the poset is a lattice.

The greatest element is 30, since every divisor divides it, and the least is 1.

It is worth noting why this works: 30 is a product of distinct primes, so its divisor lattice is isomorphic to the power set of a 3-element set under inclusion, and is therefore a Boolean algebra. Had the number been 12, with a repeated prime factor, the lattice would not be complemented.

Example 3. Is a tautology?

Assume it is false. An implication is false only when the antecedent is true and the consequent false.

So is true and is false.

For to be false, must be true and false, giving false and true.

Check these against the antecedent: with false, is vacuously true, which is consistent.

We have found a satisfying assignment for the negation, so the formula is not a tautology. The counterexample is false, true.

This also confirms that the inverse of an implication is not equivalent to it, which is exactly what the formula was testing.

Example 4. In a group of order 15, how many elements of order 3 can there be?

By Lagrange's theorem, the order of any element divides 15, so element orders can only be 1, 3, 5 or 15.

Elements of order 3 generate cyclic subgroups of order 3. Each such subgroup contains the identity plus two elements of order 3.

Two distinct subgroups of prime order intersect only in the identity, since their intersection is a subgroup of both and its order must divide 3, forcing it to be 1 or 3, and 3 would make them equal.

So elements of order 3 come in disjoint pairs, one pair per subgroup of order 3, and the answer must be even.

In fact, by Sylow theory the number of subgroups of order 3 in a group of order 15 is exactly 1, giving exactly 2 elements of order 3. The point worth carrying forward is that Lagrange alone already restricts the answer to an even number, which is usually enough to eliminate options.

Example 5. Solve with and .

Write the characteristic equation: , that is, .

Factoring gives , so the roots are 2 and 3, which are distinct.

The general solution is .

Apply the initial conditions. From : . From : .

Subtracting twice the first equation from the second gives , and then .

So .

Verify at : the recurrence gives , and the formula gives . The check takes seconds and catches sign errors, which are the commonest failure in this topic.

Example 6. A simple connected planar graph has 10 vertices, each of degree 3. How many faces does it have?

By the handshaking lemma, the sum of degrees is twice the number of edges.

So .

Check planarity is even possible: gives , which holds, so the constraint is not violated.

Apply Euler's formula for a connected planar graph:

The graph has 7 faces, counting the unbounded outer face.

This graph is in fact the Petersen graph's planar cousin; the Petersen graph itself is 3-regular on 10 vertices but is famously non-planar, which is a reminder that satisfying is necessary and not sufficient for planarity.

Summary

Every object here is defined by its axioms, so verify a claim by checking the definition and refute it with one counterexample, usually built from the empty set, a one-element set, or a two-vertex graph.

Implication is false only when the antecedent is true and the consequent false. Only the contrapositive is equivalent to the original; the converse and inverse are not.

Unlike quantifiers do not commute: one for all is strictly stronger than an -dependent .

Antisymmetric is not the negation of symmetric. An equivalence relation partitions its set, and the partitions correspond exactly to the equivalence relations.

A lattice needs both a meet and a join for every pair; a single missing join disqualifies it. Divisors under divisibility give a lattice with gcd as meet and lcm as join.

Check closure first when testing an algebraic structure. Lagrange's theorem forces subgroup and element orders to divide the group order, and a group of prime order must be cyclic.

Inclusion-exclusion alternates signs; stars and bars counts identical objects into distinct boxes; and the difficulty in a pigeonhole question is always naming the boxes.

Solve linear recurrences through the characteristic equation, remembering the extra factor of for a repeated root.

The degree sum is twice the edge count, so odd-degree vertices are even in number. Euler circuits need all degrees even; bipartite is equivalent to having no odd cycle; and with bounds planar graphs.

Key formulas & results

Everything to memorise for the exam hall, in one card. Screenshot this for revision.

The organising tool
EVERY OBJECT IS DEFINED ENTIRELY BY ITS AXIOMS. VERIFY A CLAIM BY CHECKING THE DEFINITION ON EVERY CASE; REFUTE IT BY EXHIBITING ONE COUNTEREXAMPLE.
THE EMPTY SET, THE ONE-ELEMENT SET, THE IDENTITY ELEMENT AND THE TWO-VERTEX GRAPH ARE WHERE MOST COUNTEREXAMPLES LIVE.
Implication
p -> q IS FALSE ONLY WHEN p IS TRUE AND q IS FALSE. IT IS TRUE WHENEVER p IS FALSE, REGARDLESS OF q.
THAT VACUOUS TRUTH IS WHAT MOST CONFUSES CANDIDATES, AND IT IS THE SOURCE OF MANY COUNTEREXAMPLES.
Converse, inverse, contrapositive
ORIGINAL p -> q. CONVERSE q -> p. INVERSE neg p -> neg q. CONTRAPOSITIVE neg q -> neg p.
ONLY THE CONTRAPOSITIVE IS EQUIVALENT TO THE ORIGINAL. THE CONVERSE AND INVERSE ARE EQUIVALENT TO EACH OTHER BUT NOT TO THE ORIGINAL.
The two rewriting identities
p -> q EQUIV neg p vee q. AND neg(p AND q) EQUIV neg p vee neg q, WITH THE DUAL NEGATING A DISJUNCTION INTO A CONJUNCTION.
THESE TWO CARRY MOST OF THE ALGEBRAIC MANIPULATION IN PROPOSITIONAL QUESTIONS.
Tautology, contradiction, satisfiability
A FORMULA IS A TAUTOLOGY IF TRUE UNDER EVERY ASSIGNMENT, A CONTRADICTION IF FALSE UNDER EVERY ONE, AND SATISFIABLE IF TRUE UNDER AT LEAST ONE.
THE FASTEST ROUTE IS TO ASSUME THE FORMULA IS FALSE AND DERIVE A CONTRADICTION. A TRUTH TABLE HAS 2^n ROWS AND IS PRACTICAL ONLY TO ABOUT THREE VARIABLES.
Quantifier order
FOR-ALL x THERE-EXISTS y P(x,y) ALLOWS y TO DEPEND ON x. THERE-EXISTS y FOR-ALL x P(x,y) DEMANDS ONE y THAT WORKS FOR EVERY x.
THE SECOND IMPLIES THE FIRST BUT NOT CONVERSELY. LIKE QUANTIFIERS COMMUTE FREELY; UNLIKE QUANTIFIERS NEVER DO.
Negating a quantifier
neg FOR-ALL x P(x) EQUIV THERE-EXISTS x neg P(x), AND DUALLY. NEGATION MOVES INWARD BY FLIPPING EACH QUANTIFIER AND NEGATING THE BODY.
A UNIVERSALLY QUANTIFIED STATEMENT OVER AN EMPTY DOMAIN IS VACUOUSLY TRUE, WHICH IS A STANDARD COUNTEREXAMPLE SOURCE.
Counting relations
ON AN n-SET THERE ARE 2^(n^2) RELATIONS, 2^(n^2 - n) REFLEXIVE ONES, AND 2^(n(n+1)/2) SYMMETRIC ONES.
A RELATION IS ANY SUBSET OF A CROSS A. REFLEXIVITY FIXES THE n DIAGONAL PAIRS; SYMMETRY TIES THE OFF-DIAGONAL PAIRS INTO COUPLES.
The five relation properties
REFLEXIVE: (a,a) IN R FOR ALL a. IRREFLEXIVE: NEVER. SYMMETRIC: (a,b) IMPLIES (b,a). ANTISYMMETRIC: (a,b) AND (b,a) IMPLIES a = b. TRANSITIVE: (a,b) AND (b,c) IMPLIES (a,c).
ANTISYMMETRIC IS NOT THE NEGATION OF SYMMETRIC. A RELATION CAN BE BOTH, AS THE IDENTITY RELATION IS, AND IT CAN BE NEITHER.
Equivalence relations and partitions
AN EQUIVALENCE RELATION IS REFLEXIVE, SYMMETRIC AND TRANSITIVE, AND IT PARTITIONS THE SET INTO DISJOINT CLASSES.
EVERY PARTITION INDUCES AN EQUIVALENCE RELATION AND VICE VERSA, SO COUNTING EQUIVALENCE RELATIONS ON AN n-SET IS COUNTING PARTITIONS, THE BELL NUMBER.
Counting functions
FROM AN m-SET TO AN n-SET THERE ARE n^m TOTAL FUNCTIONS AND n(n-1)...(n-m+1) INJECTIONS, REQUIRING m AT MOST n. BIJECTIONS NUMBER n! WHEN m EQUALS n.
ON A FINITE SET, INJECTIVE AND SURJECTIVE COINCIDE. THIS FAILS ON INFINITE SETS: THE SUCCESSOR FUNCTION ON THE NATURALS IS INJECTIVE BUT NOT SURJECTIVE.
Partial orders
A PARTIAL ORDER IS REFLEXIVE, ANTISYMMETRIC AND TRANSITIVE. A HASSE DIAGRAM OMITS REFLEXIVE AND TRANSITIVE EDGES AND IMPLIES DIRECTION UPWARD.
IN A TOTAL ORDER EVERY PAIR IS COMPARABLE; IN A GENERAL POSET SOME PAIRS ARE NOT, AND THOSE INCOMPARABLE PAIRS ARE WHAT MOST QUESTIONS TURN ON.
Lattices
A LATTICE IS A POSET IN WHICH EVERY PAIR HAS BOTH A MEET (GREATEST LOWER BOUND) AND A JOIN (LEAST UPPER BOUND).
A SINGLE PAIR WITH NO JOIN DISQUALIFIES THE POSET, AND FINDING THAT PAIR IS HOW SUCH QUESTIONS ARE ANSWERED. EVERY FINITE LATTICE HAS A GREATEST AND A LEAST ELEMENT.
Boolean algebra
A BOOLEAN ALGEBRA IS A COMPLEMENTED DISTRIBUTIVE LATTICE.
THE DIVISORS OF A PRODUCT OF DISTINCT PRIMES FORM ONE, WITH MEET AS GCD AND JOIN AS LCM. A REPEATED PRIME FACTOR DESTROYS COMPLEMENTATION.
The algebraic hierarchy
SEMIGROUP: CLOSURE AND ASSOCIATIVITY. MONOID: PLUS IDENTITY. GROUP: PLUS INVERSES. ABELIAN GROUP: PLUS COMMUTATIVITY.
CLOSURE MUST BE CHECKED FIRST AND IS WHERE MOST EXAMPLES FAIL. THE ODD INTEGERS UNDER ADDITION ARE NOT CLOSED, SO NOT EVEN A SEMIGROUP.
Group basics
THE IDENTITY IS UNIQUE, EACH ELEMENT HAS A UNIQUE INVERSE, AND THE CANCELLATION LAWS HOLD: ax = ay IMPLIES x = y.
THE ORDER OF AN ELEMENT IS THE SMALLEST POSITIVE k WITH a^k = e.
Lagrange's theorem
THE ORDER OF A SUBGROUP DIVIDES THE ORDER OF THE GROUP, AND SO DOES THE ORDER OF EVERY ELEMENT.
THE IMMEDIATE CONSEQUENCE IS THAT A GROUP OF PRIME ORDER HAS NO PROPER SUBGROUPS AND MUST BE CYCLIC, WHICH ANSWERS A WHOLE FAMILY OF QUESTIONS IN ONE STEP.
Inclusion-exclusion
|A cup B cup C| = |A| + |B| + |C| - |A AND B| - |B AND C| - |A AND C| + |A AND B AND C|.
THE ALTERNATING PATTERN CONTINUES FOR MORE SETS, WITH THE TERM FOR k SETS CARRYING SIGN MINUS-ONE TO THE POWER k PLUS ONE.
Stars and bars
DISTRIBUTING r IDENTICAL OBJECTS INTO n DISTINCT BOXES GIVES C(r + n - 1, n - 1). REQUIRING EVERY BOX NON-EMPTY GIVES C(r - 1, n - 1).
THE IDENTICAL-OBJECTS ASSUMPTION IS ESSENTIAL; DISTINCT OBJECTS INTO DISTINCT BOXES IS n^r INSTEAD.
Pigeonhole principle
PLACING n OBJECTS INTO k BOXES WITH n GREATER THAN k FORCES SOME BOX TO HOLD AT LEAST TWO. THE GENERALISED FORM GUARANTEES A BOX WITH AT LEAST CEILING OF n OVER k.
THE DIFFICULTY IS NEVER THE PRINCIPLE BUT CHOOSING THE BOXES, WHICH ARE ALMOST ALWAYS DEFINED BY A REMAINDER, A RANGE, OR A PAIR-SUM.
Linear recurrences
FOR a_n = c1 a_(n-1) + c2 a_(n-2), SOLVE r^2 = c1 r + c2. DISTINCT ROOTS GIVE A r1^n + B r2^n; A REPEATED ROOT r GIVES (A + Bn) r^n.
THE EXTRA FACTOR OF n IS REQUIRED BECAUSE TWO INDEPENDENT SOLUTIONS ARE NEEDED AND r^n ALONE SUPPLIES ONLY ONE. CONSTANTS COME FROM THE INITIAL CONDITIONS.
Generating functions
1/(1 - x) = SUM OF x^n OVER n AT LEAST 0, AND 1/(1-x)^2 = SUM OF (n+1) x^n.
MULTIPLY EACH RECURRENCE TERM BY x^n AND SUM TO GET A CLOSED FORM, THEN RECOVER THE COEFFICIENT OF x^n BY PARTIAL FRACTIONS.
Handshaking lemma
sum of deg(v) over all vertices v equals 2|E|.
IT FOLLOWS IMMEDIATELY THAT THE NUMBER OF ODD-DEGREE VERTICES IS EVEN. A SIMPLE GRAPH ON n VERTICES HAS AT MOST C(n,2) EDGES.
Trees
A TREE ON n VERTICES HAS EXACTLY n-1 EDGES, IS CONNECTED, AND IS ACYCLIC. ANY TWO OF THOSE THREE IMPLY THE THIRD.
THE NUMBER OF LABELLED TREES ON n VERTICES IS n^(n-2), BY CAYLEY'S FORMULA, WHICH APPEARS REGULARLY AS A DIRECT QUESTION.
Euler and Hamiltonian
AN EULER CIRCUIT EXISTS IF AND ONLY IF THE GRAPH IS CONNECTED AND EVERY VERTEX HAS EVEN DEGREE; AN EULER PATH IF EXACTLY TWO VERTICES HAVE ODD DEGREE.
HAMILTONIAN CIRCUITS HAVE NO SUCH CHARACTERISATION, WHICH IS WHY THE PROBLEM IS HARD. DIRAC'S DEGREE CONDITION IS SUFFICIENT BUT NOT NECESSARY.
Bipartite and colouring
A GRAPH IS BIPARTITE IF AND ONLY IF IT CONTAINS NO ODD CYCLE, WHICH IS EQUIVALENT TO BEING 2-COLOURABLE.
THE CHROMATIC NUMBER OF K_n IS n, OF AN EVEN CYCLE IS 2, AND OF AN ODD CYCLE IS 3.
Planarity
FOR A CONNECTED PLANAR GRAPH, V - E + F = 2. IT FOLLOWS THAT E IS AT MOST 3V - 6 FOR A SIMPLE PLANAR GRAPH WITH V AT LEAST 3, AND AT MOST 2V - 4 IF TRIANGLE-FREE.
THESE BOUNDS SHOW K5 AND K3,3 ARE NON-PLANAR. KURATOWSKI'S THEOREM SAYS THOSE TWO ARE THE ONLY OBSTRUCTIONS UP TO SUBDIVISION, AND THE BOUND IS NECESSARY BUT NOT SUFFICIENT.
⚠️

Traps GATE sets — and how to dodge them

These are the exact option-traps and misreads that cost marks under negative marking.

WATCH OUT
Treating the converse of an implication as equivalent to it
Only the contrapositive is equivalent. The converse and inverse are equivalent to each other but not to the original, and questions are built specifically on this asymmetry.
WATCH OUT
Forgetting that an implication with a false antecedent is true
p implies q is false only when p is true and q is false. A vacuously true implication is exactly what makes many candidate counterexamples work, so it must be checked rather than assumed away.
WATCH OUT
Swapping unlike quantifiers
For-all x there-exists y is strictly weaker than there-exists y for-all x, because the first lets y depend on x. Only like quantifiers commute, and the direction of implication runs from the stronger to the weaker.
WATCH OUT
Assuming antisymmetric means not symmetric
They are independent properties. The identity relation is both symmetric and antisymmetric, and a relation containing (a,b) and (b,a) with a not equal to b plus an unpaired (c,d) is neither.
WATCH OUT
Believing injective implies surjective in general
This holds only for functions from a finite set to itself. The successor function on the natural numbers is injective and not surjective, and it is the standard counterexample.
WATCH OUT
Calling a poset a lattice without checking every pair
A lattice requires a meet and a join for every pair. Finding one incomparable pair whose upper bounds have no least element disqualifies it immediately, and that pair is what the question is testing.
WATCH OUT
Assuming any divisor poset is a Boolean algebra
It is complemented only when the number is a product of distinct primes. The divisors of 12 form a lattice that is not complemented, because 2 has no complement relative to 1 and 12.
WATCH OUT
Checking associativity before closure
Closure comes first, and it is where most candidate structures fail. The odd integers under addition are not closed, so no further axiom needs checking.
WATCH OUT
Assuming a subgroup can have any order
By Lagrange's theorem the subgroup order must divide the group order. A group of order 15 has no subgroup of order 4, and a group of prime order has no proper subgroups at all.
WATCH OUT
Using stars and bars for distinct objects
Stars and bars counts identical objects into distinct boxes. Distinct objects into distinct boxes is n to the power r, and confusing the two is the most common counting error in this topic.
WATCH OUT
Getting the inclusion-exclusion signs wrong
Single sets add, pairwise intersections subtract, triple intersections add, and so on with alternating signs. Write the terms out by size rather than trying to recall the whole expression at once.
WATCH OUT
Applying the pigeonhole principle without naming the boxes
The principle is trivial; identifying the boxes is the question. They are almost always remainders modulo some number, ranges of values, or sums of pairs, and naming them collapses the problem.
WATCH OUT
Omitting the factor of n for a repeated characteristic root
A repeated root r gives a solution of the form (A + Bn) times r to the n. Using A times r to the n alone provides only one independent solution and cannot satisfy two initial conditions.
WATCH OUT
Forgetting that degree sum is twice the edge count
Each edge contributes to the degree of two vertices, so the sum of degrees is 2|E|. This also forces the number of odd-degree vertices to be even, which alone eliminates many options.
WATCH OUT
Applying an Euler-style condition to Hamiltonian circuits
No simple characterisation exists for Hamiltonian circuits, which is why the problem is computationally hard. Dirac's degree condition is sufficient but not necessary, so failing it proves nothing.
WATCH OUT
Treating the planar edge bound as sufficient
E at most 3V - 6 is necessary for planarity, not sufficient. The Petersen graph is 3-regular on 10 vertices with 15 edges, satisfies the bound comfortably, and is still non-planar.
WATCH OUT
Assuming a graph with no triangles is bipartite
Bipartite requires no odd cycle of any length. A five-cycle is triangle-free and not bipartite, since it contains an odd cycle of length five.

Exam-pattern practice

PYQ-style questions with full solutions. Work through them as a readiness check — mark yourself honestly and get your gap report at the end.

Readiness check

Are you exam-ready for Discrete Mathematics?

9 problems from this chapter. Try each one, reveal the worked solution, mark yourself honestly — get your gap report at the end.

9 questions~6 min worth ~100 marks in GATE exams

5-minute revision

The whole chapter, distilled. Read this the night before the exam.

  • Verify by definition; refute by one counterexample.
  • Implication is false only for true antecedent and false consequent.
  • A false antecedent makes an implication vacuously true.
  • Only the contrapositive is equivalent to the original.
  • Converse and inverse are equivalent to each other.
  • p implies q rewrites as not p or q.
  • De Morgan turns a negated conjunction into a disjunction.
  • Assume the formula false to test for tautology.
  • A truth table has 2 to the n rows.
  • Unlike quantifiers do not commute.
  • There-exists-for-all implies for-all-there-exists, not conversely.
  • Negation flips each quantifier and negates the body.
  • A universal over an empty domain is vacuously true.
  • Relations on an n-set number 2 to the n squared.
  • Reflexive relations number 2 to the (n squared minus n).
  • Antisymmetric is not the negation of symmetric.
  • The identity relation is both symmetric and antisymmetric.
  • Equivalence relations correspond exactly to partitions.
  • Total functions from m to n number n to the m.
  • Injective and surjective coincide only on finite sets.
  • A partial order is reflexive, antisymmetric and transitive.
  • A lattice needs a meet and a join for every pair.
  • gcd is meet and lcm is join in a divisor lattice.
  • A Boolean algebra is a complemented distributive lattice.
  • Divisors of a product of distinct primes form a Boolean algebra.
  • Check closure before any other group axiom.
  • A group has a unique identity and unique inverses.
  • Cancellation holds in every group.
  • Subgroup and element orders divide the group order.
  • A group of prime order is cyclic with no proper subgroups.
  • Inclusion-exclusion alternates signs by intersection size.
  • Stars and bars needs identical objects and distinct boxes.
  • Non-empty distribution gives C(r-1, n-1).
  • Pigeonhole difficulty is choosing the boxes.
  • Solve recurrences via the characteristic equation.
  • A repeated root r gives (A + Bn) r to the n.
  • 1/(1-x) generates all-ones coefficients.
  • Degree sum is twice the edge count.
  • The number of odd-degree vertices is even.
  • A tree on n vertices has n-1 edges.
  • Labelled trees on n vertices number n to the (n-2).
  • Euler circuit needs all degrees even and connectivity.
  • Euler path needs exactly two odd-degree vertices.
  • Hamiltonian has no simple characterisation.
  • Bipartite is equivalent to having no odd cycle.
  • Chromatic number of K_n is n; odd cycles need 3.
  • V - E + F = 2 for connected planar graphs.
  • E at most 3V - 6 is necessary but not sufficient for planarity.
  • K5 and K3,3 are the only obstructions to planarity.

GATE question blueprint

How this topic is asked, tier by tier — so you can prep to the pattern.

Typical weightage: Engineering Mathematics is 13 of the 100 marks in the GATE CS paper; Discrete Mathematics typically contributes 5-7 of those marks across 3-5 questions

Question styleMarks eachTypical countWhat it tests
Propositional logic1~1Implication forms, equivalences and tautology testing
Predicate logic2~1Quantifier order, negation and vacuous truth
Sets and relations1~1Counting relations and checking the five properties
Lattices and posets2~1Identifying a missing meet or join and recognising Boolean algebras
Groups2~1Axiom checking and Lagrange's theorem consequences
Counting2~1Inclusion-exclusion, stars and bars, and the pigeonhole principle
Recurrence relations2~1Characteristic equations, repeated roots and generating functions
Graph theory2~2Handshaking, trees, Euler circuits, bipartiteness, colouring and planarity

Exam-hall strategy

Battle-tested tips from mentors and toppers for this topic under the sectional clock.

  1. For any 'which statement is true' question, try to break each option with a small counterexample first.
  2. Test tautologies by assuming the formula false and deriving a contradiction.
  3. Check closure before any other algebraic axiom.
  4. Use Lagrange to eliminate impossible subgroup and element orders immediately.
  5. For lattice questions, examine only the incomparable pairs.
  6. Compute the degree sum first in any graph question; parity alone eliminates options.
  7. Apply the planar edge bound to eliminate, never to confirm.
  8. Discrete maths items are frequently set as MSQs and NATs, both of which carry no negative marking, so never leave one blank.
  9. GATE gives a single freely-navigable 180-minute window, so flag a long counting or recurrence item and return once the rest of the paper is secured.

Beyond the exam

Where this skill shows up in the job you're competing for — and in life.

Reasoning about type hierarchies

Subtyping is a partial order, and questions about whether two types have a common supertype are exactly join queries in a poset that may or may not be a lattice.

Detecting cycles in a build or dependency graph

The tree characterisation and the parity of odd-degree vertices are the everyday tools for deciding whether a dependency graph is well-formed.

Sizing a hash table by pigeonhole

Guaranteeing that some bucket holds at least a given number of keys is a direct pigeonhole argument, and it is how worst-case collision bounds are stated.

Verifying a specification's quantifier order

Whether a system needs one resource that serves every client, or a resource per client, is precisely the difference between the two quantifier orderings.

Where else this topic is tested

Prepare once, score in every exam that asks it.

GATE DAHigh overlap — sets, relations, counting and graph basics are shared, with more emphasis on probability and less on groups and lattices
UGC NET Computer ScienceHigh overlap — the same syllabus is examined at a slightly lower depth, with more direct recall of definitions
ISRO / BARC / DRDO computer science papersHigh overlap — discrete mathematics is examined in the same MCQ form, drawing heavily on graph theory and combinatorics

Questions aspirants ask

Pulled from the Q&A community and mentor sessions.

Because of an asymmetry in what it costs to establish and to refute a universally quantified claim. A statement of the form 'every relation with property X also has property Y' asserts something about infinitely many objects, and proving it requires an argument covering all of them. Refuting it requires exactly one object where X holds and Y fails. GATE questions are almost always phrased as 'which of the following statements is true', which turns each option into exactly this kind of claim, and the fastest route to eliminating three of four options is to break each with one example. What makes this systematic rather than lucky is that the counterexamples live in predictable places. Degenerate cases come first: the empty set, the one-element set, the empty relation, the empty graph. Then the smallest non-trivial case: two elements, two vertices, the identity relation. Then the standard exceptional objects: the successor function on the naturals for injective-but-not-surjective, the odd integers under addition for a failure of closure, the five-cycle for triangle-free-but-not-bipartite, the Petersen graph for satisfying the planar edge bound while being non-planar. Building a small mental library of these is worth more than memorising theorem statements, because each one kills a whole family of plausible-sounding options.

Because the two conditions constrain different things and are not negations of one another. Symmetry says that whenever (a,b) is in the relation, (b,a) must also be. Antisymmetry says that whenever both (a,b) and (b,a) are in the relation, a and b must be the same element. Notice that antisymmetry says nothing at all about pairs where only one direction is present, and symmetry says nothing about whether a equals b. The identity relation on a set, containing exactly the pairs (a,a), satisfies both. It is symmetric because every present pair has its reverse present, trivially, since the pair is its own reverse. It is antisymmetric because whenever both directions are present the two elements are indeed equal. So the two properties overlap rather than exclude. A relation can also be neither. Take the set {a, b, c} with the relation containing (a,b), (b,a) and (b,c). It fails symmetry because (c,b) is absent. It fails antisymmetry because (a,b) and (b,a) are both present with a not equal to b. Recognising that these are four independent possibilities rather than two is what makes relation-property questions mechanical: check each condition separately against the given pairs, and never infer one from the failure of another.

Look for the pairs that are hardest to bound, which are the incomparable ones, and check whether their upper bounds have a least element and their lower bounds a greatest. Comparable pairs are never a problem: if a is below b, then their join is b and their meet is a, automatically. So the entire question lives among incomparable pairs, and in a small Hasse diagram there are usually only a few. For each such pair, list every element above both. If that list is empty, there is no join and the poset is not a lattice. If the list has a unique minimum, that is the join. If the list has two or more minimal elements with none below the others, then no least upper bound exists and again it is not a lattice. Repeat for lower bounds and the meet. The classic failure shape is a diamond with two incomparable middle elements and two incomparable elements above them: the two middles have two minimal upper bounds and hence no join. For divisor posets the check is unnecessary, because gcd and lcm always exist and always remain within the divisor set, so every divisor poset is a lattice. The follow-up question about Boolean algebras is different and is where such questions usually go: the divisor lattice is complemented only when the number is squarefree, that is, a product of distinct primes.

More than it first appears, because it constrains three things at once. First, the order of any subgroup divides the order of the group, so a group of order 15 simply has no subgroup of order 2, 4, 6 or any other non-divisor. An option asserting such a subgroup is wrong without any further work. Second, the order of any element divides the group order, since the cyclic subgroup an element generates has order equal to the element's order. In a group of order 15 that restricts element orders to 1, 3, 5 and 15. Third, and most usefully, a group of prime order p has no proper non-trivial subgroups at all, because the only divisors of p are 1 and p. It follows that every non-identity element generates the whole group, so a group of prime order is necessarily cyclic and abelian. That single consequence answers a surprising number of questions in one line. Two cautions. Lagrange gives necessary conditions, not sufficient ones: a divisor of the group order need not correspond to an existing subgroup in general, although for abelian groups and for prime divisors it does. And counting elements of a given order requires one more observation, that two distinct subgroups of prime order intersect only in the identity, so such elements come in disjoint blocks of size p minus 1.

It settles the question only in one direction. The inequality E at most 3V - 6, valid for simple planar graphs with at least three vertices, follows from Euler's formula together with the fact that every face in a simple graph is bounded by at least three edges. Because it is derived from planarity, violating it proves non-planarity. That is exactly how K5 is dispatched: it has 5 vertices and 10 edges, while 3V - 6 gives 9, so it cannot be planar. For triangle-free graphs the sharper bound E at most 2V - 4 applies, since every face then needs at least four edges, and that is how K3,3 is dispatched: 9 edges against a bound of 8. What the bound cannot do is prove planarity. Satisfying it is necessary and not sufficient, and the Petersen graph is the standard demonstration: it is 3-regular on 10 vertices, so it has 15 edges against a bound of 24, comfortably inside, and it is nonetheless non-planar. Proving planarity requires either exhibiting a plane drawing or invoking Kuratowski's theorem, which says a graph is planar exactly when it contains no subdivision of K5 or K3,3. In an exam, the practical routine is to compute the bound first, since it eliminates cheaply, and only then look for a K5 or K3,3 structure if the bound is satisfied.
Header Logo