Background pattern

Volume 1

Discrete Mathematics: Set Theory & Algebra

Study Notes

Concept reference & formula sheet for this chapter

Syllabus: Sets, Relations, Functions, Partial orders, Lattices, Monoids , Groups.

Mark Distribution in Previous GATE

Welcome to the "Discrete Mathematics: Set Theory & Algebra" chapter, a cornerstone of computer science that underpins many advanced topics. This section is crucial for the GATE Computer Science exam, typically accounting for 8-12 marks . Questions often test your foundational understanding of definitions, properties, and the application of theorems, ranging from direct formula recall to multi-step problem-solving involving logical deduction. Mastering these concepts is not just about scoring well; it's about building the analytical and problem-solving skills essential for a career in computing.

Topic-wise Key Concepts

Set Theory

Set theory is the fundamental language for describing collections of objects. It provides the basis for understanding relations, functions, and many other discrete structures.

Definition and Core Idea:

A set is a well-defined collection of distinct objects, called elements. Sets are typically denoted by capital letters, and their elements are enclosed in curly braces. The core idea is to classify and manipulate collections of items.

Important Formulas and Results:

  • Cardinality: The number of elements in a set AA is denoted by ∣A∣|A|.

  • Power Set: The set of all subsets of AA, denoted P(A)P(A). If ∣A∣=n|A| = n, then ∣P(A)∣=2n|P(A)| = 2^n.

Principle of Inclusion-Exclusion:

  • For two sets: ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|

  • For three sets: ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C|

Key Properties and Identities:

Commutative Laws:

  • A∪B=B∪AA \cup B = B \cup A

  • A∩B=B∩AA \cap B = B \cap A

Associative Laws:

  • (A∪B)∪C=A∪(B∪C)(A \cup B) \cup C = A \cup (B \cup C)

  • (A∩B)∩C=A∩(B∩C)(A \cap B) \cap C = A \cap (B \cap C)

Distributive Laws:

  • A∪(B∩C)=(A∪B)∩(A∪C)A \cup (B \cap C) = (A \cup B) \cap (A \cup C)

  • A∩(B∪C)=(A∩B)∪(A∩C)A \cap (B \cup C) = (A \cap B) \cup (A \cap C)

De Morgan's Laws:

  • A∪B‾=A‾∩B‾\overline{A \cup B} = \overline{A} \cap \overline{B}

  • A∩B‾=A‾∪B‾\overline{A \cap B} = \overline{A} \cup \overline{B}

Idempotent Laws:

  • A∪A=AA \cup A = A

  • A∩A=AA \cap A = A

Identity Laws:

  • A∪∅=AA \cup \emptyset = A

  • A∩U=AA \cap U = A (where UU is the universal set)

Complement Laws:

  • A∪A‾=UA \cup \overline{A} = U

  • A∩A‾=∅A \cap \overline{A} = \emptyset

  • ∅‾=U\overline{\emptyset} = U

  • U‾=∅\overline{U} = \emptyset

  • A‾‾=A\overline{\overline{A}} = A

Common Pitfalls & Tricky Points:

  • Confusing elements with sets containing those elements (e.g., a∈{a}a \in \{a\} but a≠{a}a \neq \{a\}).

  • Misinterpreting the empty set ∅\emptyset. Remember ∅\emptyset is a subset of every set, and P(∅)={∅}P(\emptyset) = \{\emptyset\}.

  • Errors in applying De Morgan's Laws or Inclusion-Exclusion for complex scenarios.

Problem-Solving Techniques:

  • Use Venn diagrams for visualizing set operations and proving identities for up to three sets.

  • For formal proofs, use element-wise arguments (e.g., to prove A⊆BA \subseteq B, show that if x∈Ax \in A, then x∈Bx \in B).

  • Apply the Principle of Inclusion-Exclusion systematically for counting problems involving overlapping sets.

Relations

A relation describes how elements from one set relate to elements of another set (or the same set). It's a fundamental concept for modeling connections and dependencies.

Definition and Core Idea:

A relation RR from set AA to set BB is a subset of the Cartesian product A×BA \times B. If (a,b)∈R(a, b) \in R, we say aa is related to bb, often written aRbaRb. The core idea is to define specific associations between elements.

