Discrete Structures and Graph Theory

Comprehensive Theory Notes for CBDT Assistant Director (Systems) Exam


1. Propositional Logic

Logical Connectives

Connective Symbol Name Truth when
NOT ¬ or ~ Negation True when operand is false
AND Conjunction True when both are true
OR Disjunction False when both are false
XOR Exclusive OR True when exactly one is true
Implication Conditional False only when T → F
Biconditional If and only if True when both same

Truth Table for Basic Connectives

p q ¬p p∧q p∨q p⊕q p→q p↔q
T T F T T F T T
T F F F T T F F
F T T F T T T F
F F T F F F T T

Key Logical Equivalences

Law Equivalence
Double Negation ¬¬p ≡ p
De Morgan's ¬(p∧q) ≡ ¬p∨¬q; ¬(p∨q) ≡ ¬p∧¬q
Commutative p∧q ≡ q∧p; p∨q ≡ q∨p
Associative (p∧q)∧r ≡ p∧(q∧r); (p∨q)∨r ≡ p∨(q∨r)
Distributive p∧(q∨r) ≡ (p∧q)∨(p∧r); p∨(q∧r) ≡ (p∨q)∧(p∨r)
Identity p∧T ≡ p; p∨F ≡ p
Domination p∧F ≡ F; p∨T ≡ T
Idempotent p∧p ≡ p; p∨p ≡ p
Absorption p∧(p∨q) ≡ p; p∨(p∧q) ≡ p
Implication p→q ≡ ¬p∨q
Contrapositive p→q ≡ ¬q→¬p
Inverse p→q ≡ ¬p→¬q (NOT equivalent)
Converse p→q ≡ q→p (NOT equivalent)

Types of Propositions

Rules of Inference

Rule Form Name
p, p→q ∴ q Modus Ponens
¬q, p→q ∴ ¬p Modus Tollens
p→q, q→r ∴ p→r Hypothetical Syllogism
p∨q, ¬p ∴ q Disjunctive Syllogism
p ∴ p∨q Addition
p∧q ∴ p Simplification
p, q ∴ p∧q Conjunction
p→q, r→s, p∨r ∴ q∨s Constructive Dilemma

2. Predicate Logic

A predicate is a statement containing variables that becomes a proposition when variables are assigned values.

Quantifiers

Quantifier Symbol Meaning Negation
Universal ∀x P(x) P(x) for ALL x ∃x ¬P(x)
Existential ∃x P(x) P(x) for SOME x ∀x ¬P(x)

Negation Rules (Quantifiers)

Nested Quantifiers

Rules of Inference for Predicate Logic

Rule Form
Universal Instantiation ∀x P(x) ∴ P(c)
Universal Generalization P(c) for arbitrary c ∴ ∀x P(x)
Existential Instantiation ∃x P(x) ∴ P(c) for some c
Existential Generalization P(c) ∴ ∃x P(x)

3. Set Theory

Basic Definitions

Set Operations

Operation Symbol Definition
Union A ∪ B {x : x ∈ A or x ∈ B}
Intersection A ∩ B {x : x ∈ A and x ∈ B}
Difference A - B {x : x ∈ A and x ∉ B}
Complement A' or Ā {x : x ∉ A} (relative to universal set)
Symmetric Difference A ⊕ B (A - B) ∪ (B - A)
Cartesian Product A × B {(a,b) : a ∈ A, b ∈ B}

Set Identities

Identity Law
Commutative A ∪ B = B ∪ A; A ∩ B = B ∩ A
Associative A ∪ (B ∪ C) = (A ∪ B) ∪ C
Distributive A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
De Morgan's (A ∪ B)' = A' ∩ B'; (A ∩ B)' = A' ∪ B'
Identity A ∪ ∅ = A; A ∩ U = A
Complement A ∪ A' = U; A ∩ A' = ∅
Idempotent A ∪ A = A; A ∩ A = A
Absorption A ∪ (A ∩ B) = A; A ∩ (A ∪ B) = A

