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.
| Form | Statement | Equivalent to original? |
|---|---|---|
| Original | — | |
| Converse | No | |
| Inverse | No | |
| Contrapositive | Yes |
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.
| Property | Condition |
|---|---|
| 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.
| Structure | Axioms |
|---|---|
| Semigroup | Closure, associativity |
| Monoid | Semigroup plus identity |
| Group | Monoid plus inverses for all elements |
| Abelian group | Group 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.