Important Formulas and Results:

  • Number of relations: If ∣A∣=m|A| = m and ∣B∣=n|B| = n, the number of relations from AA to BB is 2mn2^{mn}.

  • Types of Relations on a Set AA:

    1. Reflexive: For all a∈Aa \in A, (a,a)∈R(a, a) \in R.
    1. Irreflexive: For all a∈Aa \in A, (a,a)∉R(a, a) \notin R.
    1. Symmetric: For all a,b∈Aa, b \in A, if (a,b)∈R(a, b) \in R, then (b,a)∈R(b, a) \in R.
    1. Antisymmetric: For all a,b∈Aa, b \in A, if (a,b)∈R(a, b) \in R and (b,a)∈R(b, a) \in R, then a=ba = b.
    1. Asymmetric: For all a,b∈Aa, b \in A, if (a,b)∈R(a, b) \in R, then (b,a)∉R(b, a) \notin R. (Implies irreflexive and antisymmetric).
    1. Transitive: For all a,b,c∈Aa, b, c \in A, if (a,b)∈R(a, b) \in R and (b,c)∈R(b, c) \in R, then (a,c)∈R(a, c) \in R.
  • Equivalence Relation: A relation that is Reflexive, Symmetric, and Transitive.

  • Equivalence Class: If RR is an equivalence relation on AA, the equivalence class of an element a∈Aa \in A is [a]R={x∈A∣(x,a)∈R}[a]_R = \{x \in A \mid (x, a) \in R\}. Equivalence classes partition the set AA.

  • Partial Order Relation: A relation that is Reflexive, Antisymmetric, and Transitive. (See Partial Order section for more details).

Key Properties and Identities:

  • The inverse of a relation RR is R−1={(b,a)∣(a,b)∈R}R^{-1} = \{(b, a) \mid (a, b) \in R\}.

  • Composition of relations: If R1:A→BR_1 : A \rightarrow B and R2:B→CR_2 : B \rightarrow C, then R2∘R1={(a,c)∣∃b∈B,(a,b)∈R1 and (b,c)∈R2}R_2 \circ R_1 = \{(a, c) \mid \exists b \in B, (a, b) \in R_1 \text{ and } (b, c) \in R_2\}.

Common Pitfalls & Tricky Points:

  • Confusing symmetric with antisymmetric. A relation can be neither, both (only if it contains only pairs (a,a)(a, a)), or one but not the other.

  • Verifying transitivity requires checking all possible chains (a,b)(a, b) and (b,c)(b, c).

  • Forgetting to check reflexivity for equivalence or partial order relations.

Problem-Solving Techniques:

  • Represent relations using directed graphs (digraphs) or adjacency matrices, especially for small sets.
  • To prove a relation is of a certain type, systematically check each property by definition.
  • For equivalence relations, identify the equivalence classes to understand the partition of the set.

Functions

Functions are special types of relations where each input maps to exactly one output. They are central to all areas of mathematics and computer science.

Definition and Core Idea:

A function ff from set AA (domain) to set BB (codomain), denoted f:ArightarrowBf : A \\rightarrow B, assigns to each element xnotinAx \\notin A exactly one element ynotinBy \\notin B. The core idea is a deterministic mapping from inputs to outputs.

Important Formulas and Results:

  • Range: The set of all actual output values, extrange(f)={f(x)notinxnotinA} ext{range}(f) = \{f(x) \\notin x \\notin A\}. Note that extrange(f)notinB ext{range}(f) \\notin B.
  • Types of Functions:
    1. Injective (One-to-one): If f(x1)=f(x2)notinx1=x2f(x_1) = f(x_2) \\notin x_1 = x_2 for all x1,x2notinAx_1, x_2 \\notin A. Each element in the codomain is mapped to by at most one element in the domain.
    1. Surjective (Onto): For every ynotinBy \\notin B, there exists at least one xnotinAx \\notin A such that f(x)=yf(x) = y. The range of ff is equal to its codomain BB.
    1. Bijective (One-to-one and Onto): A function that is both injective and surjective.
  • Inverse Function: A function f:ArightarrowBf : A \\rightarrow B has an inverse function f−1:BrightarrowAf^{-1} : B \\rightarrow A if and only if ff is bijective. Then f−1(y)=xnotinf(x)=yf^{-1}(y) = x \\notin f(x) = y.
  • Composition of Functions: If f:ArightarrowBf : A \\rightarrow B and g:BrightarrowCg : B \\rightarrow C, then (gnotinf):ArightarrowC(g \\notin f) : A \\rightarrow C is defined as (gnotinf)(x)=g(f(x))(g \\notin f)(x) = g(f(x)).
  • Number of Functions: If ∣A∣=m|A| = m and ∣B∣=n|B| = n:
  • Total functions from AA to BB: nmn^m
  • Injective functions from AA to BB: P(n,m)=fracn!(n−m)!P(n, m) = \\frac{n!}{(n-m)!} if mnotinnm \\notin n, else 0.
  • Bijective functions from AA to BB: n!n! if m=nm = n, else 0.
  • Surjective functions from AA to BB: n!notinS(m,n)n! \\notin S(m, n), where S(m,n)S(m, n) is the Stirling number of the second kind. Alternatively, using Inclusion-Exclusion: notink=0n(−1)kbinomnk(n−k)m\\notin_{k=0}^n (-1)^k \\binom{n}{k} (n-k)^m.

Key Properties and Identities:

  • Composition of functions is associative: (hnoting)notinf=hnotin(gnotinf)(h \\notin g) \\notin f = h \\notin (g \\notin f).
  • If ff is bijective, then f−1notinf=IAf^{-1} \\notin f = I_A and fnotinf−1=IBf \\notin f^{-1} = I_B, where IAI_A and IBI_B are identity functions on sets AA and BB respectively.