Key Formulas


4. Relations and Functions

Relations

A relation R from A to B is a subset of A × B.

Properties of Relations (on set A)

Property Definition
Reflexive ∀a ∈ A, (a,a) ∈ R
Irreflexive ∀a ∈ A, (a,a) ∉ R
Symmetric (a,b) ∈ R → (b,a) ∈ R
Antisymmetric (a,b) ∈ R ∧ (b,a) ∈ R → a = b
Transitive (a,b) ∈ R ∧ (b,c) ∈ R → (a,c) ∈ R

Types of Relations

Type Properties
Equivalence Relation Reflexive + Symmetric + Transitive
Partial Order Reflexive + Antisymmetric + Transitive
Total Order Partial Order + every pair is comparable
Function Each element maps to exactly one element

Equivalence Relations and Classes

Functions

Type Definition Condition
Injective (One-to-one) f(a) = f(b) → a = b Distinct inputs → distinct outputs
Surjective (Onto) ∀b ∈ B, ∃a ∈ A: f(a) = b Range = Codomain
Bijective Both injective and surjective One-to-one correspondence

Function Composition

Counting Relations


5. Counting Principles

Basic Counting Rules

Rule Description Formula
Sum Rule (OR) Either task n₁ + n₂
Product Rule (AND) Both tasks n₁ × n₂

Permutations and Combinations

Type Formula Description
Permutation P(n,r) n!/(n-r)! Ordered selection of r from n
Combination C(n,r) n!/[r!(n-r)!] Unordered selection of r from n
Circular Permutation (n-1)! Arrangements around a circle
Permutation with repetition n!/(n₁!·n₂!·...·nₖ!) Dividing n items with repeats

Key Identities

Pigeonhole Principle

If n items are put into m containers and n > m, then at least one container must contain more than one item.

Generalized: If n items, m containers, then at least one container has ⌈n/m⌉ items.

Inclusion-Exclusion Principle


6. Recurrence Relations

A recurrence relation defines a sequence recursively in terms of previous terms.

Common Recurrence Relations

Recurrence Solution Example
aₙ = aₙ₋₁ + d aₙ = a₁ + (n-1)d Arithmetic progression
aₙ = r·aₙ₋₁ aₙ = a₁·r^(n-1) Geometric progression
aₙ = aₙ₋₁ + aₙ₋₂ Fibonacci: F(n) = F(n-1) + F(n-2) Fibonacci sequence

Solving Linear Homogeneous Recurrence Relations

Form: aₙ = c₁·aₙ₋₁ + c₂·aₙ₋₂ + ... + cₖ·aₙ₋ₖ

Method:
1. Write characteristic equation: r^k - c₁·r^(k-1) - ... - cₖ = 0
2. Find roots r₁, r₂, ..., rₖ
3. Distinct roots: aₙ = A₁·r₁^n + A₂·r₂^n + ...
4. Repeated root (multiplicity m): Include terms with n^j·r^n for j=0,...,m-1
5. Use initial conditions to solve for constants

Master Theorem (for Divide and Conquer Recurrences)

T(n) = aT(n/b) + f(n) where a ≥ 1, b > 1

Compare f(n) with n^(log_b(a)):

Case Condition Solution
Case 1 f(n) = O(n^(log_b(a) - ε)) for ε > 0 T(n) = Θ(n^(log_b(a)))
Case 2 f(n) = Θ(n^(log_b(a)) · log^k(n)) T(n) = Θ(n^(log_b(a)) · log^(k+1)(n))
Case 3 f(n) = Ω(n^(log_b(a) + ε)) and af(n/b) ≤ cf(n) T(n) = Θ(f(n))

7. Graph Theory

Basic Definitions

Graph Terminology