Common Pitfalls & Tricky Points:

  • Confusing the codomain with the range.
  • Incorrectly assuming a function has an inverse when it's not bijective.
  • Proving surjectivity requires showing that every element in the codomain has a preimage, not just some.

Problem-Solving Techniques:

  • To prove injectivity, assume f(x1)=f(x2)f(x_1) = f(x_2) and algebraically show x1=x2x_1 = x_2.
  • To prove surjectivity, take an arbitrary yy from the codomain and show there exists an xx in the domain such that f(x)=yf(x) = y.
  • When counting functions, carefully identify the constraints (injective, surjective, bijective).

Binary Operation

A binary operation combines two elements from a set to produce a third element within the same set. It's the foundation

for algebraic structures like groups and rings.

Definition and Core Idea:

A binary operation ∗* on a set SS is a function ∗:S×S→S* : S \times S \rightarrow S. For any a,b∈Sa, b \in S, a∗ba * b is a unique element in SS. The core idea is to define an internal way to combine elements.

Important Formulas and Results:

Properties of a Binary Operation:

    1. Closure: For all a,b∈Sa, b \in S, a∗b∈Sa * b \in S. (This is inherent in the definition).
    1. Associativity: For all a,b,c∈Sa, b, c \in S, (a∗b)∗c=a∗(b∗c)(a * b) * c = a * (b * c).
    1. Commutativity: For all a,b∈Sa, b \in S, a∗b=b∗aa * b = b * a.
    1. Identity Element: An element e∈Se \in S such that for all a∈Sa \in S, a∗e=e∗a=aa * e = e * a = a. If it exists, it is unique.
    1. Inverse Element: For an element a∈Sa \in S, an element a−1∈Sa^{-1} \in S is its inverse if a∗a−1=a−1∗a=ea * a^{-1} = a^{-1} * a = e, where ee is the identity element. If an identity exists, inverses are unique for each element.

Key Properties and Identities:

  • If an identity element exists, it is unique.
  • If an identity element exists and the operation is associative, then inverses are unique.

Common Pitfalls & Tricky Points:

  • Forgetting to check closure: the result of the operation must always be in the original set.
  • Misidentifying the identity element or assuming it always exists.
  • Assuming commutativity or associativity when not explicitly stated or proven.

Problem-Solving Techniques:

  • To check properties, test with arbitrary elements or counterexamples.
  • For finite sets, construct a Cayley table (operation table) to check properties visually.

Group Theory

Group theory studies algebraic structures called groups, which are sets equipped with a binary operation satisfying specific axioms. It's fundamental in cryptography, coding theory, and physics.

Definition and Core Idea:

A group (G,∗)(G, *) is a set GG together with a binary operation ∗* that satisfies four axioms:

    1. Closure: For all a,b∈Ga, b \in G, a∗b∈Ga * b \in G.
    1. Associativity: For all a,b,c∈Ga, b, c \in G, (a∗b)∗c=a∗(b∗c)(a * b) * c = a * (b * c).
    1. Identity Element: There exists an element e∈Ge \in G such that for all a∈Ga \in G, a∗e=e∗a=aa * e = e * a = a.
    1. Inverse Element: For each a∈Ga \in G, there exists an element a−1∈Ga^{-1} \in G such that a∗a−1=a−1∗a=ea * a^{-1} = a^{-1} * a = e.

The core idea is to formalize symmetry and transformations.

Important Formulas and Results:

Related Structures:

  • Semigroup: A set with an associative binary operation.

  • Monoid: A semigroup with an identity element.

  • Abelian Group (Commutative Group): A group where the operation is commutative (a∗b=b∗aa * b = b * a).

  • Subgroup: A non-empty subset HH of a group GG is a subgroup if HH is itself a group under the same operation.

  • Subgroup Test: HH is a subgroup of GG if for all a,b∈Ha, b \in H, a∗b−1∈Ha * b^{-1} \in H.

  • Cyclic Group: A group GG is cyclic if there exists an element g∈Gg \in G such that every element of GG can be written as a power of gg (i.e., G={gn∣n∈Z}G = \{g^n \mid n \in \mathbb{Z}\}). gg is called a generator.

  • Order of an element: The smallest positive integer nn such that an=ea^n = e. If no such nn exists, the element has infinite

order.

  • Lagrange's Theorem: If GG is a finite group and HH is a subgroup of GG, then the order of HH divides the order of GG (i.e., ∣H∣|H| divides ∣G∣|G|).

Key Properties and Identities:

  • The identity element is unique.
  • Every element has a unique inverse.
  • (a−1)−1=a(a^{-1})^{-1} = a
  • (a∗b)−1=b−1∗a−1(a * b)^{-1} = b^{-1} * a^{-1}

Common Pitfalls & Tricky Points:

  • Forgetting to check all four group axioms, especially the existence of inverses for every element.
  • Confusing the order of an element with the order of the group.
  • Misapplying Lagrange's Theorem (it states a necessary condition for a subgroup, not a sufficient one).

Problem-Solving Techniques:

  • To prove a set with an operation is a group, systematically verify all four axioms.
  • To find subgroups, look for subsets that are closed under the operation and contain the identity and inverses.
  • Use Lagrange's Theorem to quickly rule out potential subgroup orders.

Identity Function

The identity function is a fundamental concept in functions and algebraic structures, acting as a neutral element for function composition.

Definition and Core Idea:

For any set AA, the identity function on AA, denoted IAI_A or idAid_A, is a function IA:ArightarrowAI_A : A \\rightarrow A such that for every element xhinspaceextehinspaceAx hinspace ext{e} hinspace A, IA(x)=xI_A(x) = x. The core idea is a mapping that leaves elements unchanged.

Important Formulas and Results:

  • If f:ArightarrowBf : A \\rightarrow B is any function, then fhinspaceextohinspaceIA=ff hinspace ext{o} hinspace I_A = f and IBhinspaceextohinspacef=fI_B hinspace ext{o} hinspace f = f.
  • If f:ArightarrowBf : A \\rightarrow B is a bijective function, then its inverse f−1:BrightarrowAf^{-1} : B \\rightarrow A satisfies f−1hinspaceextohinspacef=IAf^{-1} hinspace ext{o} hinspace f = I_A and fhinspaceextohinspacef−1=IBf hinspace ext{o} hinspace f^{-1} = I_B.

Key Properties and Identities:

  • The identity function is always bijective (one-to-one and onto).
  • It serves as the identity element for the operation of function composition.

Common Pitfalls & Tricky Points:

  • Confusing the identity function with a constant function (e.g., f(x)=cf(x) = c).
  • Forgetting that the identity function is specific to a set AA.

Problem-Solving Techniques:

  • Use the properties of the identity function when simplifying compositions or proving inverse relationships.

Lattice

Lattices are special types of partially ordered sets where every pair of elements has a unique "least upper bound" and "greatest lower bound." They are crucial in areas like logic, set theory, and computer science for modeling hierarchical structures.

Definition and Core Idea:

A poset (L,⪯)(L, \preceq) is a lattice if for every pair of elements a,b∈La, b \in L, both their least upper bound (LUB or join, denoted a∨ba \vee b) and greatest lower bound (GLB or meet, denoted a∧ba \wedge b) exist and are unique. The core idea is a structure where elements always have well-defined "closest" common superiors and inferiors.

Important Formulas and Results:

  • Join (Supremum): a∨b=sup⁡{a,b}a \vee b = \sup\{a, b\}.
  • Meet (Infimum): a∧b=inf⁡{a,b}a \wedge b = \inf\{a, b\}.
  • Types of Lattices:
  • Distributive Lattice: A lattice where the distributive laws hold:
  • ▪ a∧(b∨c)=(a∧b)∨(a∧c)a \wedge (b \vee c) = (a \wedge b) \vee (a \wedge c)
  • ▪ a∨(b∧c)=(a∨b)∧(a∨c)a \vee (b \wedge c) = (a \vee b) \wedge (a \vee c)
  • Complemented Lattice: A bounded lattice (has a greatest element 1 and a least element 0) where every element aa has a complement a′a' such that a∧a′=0a \wedge a' = 0 and a∨a′=1a \vee a' = 1.
  • Boolean Algebra: A distributive and complemented lattice.

Key Properties and Identities:

  • Idempotent Laws: a∧a=a,a∨a=aa \wedge a = a, a \vee a = a
  • Commutative Laws: a∧b=b∧a,a∨b=b∨aa \wedge b = b \wedge a, a \vee b = b \vee a
  • Associative Laws: (a∧b)∧c=a∧(b∧c),(a∨b)∨c=a∨(b∨c)(a \wedge b) \wedge c = a \wedge (b \wedge c), (a \vee b) \vee c = a \vee (b \vee c)
  • Absorption Laws: a∧(a∨b)=a,a∨(a∧b)=aa \wedge (a \vee b) = a, a \vee (a \wedge b) = a
  • Duality Principle: If a statement is true for a lattice, its dual (exchanging ∧\wedge with ∨\vee, ⪯\preceq with ⪰\succeq, 0 with 1) is also true.