Term Definition
Adjacent vertices Connected by an edge
Degree deg(v) Number of edges incident on v
In-degree / Out-degree Incoming / outgoing edges (directed)
Path Sequence of vertices connected by edges
Simple path No repeated vertices
Cycle Path that starts and ends at same vertex
Connected Path exists between every pair (undirected)
Strongly connected Directed path between every pair (directed)
Weakly connected Connected when edge directions ignored

Important Theorems

  1. Handshaking Lemma: Σ deg(v) = 2|E| (sum of degrees = twice the edges)
  2. In any graph, number of odd-degree vertices is even
  3. Complete graph K_n: n(n-1)/2 edges (undirected), n(n-1) edges (directed)
  4. Tree with n vertices: Exactly n-1 edges
  5. Maximum edges in tree: n-1
  6. Minimum edges for connected graph: n-1

Special Graphs

Graph Vertices Edges Properties
Complete K_n n n(n-1)/2 Every vertex connected to all
Cycle C_n n n Single cycle
Wheel W_n n 2(n-1) Cycle + central vertex
Bipartite K_{m,n} m+n m×n Two sets, edges only between
Complete Bipartite m+n m×n Regular bipartite
Hypercube Q_n 2^n n·2^(n-1) n-dimensional cube

Graph Isomorphism

Two graphs G₁ and G₂ are isomorphic if there exists a bijection f: V₁ → V₂ such that (u,v) ∈ E₁ ⟺ (f(u),f(v)) ∈ E₂.

Necessary conditions for isomorphism (not sufficient):
- Same number of vertices
- Same number of edges
- Same degree sequence
- Same number of cycles of each length

Planar Graphs

A graph is planar if it can be drawn on a plane without edge crossings.

Euler's Formula (connected planar graph): V - E + F = 2
Where V = vertices, E = edges, F = faces (regions)