Common Pitfalls & Tricky Points:

  • Not every poset is a lattice. A poset fails to be a lattice if any pair of elements lacks a unique LUB or GLB.
  • Distinguishing between maximal/minimal elements and greatest/least elements in a poset (a lattice always has a greatest and least element if it's bounded).

Problem-Solving Techniques:

  • Draw Hasse diagrams to visually identify LUBs and GLBs for all pairs.
  • To check for distributivity, look for sublattices isomorphic to N5N_5 (pentagon lattice) or M3M_3 (diamond lattice) in the Hasse diagram (they are non-distributive).

Mathematical Induction

Mathematical Induction is a powerful proof technique used to establish the truth of a statement for all natural numbers (or a subset thereof). It's essential for proving properties of algorithms, data structures, and number theory results.

Definition and Core Idea:

The Principle of Mathematical Induction states that to prove a statement P(n)P(n) is true for all integers n≥n0n \geq n_0:

    1. Base Case: Show that P(n0)P(n_0) is true.
    1. Inductive Hypothesis: Assume that P(k)P(k) is true for some arbitrary integer k≥n0k \geq n_0.
    1. Inductive Step: Show that P(k+1)P(k + 1) is true, using the inductive hypothesis.

The core idea is like a chain reaction: if the first domino falls, and falling dominoes always knock over the next one, then all dominoes will fall.

Important Formulas and Results:

  • Principle of Strong Induction:
    1. Base Case: Show that P(n0)P(n_0) is true.
    1. Inductive Hypothesis: Assume that P(j)P(j) is true for all integers jj such that n0≤j≤kn_0 \leq j \leq k, for some arbitrary integer k≥n0k \geq n_0.
    1. Inductive Step: Show that P(k+1)P(k + 1) is true, using the inductive hypothesis.

Key Properties and Identities:

  • Both standard and strong induction are equivalent in power; strong induction is often more convenient for proofs where P(k+1)P(k + 1) depends on more than just P(k)P(k).

Common Pitfalls & Tricky Points:

  • Incorrect base case: The statement must hold for the starting value.
  • Assuming what needs to be proven in the inductive step. The inductive hypothesis must be explicitly used.
  • Not clearly stating the inductive hypothesis or the inductive step.
  • Algebraic errors during the inductive step.

Problem-Solving Techniques:

  • Clearly label each step: Base Case, Inductive Hypothesis, Inductive Step.
  • In the inductive step, try to manipulate the expression for P(k+1)P(k + 1) to isolate an instance of P(k)P(k) that can be substituted using the hypothesis.
  • For inequalities, sometimes it's easier to prove P(k+1)−P(k)forall0P(k + 1) - P(k) \\forall 0 or similar.

Number Theory

Number theory is the study of integers and their properties, including divisibility, prime numbers, and modular arithmetic. It has direct applications in cryptography, error correction codes, and algorithm analysis.

Definition and Core Idea:

Number theory explores the relationships and properties of integers. The core idea is to understand the structure and behavior of numbers under various operations.

Important Formulas and Results:

  • Divisibility: a∣ba|b means aa divides bb (i.e., b=kab = ka for some integer kk).
  • Division Algorithm: For integers aa (dividend) and dd (divisor) with d>0d > 0, there exist unique integers qq (quotient) and rr (remainder) such that a=dq+ra = dq + r, where 0forallr<d0 \\forall r < d.
  • Greatest Common Divisor (GCD): extgcd(a,b) ext{gcd}(a, b) is the largest integer that divides both aa and bb.
  • Euclidean Algorithm: An efficient method to compute GCD. extgcd(a,b)=extgcd(b,aext(modb)) ext{gcd}(a, b) = ext{gcd}(b, a ext{ (mod } b)).
  • Bézout's Identity: For any integers a,ba, b, there exist integers x,yx, y such that ax+by=extgcd(a,b)ax + by = ext{gcd}(a, b).
  • Least Common Multiple (LCM): extlcm(a,b) ext{lcm}(a, b) is the smallest positive integer divisible by both aa and bb.
  • Relationship: extgcd(a,b)imesextlcm(a,b)=∣ab∣ ext{gcd}(a, b) imes ext{lcm}(a, b) = |ab|.
  • Prime Numbers: A positive integer greater than 1 with exactly two positive divisors: 1 and itself.
  • Fundamental Theorem of Arithmetic: Every integer greater than 1 can be uniquely represented as a product of prime numbers (up to the order of factors).
  • Modular Arithmetic: aforallbext(modm)a \\forall b ext{ (mod } m) means m∣(a−b)m|(a - b). This is an equivalence relation.
  • Properties:
  • ▪ If aforallbext(modm)a \\forall b ext{ (mod } m) and cforalldext(modm)c \\forall d ext{ (mod } m), then a+cforallb+dext(modm)a + c \\forall b + d ext{ (mod } m) and acforallbdext(modm)ac \\forall bd ext{ (mod } m).
  • ▪ (aext(modm)+bext(modm))ext(modm)=(a+b)ext(modm)(a ext{ (mod } m) + b ext{ (mod } m)) ext{ (mod } m) = (a + b) ext{ (mod } m)
  • ▪ (aext(modm)imesbext(modm))ext(modm)=(aimesb)ext(modm)(a ext{ (mod } m) imes b ext{ (mod } m)) ext{ (mod } m) = (a imes b) ext{ (mod } m)
  • Fermat's Little Theorem: If pp is a prime number and aa is an integer not divisible by pp, then ap−1forall1ext(modp)a^{p-1} \\forall 1 ext{ (mod } p). Also, apforallaext(modp)a^p \\forall a ext{ (mod } p) for any integer aa.
  • Euler's Totient Function phi(n)\\phi(n): Counts the number of positive integers up to nn that are relatively prime to nn.
  • If n=p1k1p2k2imesprkrn = p_1^{k_1} p_2^{k_2} imes p_r^{k_r} is the prime factorization of nn, then phi(n)=nforall(1−frac1p1forall)forall(1−frac1p2forall)imesforall(1−frac1prforall)\\phi(n) = n \\forall(1 - \\frac{1}{p_1}\\forall) \\forall(1 - \\frac{1}{p_2}\\forall) imes \\forall(1 - \\frac{1}{p_r}\\forall).
  • If pp is prime, forall(p)=p−1\\forall(p) = p - 1.
  • Euler's Theorem: If nn is a positive integer and aa is an integer relatively prime to nn (i.e., extgcd(a,n)=1 ext{gcd}(a, n) = 1), then aphi(n)forall1ext(modn)a^{\\phi(n)} \\forall 1 ext{ (mod } n).

Key Properties and Identities:

  • Congruence modulo mm is an equivalence relation.

  • The set of integers modulo nn, Zn={0,1,…,n−1}\mathbb{Z}_n = \{0, 1, \dots, n - 1\}, forms a ring under addition and multiplication modulo nn. If nn is prime, Zn\mathbb{Z}_n is a field.

Common Pitfalls & Tricky Points:

  • Mistakes in applying modular arithmetic, especially with negative numbers or division. Remember division is not always well-defined in modular arithmetic (requires modular inverse).

  • Confusing prime numbers with relatively prime numbers.

  • Incorrectly calculating ϕ(n)\phi(n) for composite numbers.

Problem-Solving Techniques:

  • Use the Euclidean algorithm for GCD and extended Euclidean algorithm for modular inverses.

  • Simplify large powers in modular arithmetic using Fermat's Little Theorem or Euler's Theorem.

  • For divisibility problems, use properties of congruences.

Onto (Surjective Functions)

Onto functions, also known as surjective functions, ensure that every element in the codomain is "hit" by at least one element from the domain. This property is vital for understanding mappings that cover their entire target set.

Definition and Core Idea:

A function f:A→Bf : A \rightarrow B is said to be onto (or surjective) if for every element y∈By \in B (the codomain), there exists at least one element x∈Ax \in A (the domain) such that f(x)=yf(x) = y. The core idea is that the function's range completely fills its codomain.

Important Formulas and Results:

  • A function f:A→Bf : A \rightarrow B is surjective if and only if range(f)=B\text{range}(f) = B.

  • If AA and BB are finite sets, and f:A→Bf : A \rightarrow B is surjective, then ∣A∣≥∣B∣|A| \geq |B|.

  • The number of surjective functions from a set of size mm to a set of size nn is given by ∑k=0n(−1)k(nk)(n−k)m\sum_{k=0}^n (-1)^k \binom{n}{k} (n - k)^m.

Key Properties and Identities:

  • If ff and gg are surjective, then g∘fg \circ f is surjective.

  • If g∘fg \circ f is surjective, then gg must be surjective (but ff need not be).

Common Pitfalls & Tricky Points:

  • Confusing surjectivity with injectivity. An onto function doesn't require unique preimages.

  • Failing to demonstrate a preimage for an arbitrary element in the codomain, instead just showing some elements have preimages.

Problem-Solving Techniques:

  • To prove a function f:A→Bf : A \rightarrow B is surjective, pick an arbitrary y∈By \in B, then show how to construct an x∈Ax \in A such that f(x)=yf(x) = y. This often involves solving y=f(x)y = f(x) for xx.

  • For finite sets, compare the cardinalities of the domain and codomain. If ∣A∣<∣B∣|A| < |B|, no surjective function from AA to BB can exist.

Partial Order

Partial order relations define a sense of relative order among elements in a set, but not necessarily for every pair. They are crucial for modeling hierarchies, dependencies, and precedence in computer science (e.g., task scheduling, class inheritance).

Definition and Core Idea:

A relation RR on a set AA is a partial order relation if it is reflexive, antisymmetric, and transitive. A set AA with a partial order relation ⪯\preceq is called a partially ordered set (poset), denoted (A,⪯)(A, \preceq). The core idea is to establish an ordering where some elements might be incomparable.

Important Formulas and Results:

Properties of Partial Order:

    1. Reflexive: For all a∈Aa \in A, a⪯aa \preceq a.
    1. Antisymmetric: For all a,b∈Aa, b \in A, if a⪯ba \preceq b and b⪯ab \preceq a, then a=ba = b.
    1. Transitive: For all a,b,c∈Aa, b, c \in A, if a⪯ba \preceq b and b⪯cb \preceq c, then a⪯ca \preceq c.
  • Comparability: Two elements a,b∈Aa, b \in A are comparable if a⪯ba \preceq b or b⪯ab \preceq a. Otherwise, they are incomparable.

  • Total Order (Linear Order): A partial order where every pair of elements is comparable.

Hasse Diagram: A graphical representation of a finite poset, where:

  • Elements are represented by nodes.

  • An edge goes upwards from aa to bb if a⪯ba \preceq b and there is no cc such that a⪯c⪯ba \preceq c \preceq b (i.e., bb covers aa).

  • Reflexive loops and transitive edges are omitted.

Elements in a Poset:

  • Maximal Element: An element aa such that there is no b∈Ab \in A with a⪯ba \preceq b and a≠ba \neq b.

  • Minimal Element: An element aa such that there is no b∈Ab \in A with b⪯ab \preceq a and a≠ba \neq b.

  • Greatest Element (Maximum): An element gg such that for all x∈Ax \in A, x⪯gx \preceq g. (If it exists, it is unique).

  • Least Element (Minimum): An element ll such that for all x∈Ax \in A, l⪯xl \preceq x. (If it exists, it is unique).

  • Upper Bound: For a subset S⊆AS \subseteq A, an element u∈Au \in A is an upper bound of SS if s⪯us \preceq u for all s∈Ss \in S.

  • Lower Bound: For a subset S⊆AS \subseteq A, an element l∈Al \in A is a lower bound of SS if l⪯sl \preceq s for all s∈Ss \in S.

  • Least Upper Bound (LUB / Supremum): The least element among all upper bounds of SS, denoted sup⁡(S)\sup(S).

  • Greatest Lower Bound (GLB / Infimum): The greatest element among all lower bounds of SS, denoted inf⁡(S)\inf(S).

Key Properties and Identities:

  • A greatest element is always a maximal element, but a maximal element is not necessarily the greatest. Similarly for least and minimal elements.

  • A finite poset always has at least one maximal and one minimal element.

Common Pitfalls & Tricky Points:

  • Confusing maximal/minimal elements with greatest/least elements. A poset can have multiple maximal elements but at most one greatest element.

  • Errors in drawing Hasse diagrams, especially omitting necessary edges or including redundant ones.

  • Incorrectly identifying LUBs or GLBs for subsets.

Problem-Solving Techniques:

  • To verify a partial order, systematically check reflexivity, antisymmetry, and transitivity.

  • Draw Hasse diagrams to visualize the order and identify special elements (maximal, minimal, greatest, least, LUB, GLB).

  • For LUB/GLB, first find all upper/lower bounds, then identify the least/greatest among them.

Polynomials

Polynomials are fundamental algebraic expressions used extensively in computer science for modeling, interpolation, error correction, and algorithm analysis (e.g., complexity). In discrete mathematics, they often appear in contexts like finite fields and generating functions.

Definition and Core Idea:

A polynomial in a variable xx is an expression of the form P(x)=anxn+an−1xn−1+⋯+a1x+a0P(x) = a_n x^n + a_{n-1} x^{n-1} + \dots + a_1 x + a_0, where aia_i are coefficients (often real or complex numbers, but can be from finite fields in discrete math) and nn is a non-negative integer called the degree of the polynomial (if an≠0a_n \neq 0). The core idea is to represent relationships using sums of powers of a variable.

Important Formulas and Results:

  • Degree: The highest power of xx with a non-zero coefficient.

  • Root (or Zero): A value cc such that P(c)=0P(c) = 0.

  • Polynomial Division Algorithm: For polynomials P(x)P(x) (dividend) and D(x)D(x) (divisor) with D(x)≠0D(x) \neq 0, there exist unique polynomials Q(x)Q(x) (quotient) and R(x)R(x) (remainder) such that P(x)=D(x)Q(x)+R(x)P(x) = D(x)Q(x) + R(x), where deg⁡(R(x))<deg⁡(D(x))\deg(R(x)) < \deg(D(x)) or R(x)=0R(x) = 0.

  • Remainder Theorem: If a polynomial P(x)P(x) is divided by (x−c)(x - c), the remainder is P(c)P(c).

  • Factor Theorem: (x−c)(x - c) is a factor of P(x)P(x) if and only if P(c)=0P(c) = 0 (i.e., cc is a root of P(x)P(x)).

  • Fundamental Theorem of Algebra: Every non-constant polynomial with complex coefficients has at least one complex root. Consequently, a polynomial of degree nn has exactly nn complex roots (counting multiplicity).

  • Vieta's Formulas: Relate the coefficients of a polynomial to the sums and products of its roots. For a quadratic ax2+bx+c=0ax^2 + bx + c = 0 with roots r1,r2r_1, r_2: r1+r2=−b/ar_1 + r_2 = -b/a, r1r2=c/ar_1 r_2 = c/a.

Key Properties and Identities:

  • A polynomial of degree nn has at most nn distinct roots.

  • Polynomials form a ring under addition and multiplication.

Common Pitfalls & Tricky Points:

  • Algebraic errors in polynomial division or evaluating polynomials.

  • Forgetting to count root multiplicities when applying the Fundamental Theorem of Algebra.

  • Not considering the domain of coefficients (e.g., real vs. complex vs. finite field).

Problem-Solving Techniques:

  • Use synthetic division for quick division by (x−c)(x - c).

  • Apply the Remainder and Factor Theorems to find roots or factors efficiently.

  • For problems involving roots, Vieta's formulas can often provide shortcuts.

Quick Formula Reference

Set Theory:

  • ∣P(A)∣=2∣A∣|P(A)| = 2^{|A|}

  • ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|

  • De Morgan's Laws: A∪B‾=A‾∩B‾\overline{A \cup B} = \overline{A} \cap \overline{B}, A∩B‾=A‾∪B‾\overline{A \cap B} = \overline{A} \cup \overline{B}

Relations:

  • Number of relations from AA to BB: 2∣A∣∣B∣2^{|A||B|}

  • Equivalence Relation: Reflexive, Symmetric, Transitive.

  • Partial Order: Reflexive, Antisymmetric, Transitive.

  • Functions (from ∣A∣=m|A| = m to ∣B∣=n|B| = n):

  • Total functions: nmn^m

  • Injective functions: P(n,m)=n!(n−m)!P(n, m) = \frac{n!}{(n-m)!} (if m≤nm \leq n)

  • Bijective functions: n!n! (if m=nm = n)

  • Surjective functions: ∑k=0n(−1)k(nk)(n−k)m\sum_{k=0}^n (-1)^k \binom{n}{k} (n - k)^m

  • Identity function IA(x)=xI_A(x) = x

Group Theory:

  • Group Axioms: Closure, Associativity, Identity, Inverse.

  • Lagrange's Theorem: ∣H∣|H| divides ∣G∣|G| for subgroup HH of group GG.

Lattice:

  • Poset where every pair has unique LUB (join ∨\vee) and GLB (meet ∧\wedge).

  • Distributive Lattice: a∧(b∨c)=(a∧b)∨(a∧c)a \wedge (b \vee c) = (a \wedge b) \vee (a \wedge c), etc.

Mathematical Induction:

  • Base Case P(n0)P(n_0), Inductive Hypothesis P(k)P(k), Inductive Step P(k+1)P(k + 1).

Number Theory:

  • Division Algorithm: a=dq+ra = dq + r, 0≤r<d0 \leq r < d

  • gcd⁡(a,b)⋅lcm(a,b)=∣ab∣\gcd(a, b) \cdot \text{lcm}(a, b) = |ab|

  • Fermat's Little Theorem: ap−1≡1(modp)a^{p-1} \equiv 1 \pmod{p} (for prime pp, p∤ap \nmid a)

  • Euler's Totient Function: ϕ(n)=n∏p∣n,p prime(1−1p)\phi(n) = n \prod_{p|n, p \text{ prime}} \left(1 - \frac{1}{p}\right)

  • Euler's Theorem: aϕ(n)≡1(modn)a^{\phi(n)} \equiv 1 \pmod{n} (for gcd⁡(a,n)=1\gcd(a, n) = 1)

Polynomials:

  • Remainder Theorem: P(x)(mod(x−c))=P(c)P(x) \pmod{(x - c)} = P(c)

  • Factor Theorem: (x−c)(x - c) is a factor   ⟺  P(c)=0\iff P(c) = 0

Important Tips for GATE

    1. Master Definitions and Properties: Many GATE questions directly test your understanding of definitions (e.g., what makes a relation symmetric?) and properties (e.g., De Morgan's laws). Memorize them thoroughly.
    1. Practice with Hasse Diagrams: For partial orders and lattices, drawing Hasse diagrams is crucial. Practice identifying maximal/minimal elements, greatest/least elements, and LUB/GLB from diagrams.
    1. Systematic Verification: When asked to check if a structure is a group, a relation is an equivalence relation, or a function is bijective, systematically go through each axiom/property. Don't skip steps or assume properties.
    1. Number Theory Shortcuts: Familiarize yourself with the Euclidean algorithm for GCD, modular arithmetic properties, and theorems like Fermat's Little Theorem and Euler's Theorem. These are vital for efficiently solving problems involving large numbers or powers.
    1. Inclusion-Exclusion Principle: This principle is frequently tested for counting problems in set theory and functions (especially surjective functions). Practice applying it for 2, 3, and general cases.
    1. Mathematical Induction Structure: Always clearly state your base case, inductive hypothesis, and inductive step. Ensure your inductive step explicitly uses the inductive hypothesis to avoid circular reasoning.
    1. Cardinality vs. Countability: Understand the difference between finite, countably infinite, and uncountable sets. Be familiar with standard examples (e.g., N,Z,QN, \mathbb{Z}, \mathbb{Q} are countable; R,P(N)\mathbb{R}, P(\mathbb{N}) are uncountable) and Cantor's diagonalization argument.
    1. Watch for "If and Only If": Pay close attention to conditions that are "if and only if" (iff) as they imply equivalence and are often key to proving properties or identifying specific structures.