Key results:
- For simple planar graph: E ≤ 3V - 6 (if V ≥ 3)
- For bipartite planar graph: E ≤ 2V - 4
- K₅ and K₃,₃ are non-planar (Kuratowski's theorem)
- Every planar graph has a vertex of degree ≤ 5
- Four Color Theorem: Any planar graph can be colored with ≤ 4 colors

Graph Coloring

Euler and Hamiltonian Paths/Cycles

Type Definition Condition
Euler Path Trail visiting every EDGE exactly once 0 or 2 vertices of odd degree
Euler Circuit Euler Path that starts and ends at same vertex All vertices have EVEN degree
Hamiltonian Path Path visiting every VERTEX exactly once No simple condition known
Hamiltonian Circuit Hamiltonian Path returning to start No simple condition known

Dirac's Theorem: If G has n ≥ 3 vertices and every vertex has degree ≥ n/2, then G has a Hamiltonian cycle.
Ore's Theorem: If for every pair of non-adjacent vertices, sum of degrees ≥ n, then G has a Hamiltonian cycle.

Trees and Spanning Trees

Spanning Tree: Subgraph that is a tree and includes all vertices of the original graph.

Properties:
- A connected graph with n vertices has a spanning tree with n-1 edges
- Number of spanning trees in K_n = n^(n-2) (Cayley's formula)
- Removing any edge from a spanning tree disconnects the graph

Minimum Spanning Tree (MST)

Kruskal's Algorithm:
1. Sort all edges by weight (ascending)
2. Add edge if it doesn't form a cycle (use Union-Find)
3. Stop when n-1 edges selected
- Time: O(E log E)

Prim's Algorithm:
1. Start from arbitrary vertex
2. Add minimum weight edge connecting tree to a new vertex
3. Repeat until all vertices included
- Time: O((V+E) log V) with min-heap

Shortest Path Algorithms

Dijkstra's Algorithm (Single Source, non-negative weights)

1. Set dist[source] = 0, others = 
2. While unvisited vertices exist:
   a. Pick unvisited vertex u with minimum dist[u]
   b. Mark u as visited
   c. For each neighbor v of u:
      alt = dist[u] + weight(u,v)
      if alt < dist[v]: dist[v] = alt

Bellman-Ford Algorithm (Single Source, handles negative weights)

1. Set dist[source] = 0, others = 
2. Repeat |V|-1 times:
   For each edge (u,v):
     if dist[u] + w(u,v) < dist[v]:
       dist[v] = dist[u] + w(u,v)
3. Check for negative cycles

Floyd-Warshall Algorithm (All-Pairs Shortest Path)

for k = 1 to V:
  for i = 1 to V:
    for j = 1 to V:
      dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

Graph Traversal

Algorithm Data Structure Time Use Case
BFS Queue O(V+E) Shortest path (unweighted), level order
DFS Stack/Recursion O(V+E) Cycle detection, topological sort

Applications of DFS:
- Topological sorting
- Finding strongly connected components (Kosaraju's, Tarjan's)
- Detecting cycles
- Finding bridges and articulation points
- Maze solving

Applications of BFS:
- Shortest path in unweighted graph
- Finding connected components
- Level-order traversal
- Web crawling


8. Posets and Lattices

Partially Ordered Set (Poset)

A set P with a binary relation ≤ that is:
- Reflexive: a ≤ a
- Antisymmetric: a ≤ b and b ≤ a → a = b
- Transitive: a ≤ b and b ≤ c → a ≤ c

Hasse Diagram

Poset Terminology

Term Definition
Maximal element No element greater than it
Minimal element No element less than it
Maximum (greatest) Greater than or equal to all elements
Minimum (least) Less than or equal to all elements
Upper bound Element ≥ all elements of subset
Lower bound Element ≤ all elements of subset
Least upper bound (supremum) Smallest upper bound
Greatest lower bound (infimum) Largest lower bound

Lattice

A poset where every pair of elements has both a supremum (join) and infimum (meet).

Properties:
- Commutative: a ∧ b = b ∧ a; a ∨ b = b ∨ a
- Associative: a ∧ (b ∧ c) = (a ∧ b) ∧ c
- Absorption: a ∧ (a ∨ b) = a; a ∨ (a ∧ b) = a
- Idempotent: a ∧ a = a; a ∨ a = a

Distributive Lattice: Meet distributes over join and vice versa.
Boolean Lattice: Distributive lattice with complement; models Boolean algebra.

Topological Sort

Linear ordering of vertices in a DAG such that if (u,v) is an edge, u appears before v.

Algorithms:
- Kahn's Algorithm (BFS): Repeatedly remove vertices with in-degree 0
- DFS-based: Reverse post-order of DFS

Time: O(V + E)


9. Group Theory Basics

A group (G, ) is a set G with a binary operation * satisfying:
1.
Closure: a, b ∈ G → ab ∈ G
2. Associative: a(bc) = (ab)c
3. Identity: ∃e ∈ G: ae = ea = a
4. Inverse: ∀a ∈ G, ∃a⁻¹: a*a⁻¹ = e

If ab = ba for all a,b, the group is Abelian (commutative).

Examples of Groups

Group Operation Order
(ℤ, +) Addition of integers Infinite
(ℤₙ, +) Addition mod n n
(ℤₙ*, ×) Multiplication mod n (units) φ(n)
(S_n, ∘) Permutation composition n!

Subgroup H of G

Lagrange's Theorem: Order of subgroup divides order of group.

Permutations and Combinatorics in Groups


10. Generating Functions

A generating function is a power series that encodes a sequence.

Ordinary generating function: G(x) = Σ aₙ x^n

Useful generating functions:
| Sequence | Generating Function |
|----------|-------------------|
| 1, 1, 1, 1, ... | 1/(1-x) |
| 1, 2, 3, 4, ... | 1/(1-x)² |
| C(n,0), C(n,1), ..., C(n,n) | (1+x)^n |
| 1, r, r², r³, ... | 1/(1-rx) |
| Fibonacci | x/(1-x-x²) |


11. Key Theorems Summary

Theorem Statement Application
Handshaking Σdeg = 2 E
Euler's Formula V-E+F = 2 Planar graphs
Kuratowski's K₅, K₃,₃ non-planar Planarity testing
Four Color χ ≤ 4 for planar Map coloring
Cayley's n^(n-2) spanning trees in K_n Counting spanning trees
Euler Circuit All even degrees Chinese Postman problem
Euler Path 0 or 2 odd degree vertices Route planning
Dirac's deg ≥ n/2 → Hamiltonian Hamiltonian cycle detection
Master Theorem T(n)=aT(n/b)+f(n) Divide & conquer complexity
Lagrange's H

12. Exam Tips


Practice Questions

9 MCQs for Discrete Structures and Graph Theory with detailed explanations.

Q1. Consider the following about For every x, there exists a y (y can depend on x)

-...

- A. For every x, there exists a y (y can depend on x)

✅ Correct Answer: Option A

Explanation:
The correct answer is Option A — For every x, there exists a y (y can depend on x)
-.

This is a standard concept in Discrete Structures and Graph Theory. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option B (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option C (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q2. Consider the following about Set Theory

Basic Definitions

Basic Definitions

✅ Correct Answer: Option A

Explanation:
The correct answer is Option A — Set Theory

Basic Definitions

This is a standard concept in Discrete Structures and Graph Theory. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option B (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option C (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q3. Consider the following about Use initial conditions to solve for constants

Master Th...

Master Theorem (for Divide and Conquer Recurrences)

T(n) = aT(n/b)
-
D.** It applies only to sequential processing models

✅ Correct Answer: Option C

Explanation:
The correct answer is Option C — Use initial conditions to solve for constants

Master Theorem (for Divide and Conquer Recurrences)

**T(n) = aT(n/b) .

This is a standard concept in Discrete Structures and Graph Theory. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option B (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q4. Consider the following about Topological Sort

Linear ordering of vertices in a DAG su...

✅ Correct Answer: Option C

Explanation:
The correct answer is Option C — Topological Sort
Linear ordering of vertices in a DAG such that if (u,v) is an.

This is a standard concept in Discrete Structures and Graph Theory. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option B (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q5. Consider the following about Tautology:** Always true (e.g., p ∨ ¬p)...

✅ Correct Answer: Option D

Explanation:
The correct answer is Option D — Tautology:** Always true (e.g., p ∨ ¬p).

This is a standard concept in Discrete Structures and Graph Theory. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option B (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option C (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q6. Consider the following about Contradiction:** Always false (e.g., p ∧ ¬p)...

✅ Correct Answer: Option D

Explanation:
The correct answer is Option D — Contradiction:** Always false (e.g., p ∧ ¬p).

This is a standard concept in Discrete Structures and Graph Theory. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option B (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option C (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q7. Consider the following about Contingency:** Neither tautology nor contradiction...

✅ Correct Answer: Option B

Explanation:
The correct answer is Option B — Contingency:** Neither tautology nor contradiction.

This is a standard concept in Discrete Structures and Graph Theory. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option C (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q8. Consider the following about Satisfiable:** True for at least one assignment...

✅ Correct Answer: Option A

Explanation:
The correct answer is Option A — Satisfiable:** True for at least one assignment.

This is a standard concept in Discrete Structures and Graph Theory. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option B (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option C (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option D (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.


Q9. Consider the following about Order matters: ∀x∃y ≠ ∃y∀x...

✅ Correct Answer: Option D

Explanation:
The correct answer is Option D — Order matters: ∀x∃y ≠ ∃y∀x.

This is a standard concept in Discrete Structures and Graph Theory. The answer follows from the fundamental definitions and properties covered in this topic.

Why other options are incorrect:
- Option A (It requires a minimum of O(n²) time complexity...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option B (It applies only to sequential processing models...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.
- Option C (It is not applicable in distributed systems...) — This does not correctly answer the question as it either misstates the concept or refers to a different context.