100% FREE Updated: Mar 2026 Engineering Mathematics Discrete Mathematics

Set Theory, Relations, and Functions

Comprehensive study notes on Set Theory, Relations, and Functions for GATE CS preparation. This chapter covers key concepts, formulas, and examples needed for your exam.

Set Theory, Relations, and Functions

Overview

In this chapter, we shall explore the fundamental discrete structures that form the bedrock of theoretical computer science: sets, relations, and functions. These concepts are not merely abstract mathematical exercises; rather, they provide the formal language and analytical tools necessary to model computational problems, define data structures, and reason about algorithmic processes. A mastery of this material is therefore essential, as questions derived from these principles appear consistently in the GATE examination, both directly and as prerequisites for understanding more advanced topics such as graph theory, databases, and automata theory.

Our study will proceed in a logical progression, beginning with the elementary concept of a set as a collection of objects. We will then build upon this foundation to examine relations, which formally describe the connections between elements within or across sets. This leads naturally to the study of functions, a specialized and ubiquitous type of relation that maps inputs to unique outputs, a concept central to the very idea of computation. Finally, we will investigate more complex algebraic structures, namely partial orders and lattices, which provide a framework for ordering and comparing elements in a set. Throughout this chapter, the emphasis will be on rigorous definition, the analysis of properties, and the application of these structures to problems relevant to a computer science engineer.

---

Chapter Contents

| # | Topic | What You'll Learn |
|---|-------|-------------------|
| 1 | Sets | Fundamental properties and operations on collections. |
| 2 | Relations | Defining relationships between elements of sets. |
| 3 | Functions | Specialized relations with unique output mappings. |
| 4 | Partial Orders and Lattices | Structures for ordering and comparing elements. |

---

Learning Objectives

❗ By the End of This Chapter

After completing this chapter, you will be able to:

  • Perform operations on sets, including union, intersection, complement, and power sets, and apply principles of cardinality.

  • Analyze the properties of binary relations, such as reflexivity, symmetry, and transitivity, and determine equivalence classes and partitions.

  • Classify functions as injective, surjective, or bijective, and compute their composition and inverses where they exist.

  • Identify a partially ordered set (poset), construct its Hasse diagram, and determine maximal, minimal, greatest, and least elements.

---

We now turn our attention to Sets...

Part 1: Sets

Introduction

The theory of sets is a fundamental branch of mathematics that serves as the bedrock for many areas within Computer Science, including discrete mathematics, database theory, automata theory, and algorithm design. A set is, in essence, the most basic way to group objects, and the study of these collections provides the language and tools necessary to reason about discrete structures. For the GATE examination, a firm grasp of set theory is indispensable for understanding more advanced topics such as relations, functions, and graph theory.

Our study will begin with the formal definition of a set and its various representations. We will then proceed to explore the relationships between sets, such as subsets and supersets, leading to the concept of the power set. The core of our discussion will focus on the operations that can be performed on setsβ€”union, intersection, difference, and complementβ€”along with the algebraic laws that govern them. Finally, we will examine the concepts of set cardinality and the Cartesian product, which are essential for combinatorial analysis.

πŸ“– Set

A set is a well-defined, unordered collection of distinct objects. The objects that constitute a set are called its elements or members. Sets are typically denoted by uppercase letters (e.g., AA, BB, SS), and their elements are denoted by lowercase letters (e.g., aa, bb, xx).

---

Key Concepts

1. Representation of Sets

A set can be represented in two primary forms:

* Roster or Tabular Form: The elements of the set are listed explicitly, separated by commas, and enclosed in curly braces `{}`. For example, the set VV of vowels in the English alphabet is V={a,e,i,o,u}V = \{a, e, i, o, u\}.
* Set-Builder or Rule Form: The elements are described by a common property. We write this as {x∣P(x)}\{x \mid P(x)\} or {x:P(x)}\{x : P(x)\}, which reads "the set of all elements xx such that xx satisfies the property PP." For example, V={x∣x is a vowel in the English alphabet}V = \{x \mid x \text{ is a vowel in the English alphabet}\}.

2. Subsets, Power Sets, and Cardinality

Let us consider two sets, AA and BB.

πŸ“– Subset and Proper Subset

If every element of set AA is also an element of set BB, then AA is a subset of BB, denoted as AβŠ†BA \subseteq B.

If AβŠ†BA \subseteq B and Aβ‰ BA \ne B, then AA is a proper subset of BB, denoted as AβŠ‚BA \subset B.

The cardinality of a finite set AA, denoted by ∣A∣|A|, is the number of distinct elements in the set. The empty set, denoted by βˆ…\emptyset or {}\{\}, is a set with no elements, and its cardinality is βˆ£βˆ…βˆ£=0|\emptyset| = 0.

A particularly important concept is the collection of all possible subsets of a given set.

πŸ“– Power Set

The power set of a set AA, denoted by P(A)\mathcal{P}(A), is the set of all subsets of AA.

πŸ“ Cardinality of a Power Set
∣P(A)∣=2∣A∣|\mathcal{P}(A)| = 2^{|A|}

Variables:

    • ∣A∣|A| is the cardinality of set AA.

    • ∣P(A)∣|\mathcal{P}(A)| is the cardinality of the power set of AA.


When to use: To find the total number of subsets of a given finite set.

Worked Example:

Problem: Find the power set of S={1,2}S = \{1, 2\} and determine its cardinality.

Solution:

Step 1: Identify the elements of the set SS.
The elements are 11 and 22. The cardinality is ∣S∣=2|S| = 2.

Step 2: List all possible subsets of SS.
The subsets are:

  • The empty set: βˆ…\emptyset

  • Subsets with one element: {1}\{1\}, {2}\{2\}

  • The set itself: {1,2}\{1, 2\}


Step 3: Collect all subsets into a set to form the power set P(S)\mathcal{P}(S).

P(S)={βˆ…,{1},{2},{1,2}}\mathcal{P}(S) = \{\emptyset, \{1\}, \{2\}, \{1, 2\}\}

Step 4: Calculate the cardinality of the power set using the formula.

∣P(S)∣=2∣S∣=22=4|\mathcal{P}(S)| = 2^{|S|} = 2^2 = 4

Answer: The power set is P(S)={βˆ…,{1},{2},{1,2}}\mathcal{P}(S) = \{\emptyset, \{1\}, \{2\}, \{1, 2\}\} and its cardinality is 44.

3. Set Operations

We can combine or modify sets using several fundamental operations. Let AA and BB be two sets within a universal set UU.




U




A
B

A ∩ B
A - B
B - A

* Union (AβˆͺBA \cup B): The set of all elements that are in AA, or in BB, or in both.

AβˆͺB={x∣x∈A∨x∈B}A \cup B = \{x \mid x \in A \lor x \in B\}

* Intersection (A∩BA \cap B): The set of all elements that are in both AA and BB.
A∩B={x∣x∈A∧x∈B}A \cap B = \{x \mid x \in A \land x \in B\}

* Difference (Aβˆ’BA - B): The set of all elements that are in AA but not in BB.
Aβˆ’B={x∣x∈A∧xβˆ‰B}A - B = \{x \mid x \in A \land x \notin B\}

* Complement (Aβ€²A' or AcA^c): The set of all elements in the universal set UU that are not in AA.
Aβ€²=Uβˆ’A={x∣x∈U∧xβˆ‰A}A' = U - A = \{x \mid x \in U \land x \notin A\}

4. Principle of Inclusion-Exclusion

This principle is a counting technique used to find the number of elements in the union of two or more sets.

πŸ“ Inclusion-Exclusion for Two Sets
∣AβˆͺB∣=∣A∣+∣Bβˆ£βˆ’βˆ£A∩B∣|A \cup B| = |A| + |B| - |A \cap B|

Variables:

    • ∣A∣|A|, ∣B∣|B|: Cardinalities of sets AA and BB.

    • ∣A∩B∣|A \cap B|: Cardinality of the intersection of AA and BB.

    • ∣AβˆͺB∣|A \cup B|: Cardinality of the union of AA and BB.


When to use: To find the size of the union of two sets when their individual sizes and the size of their intersection are known.

---

Problem-Solving Strategies

πŸ’‘ GATE Strategy: Venn Diagrams

For problems involving up to three sets and their cardinalities, always start by drawing a Venn diagram. Fill in the cardinality of the innermost intersection first (e.g., ∣A∩B∩C∣|A \cap B \cap C|), then work your way outwards. This visual method prevents double-counting and simplifies complex inclusion-exclusion problems.

---

---

Common Mistakes

⚠️ Avoid These Errors
    • ❌ Confusing subsets and elements: {a}\{a\} is a subset of {a,b}\{a, b\}, but aa is an element. An element can also be a set, e.g., in {{a},b}\{\{a\}, b\}, {a}\{a\} is an element.
    • βœ… Always distinguish between membership (∈\in) and subset (βŠ†\subseteq). a∈{a,b}a \in \{a, b\} is true, but aβŠ†{a,b}a \subseteq \{a, b\} is false.
    • ❌ Incorrectly calculating power set cardinality: For a set with nn elements, the power set has 2n2^n elements, NOT n2n^2.
    • βœ… For A={1,2,3}A = \{1,2,3\}, ∣A∣=3|A|=3, so ∣P(A)∣=23=8|\mathcal{P}(A)| = 2^3 = 8.

---

Practice Questions

:::question type="MCQ" question="Let A={1,{2,3},4}A = \{1, \{2, 3\}, 4\}. Which of the following statements is true?" options=["{2,3}βŠ‚A\{2, 3\} \subset A","{2,3}∈A\{2, 3\} \in A","{1,4}∈A\{1, 4\} \in A","2∈A2 \in A"] answer="{2, 3} ∈\in A" hint="Distinguish between an element that is a set and a subset of the main set. Analyze the top-level elements of A." solution="
Step 1: Identify the elements of set AA.
The set AA is given by A={1,{2,3},4}A = \{1, \{2, 3\}, 4\}. The distinct elements of AA are the number 11, the set {2,3}\{2, 3\}, and the number 44.

Step 2: Evaluate each option.

  • Option A: {2,3}βŠ‚A\{2, 3\} \subset A: This statement claims that {2,3}\{2, 3\} is a proper subset of AA. For this to be true, every element of {2,3}\{2, 3\} must be an element of AA. The elements of {2,3}\{2, 3\} are 22 and 33. However, neither 22 nor 33 are elements of AA. Thus, this statement is false.

  • Option B: {2,3}∈A\{2, 3\} \in A: This statement claims that the set {2,3}\{2, 3\} is an element of AA. Looking at the definition of AA, we can see that {2,3}\{2, 3\} is indeed listed as one of the three elements. Thus, this statement is true.

  • Option C: {1,4}∈A\{1, 4\} \in A: This statement claims that the set {1,4}\{1, 4\} is an element of AA. The elements of AA are 11, {2,3}\{2, 3\}, and 44. The set {1,4}\{1, 4\} is not one of these elements. Thus, this statement is false.

  • Option D: 2∈A2 \in A: This statement claims that the number 22 is an element of AA. The elements of AA are 11, {2,3}\{2, 3\}, and 44. The number 22 is not an element of AA; it is an element of the set {2,3}\{2, 3\} which is an element of AA. Thus, this statement is false.


Result: The only true statement is {2,3}∈A\{2, 3\} \in A.
Answer: {2,3}∈A\boxed{\{2, 3\} \in A}
"
:::

:::question type="NAT" question="In a class of 60 students, 35 students play Cricket and 20 students play both Cricket and Tennis. All students play at least one of the two games. How many students play Tennis?" answer="45" hint="Use the Principle of Inclusion-Exclusion. You are given the total number of students (the union), the number who play Cricket, and the number who play both (the intersection)." solution="
Step 1: Define the sets.
Let CC be the set of students who play Cricket.
Let TT be the set of students who play Tennis.
The total number of students is 60, and every student plays at least one game, so ∣CβˆͺT∣=60|C \cup T| = 60.

Step 2: List the given cardinalities.
∣CβˆͺT∣=60|C \cup T| = 60
∣C∣=35|C| = 35
∣C∩T∣=20|C \cap T| = 20

Step 3: Apply the Principle of Inclusion-Exclusion.
The formula is ∣CβˆͺT∣=∣C∣+∣Tβˆ£βˆ’βˆ£C∩T∣|C \cup T| = |C| + |T| - |C \cap T|.

Step 4: Substitute the known values and solve for ∣T∣|T|.

60=35+∣Tβˆ£βˆ’2060 = 35 + |T| - 20
60=15+∣T∣60 = 15 + |T|
∣T∣=60βˆ’15|T| = 60 - 15
∣T∣=45|T| = 45

Result: 45 students play Tennis.
Answer: 45\boxed{45}
"
:::

:::question type="MSQ" question="Let AA and BB be two non-empty sets in a universal set UU. Which of the following statements are always true?" options=["Aβˆ’B=A∩Bβ€²A - B = A \cap B'","AβˆͺAβ€²=UA \cup A' = U","AβŠ†AβˆͺBA \subseteq A \cup B","If A∩B=βˆ…A \cap B = \emptyset, then AβŠ‚Bβ€²A \subset B'"] answer="A - B = A ∩\cap B',A βˆͺ\cup A' = U,A βŠ†\subseteq A βˆͺ\cup B,If A ∩\cap B = βˆ…\emptyset, then A βŠ‚\subset B'" hint="Evaluate each identity using the definitions of set operations and the complement." solution="
Let's analyze each statement:

  • Aβˆ’B=A∩Bβ€²A - B = A \cap B': By definition, Aβˆ’BA - B contains all elements that are in AA but not in BB. The set Bβ€²B' contains all elements not in BB. The intersection A∩Bβ€²A \cap B' contains all elements that are in AA AND not in BB. These two definitions are identical. Thus, this statement is always true.
  • AβˆͺAβ€²=UA \cup A' = U: The set AA contains some elements of the universal set UU. The set Aβ€²A' contains all elements of UU that are not in AA. Their union therefore contains all elements of UU. This is the definition of the complement law. Thus, this statement is always true.
  • AβŠ†AβˆͺBA \subseteq A \cup B: The union AβˆͺBA \cup B contains all elements of AA and all elements of BB. By definition, every element of AA is present in AβˆͺBA \cup B. Therefore, AA is a subset of AβˆͺBA \cup B. Thus, this statement is always true.
  • If A∩B=βˆ…A \cap B = \emptyset, then AβŠ‚Bβ€²A \subset B': If A∩B=βˆ…A \cap B = \emptyset, it means that AA and BB are disjoint. This implies that every element of AA is not in BB, and therefore must be in Bβ€²B' (the complement of BB). So, AβŠ†Bβ€²A \subseteq B'. Since AA and BB are non-empty, AA cannot be equal to Bβ€²B' (as BB contains elements not in Bβ€²B'), making AA a proper subset of Bβ€²B'. Thus, this statement is always true.
All four statements represent fundamental and correct properties of sets. Answer: Aβˆ’B=A∩Bβ€²,AβˆͺAβ€²=U,AβŠ†AβˆͺB,IfΒ A∩B=βˆ…,Β thenΒ AβŠ‚Bβ€²\boxed{A - B = A \cap B', A \cup A' = U, A \subseteq A \cup B, \text{If } A \cap B = \emptyset, \text{ then } A \subset B'} " :::

---

Summary

❗ Key Takeaways for GATE

  • Definitions are Paramount: Be absolutely clear on the definitions of a set, element, subset (βŠ†\subseteq), proper subset (βŠ‚\subset), and membership (∈\in).

  • Power Set Cardinality: For a set AA with cardinality nn, the power set P(A)\mathcal{P}(A) has cardinality 2n2^n. This is a frequently tested concept.

  • Inclusion-Exclusion: Master the formula ∣AβˆͺB∣=∣A∣+∣Bβˆ£βˆ’βˆ£A∩B∣|A \cup B| = |A| + |B| - |A \cap B|. For problems with three sets, drawing a Venn diagram is often faster and less error-prone than using the full formula.

  • Set Identities: Understand the fundamental laws, especially De Morgan's Laws: (AβˆͺB)β€²=Aβ€²βˆ©Bβ€²(A \cup B)' = A' \cap B' and (A∩B)β€²=Aβ€²βˆͺBβ€²(A \cap B)' = A' \cup B'.

---

What's Next?

πŸ’‘ Continue Learning

This topic provides the foundation for several other critical areas in Discrete Mathematics:

    • Relations: A relation between two sets AA and BB is formally defined as a subset of their Cartesian product, AΓ—BA \times B. Understanding sets is a prerequisite.

    • Functions: A function is a special type of relation where each element in the domain maps to exactly one element in the codomain. The concepts of domain, codomain, and range are all based on sets.


Master these connections for comprehensive GATE preparation!

---

πŸ’‘ Moving Forward

Now that you understand Sets, let's explore Relations which builds on these concepts.

---

Part 2: Relations

Introduction

In the discipline of discrete mathematics, the concept of a relation provides a formal framework for describing connections between elements of sets. A relation is, in essence, a generalization of a function. While a function must map each input from its domain to a single, unique output, a relation allows for more flexible associations: an element may be related to multiple elements, or to none at all. This framework is fundamental to numerous areas within computer science, including database theory (relational databases), graph theory, and the formal verification of algorithms.

Our study will begin with the foundational definitions, establishing a relation as a subset of a Cartesian product. We will then proceed to a systematic examination of the properties that a relation on a set may possess, such as reflexivity, symmetry, and transitivity. The culmination of these properties leads to the particularly important concept of an equivalence relation, which partitions a set into disjoint subsets known as equivalence classes. For the GATE examination, a thorough understanding of these properties and the structure of equivalence relations is not merely advantageous but essential for solving a class of problems that test deep conceptual clarity.

πŸ“– Relation

Let AA and BB be two non-empty sets. A binary 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 that aa is related to bb by RR, often denoted as aRbaRb.

If A=BA = B, the relation RβŠ†AΓ—AR \subseteq A \times A is called a relation on the set A.

---

Key Concepts

1. Fundamental Definitions and Representations

Let us first establish the necessary groundwork. The Cartesian product of two sets, AA and BB, denoted AΓ—BA \times B, is the set of all ordered pairs (a,b)(a, b) where a∈Aa \in A and b∈Bb \in B.

A relation is simply any subset of this product. The set AA is called the domain of the relation, and the set BB is the codomain. The range of a relation RR is the set of all second elements of the pairs in RR, i.e., {b∈Bβˆ£βˆƒa∈A,(a,b)∈R}\{b \in B \mid \exists a \in A, (a, b) \in R\}.

Relations can be represented in several ways, each offering a different perspective.

* Set-Roster Notation: The relation is explicitly listed as a set of ordered pairs. For A={1,2,3}A = \{1, 2, 3\}, a relation RR could be R={(1,2),(1,3),(3,2)}R = \{(1, 2), (1, 3), (3, 2)\}.
* Matrix Representation: For a relation RR from A={a1,...,am}A=\{a_1, ..., a_m\} to B={b1,...,bn}B=\{b_1, ..., b_n\}, we can construct an mΓ—nm \times n matrix MR=[mij]M_R = [m_{ij}] where mij=1m_{ij} = 1 if (ai,bj)∈R(a_i, b_j) \in R and mij=0m_{ij} = 0 otherwise.
* Directed Graph (Digraph): For a relation on a set AA, we can draw a graph where the vertices represent the elements of AA. A directed edge is drawn from vertex aa to vertex bb if and only if (a,b)∈R(a, b) \in R.

Consider the set A={1,2,3,4}A = \{1, 2, 3, 4\} and the relation R={(1,1),(1,2),(2,3),(3,4),(4,1)}R = \{(1, 1), (1, 2), (2, 3), (3, 4), (4, 1)\}. The digraph representation provides an intuitive visualization of this structure.











1


2


3


4









---

2. Properties of Relations on a Set

When a relation RR is defined on a single set AA (i.e., RβŠ†AΓ—AR \subseteq A \times A), it can exhibit several important properties. Let us consider a relation RR on a set AA.

* Reflexive: A relation RR is reflexive if every element is related to itself.

(βˆ€a∈A)((a,a)∈R)(\forall a \in A)((a, a) \in R)

In matrix form, all diagonal entries must be 1. In a digraph, every vertex must have a self-loop.

* Irreflexive: A relation RR is irreflexive if no element is related to itself.

(βˆ€a∈A)((a,a)βˆ‰R)(\forall a \in A)((a, a) \notin R)

In matrix form, all diagonal entries must be 0. In a digraph, no vertex has a self-loop.

* Symmetric: A relation RR is symmetric if for every pair (a,b)(a,b) in RR, the pair (b,a)(b,a) is also in RR.

(βˆ€a,b∈A)((a,b)∈Rβ€…β€ŠβŸΉβ€…β€Š(b,a)∈R)(\forall a, b \in A)((a, b) \in R \implies (b, a) \in R)

In matrix form, the matrix MRM_R is equal to its transpose (MR=MRTM_R = M_R^T). In a digraph, for every edge from aa to bb, there must be a corresponding edge from bb to aa.

* Antisymmetric: A relation RR is antisymmetric if the only way for both (a,b)(a,b) and (b,a)(b,a) to be in RR is if a=ba=b.

(βˆ€a,b∈A)(((a,b)∈R∧(b,a)∈R)β€…β€ŠβŸΉβ€…β€Ša=b)(\forall a, b \in A)(((a, b) \in R \land (b, a) \in R) \implies a = b)

This property is crucial for defining partial orderings.

* Transitive: A relation RR is transitive if a "chain" of relations implies a direct relation.

(βˆ€a,b,c∈A)(((a,b)∈R∧(b,c)∈R)β€…β€ŠβŸΉβ€…β€Š(a,c)∈R)(\forall a, b, c \in A)(((a, b) \in R \land (b, c) \in R) \implies (a, c) \in R)

In a digraph, if there is a path of length 2 from vertex aa to cc (via bb), there must be a direct edge from aa to cc.

* Circular: This is a less common but tested property. A relation is circular if a chain of two relations implies a "reversed" relation.

(βˆ€a,b,c∈A)(((a,b)∈R∧(b,c)∈R)β€…β€ŠβŸΉβ€…β€Š(c,a)∈R)(\forall a, b, c \in A)(((a, b) \in R \land (b, c) \in R) \implies (c, a) \in R)

---

3. Equivalence Relations

An equivalence relation is a fundamental structure that generalizes the concept of equality. It groups elements of a set that are similar in some specified manner.

πŸ“– Equivalence Relation

A relation RR on a set AA is an equivalence relation if it is:

  • Reflexive

  • Symmetric

  • Transitive

The canonical example is the equality relation "=" on the set of integers. Another is the congruence modulo nn relation, where a≑b(modn)a \equiv b \pmod n if nn divides (aβˆ’b)(a-b).

An equivalence relation on a set AA induces a partition of AA. A partition is a collection of non-empty, disjoint subsets of AA whose union is AA. These subsets are called equivalence classes.

πŸ“– Equivalence Class

Let ∼\sim be an equivalence relation on a set AA. For any element a∈Aa \in A, the equivalence class of aa, denoted by [a][a], is the set of all elements in AA that are equivalent to aa.

[a]={x∈A∣x∼a}[a] = \{x \in A \mid x \sim a\}

The set of all distinct equivalence classes is called the quotient set, denoted A/∼A/\sim.

Worked Example:

Problem: Let A={1,2,3,4,5}A = \{1, 2, 3, 4, 5\} and define a relation RR on AA such that aRbaRb if and only if a≑b(mod3)a \equiv b \pmod 3. Determine the equivalence classes.

Solution:

Step 1: Understand the relation. a≑b(mod3)a \equiv b \pmod 3 means that aβˆ’ba-b is an integer multiple of 3. We verify this is an equivalence relation (it is reflexive, symmetric, and transitive).

Step 2: Find the equivalence class of 1, denoted [1][1]. We seek all x∈Ax \in A such that x≑1(mod3)x \equiv 1 \pmod 3.

  • 1βˆ’1=01-1 = 0, which is 0Γ—30 \times 3. So 1∈[1]1 \in [1].

  • 2βˆ’1=12-1 = 1, not a multiple of 3.

  • 3βˆ’1=23-1 = 2, not a multiple of 3.

  • 4βˆ’1=34-1 = 3, which is 1Γ—31 \times 3. So 4∈[1]4 \in [1].

  • 5βˆ’1=45-1 = 4, not a multiple of 3.


[1]={1,4}[1] = \{1, 4\}

Step 3: Find the equivalence class of 2, denoted [2][2]. We seek all x∈Ax \in A such that x≑2(mod3)x \equiv 2 \pmod 3.

  • 2βˆ’2=02-2 = 0. So 2∈[2]2 \in [2].

  • 5βˆ’2=35-2 = 3. So 5∈[2]5 \in [2].


[2]={2,5}[2] = \{2, 5\}

Step 4: Find the equivalence class of 3, denoted [3][3]. We seek all x∈Ax \in A such that x≑3(mod3)x \equiv 3 \pmod 3, which is the same as x≑0(mod3)x \equiv 0 \pmod 3.

  • 3βˆ’3=03-3 = 0. So 3∈[3]3 \in [3].


[3]={3}[3] = \{3\}

Step 5: Verify the partition. The equivalence classes are {1,4}\{1, 4\}, {2,5}\{2, 5\}, and {3}\{3\}. These are disjoint, non-empty, and their union is {1,2,3,4,5}=A\{1, 2, 3, 4, 5\} = A.

Answer: The equivalence classes are {1,4}\{1, 4\}, {2,5}\{2, 5\}, and {3}\{3\}. The quotient set is A/R={{1,4},{2,5},{3}}A/R = \{\{1, 4\}, \{2, 5\}, \{3\}\}.

---

4. The Circular Relation Property

As observed in GATE examinations, non-standard properties may be introduced to test fundamental reasoning. The circular property is one such example. A key result connects it directly to equivalence relations.

❗ Reflexive and Circular Implies Equivalence

A relation RR on a set AA is an equivalence relation if and only if RR is reflexive and circular.

Let us prove this significant result.

Proof:

Part 1: Equivalence β€…β€ŠβŸΉβ€…β€Š\implies Reflexive and Circular

Assume RR is an equivalence relation. By definition, RR is reflexive. We must show it is circular.
Let (a,b)∈R(a, b) \in R and (b,c)∈R(b, c) \in R.
Since RR is transitive, (a,c)∈R(a, c) \in R.
Since RR is symmetric, (a,c)∈Rβ€…β€ŠβŸΉβ€…β€Š(c,a)∈R(a, c) \in R \implies (c, a) \in R.
Thus, (a,b)∈R∧(b,c)∈Rβ€…β€ŠβŸΉβ€…β€Š(c,a)∈R(a, b) \in R \land (b, c) \in R \implies (c, a) \in R. This is the definition of a circular relation.

Part 2: Reflexive and Circular β€…β€ŠβŸΉβ€…β€Š\implies Equivalence

Assume RR is reflexive and circular. We must show RR is symmetric and transitive.

* Symmetry:
Let (a,b)∈R(a, b) \in R. We want to show (b,a)∈R(b, a) \in R.
Since RR is reflexive, we know that (b,b)∈R(b, b) \in R.
We have (a,b)∈R(a, b) \in R and (b,b)∈R(b, b) \in R.
By the circular property, these two imply (b,a)∈R(b, a) \in R.
Thus, RR is symmetric.

* Transitivity:
Let (a,b)∈R(a, b) \in R and (b,c)∈R(b, c) \in R. We want to show (a,c)∈R(a, c) \in R.
By the circular property, (a,b)∈R∧(b,c)∈Rβ€…β€ŠβŸΉβ€…β€Š(c,a)∈R(a, b) \in R \land (b, c) \in R \implies (c, a) \in R.
We have just proven that RR is symmetric.
Therefore, since (c,a)∈R(c, a) \in R, it must be that (a,c)∈R(a, c) \in R.
Thus, RR is transitive.

Since RR is reflexive (by assumption), symmetric, and transitive, it is an equivalence relation. This completes the proof.

---

---

#
## 5. Relations Induced by Functions

A function can be used to define an equivalence relation on its domain. This construction is a powerful idea that connects the study of functions to relations and partitions.

Consider a function f:Aβ†’Bf: A \to B. We can define a relation ∼\sim on the domain AA as follows:

a1∼a2β€…β€ŠβŸΊβ€…β€Šf(a1)=f(a2)a_1 \sim a_2 \iff f(a_1) = f(a_2)

This relation groups together elements of the domain that map to the same element in the codomain. We can demonstrate that this is always an equivalence relation.

  • Reflexivity: For any a∈Aa \in A, f(a)=f(a)f(a) = f(a), so a∼aa \sim a. It is reflexive.

  • Symmetry: If a1∼a2a_1 \sim a_2, then f(a1)=f(a2)f(a_1) = f(a_2). This implies f(a2)=f(a1)f(a_2) = f(a_1), so a2∼a1a_2 \sim a_1. It is symmetric.

  • Transitivity: If a1∼a2a_1 \sim a_2 and a2∼a3a_2 \sim a_3, then f(a1)=f(a2)f(a_1) = f(a_2) and f(a2)=f(a3)f(a_2) = f(a_3). This implies f(a1)=f(a3)f(a_1) = f(a_3), so a1∼a3a_1 \sim a_3. It is transitive.
  • Since ∼\sim is an equivalence relation, it partitions AA into equivalence classes. Let E=A/∼\mathcal{E} = A/\sim be the set of these equivalence classes. We can now define a new function F:Eβ†’BF: \mathcal{E} \to B by the rule:

    F([x])=f(x)F([x]) = f(x)

    A crucial question arises: is this function FF well-defined? A function is well-defined if its output depends only on the input, not on how the input is represented. Here, the input is an equivalence class [x][x], which can be represented by any of its members. If we choose a different representative, say y∈[x]y \in [x], will we get the same output?

    Let [x]=[y][x] = [y]. By definition of an equivalence class, this means x∼yx \sim y. By the definition of our relation ∼\sim, this means f(x)=f(y)f(x) = f(y).
    Therefore, F([x])=f(x)F([x]) = f(x) and F([y])=f(y)F([y]) = f(y), which are equal.
    So, F([x])=F([y])F([x]) = F([y]). The output of FF is independent of the choice of representative from the equivalence class. Thus, the function FF is always well-defined.

    Now, let us analyze the properties of this new function FF.

    * Injectivity (One-to-one): FF is always injective.
    To prove this, assume F([x])=F([y])F([x]) = F([y]). By definition of FF, this means f(x)=f(y)f(x) = f(y). By definition of ∼\sim, this implies x∼yx \sim y. If xx and yy are equivalent, they belong to the same equivalence class, so [x]=[y][x] = [y]. We have shown that F([x])=F([y])β€…β€ŠβŸΉβ€…β€Š[x]=[y]F([x]) = F([y]) \implies [x] = [y], which is the definition of injectivity.

    * Surjectivity (Onto): The surjectivity of FF depends on the surjectivity of the original function ff.
    If ff is surjective, then for any b∈Bb \in B, there exists some a∈Aa \in A such that f(a)=bf(a) = b. Now consider the equivalence class [a]∈E[a] \in \mathcal{E}. The function FF maps this class as F([a])=f(a)=bF([a]) = f(a) = b. So, for any element bb in the codomain, we have found a pre-image [a][a] in the domain E\mathcal{E}. Therefore, if ff is surjective, then FF is also surjective.

    * Bijectivity: A function is bijective if it is both injective and surjective. From our analysis, FF is always injective. It is surjective if and only if ff is surjective. Therefore, if ff is surjective, then FF is bijective.

    This result is a simplified version of the First Isomorphism Theorem for sets and provides a canonical way to construct a bijection from a surjection.

    Problem-Solving Strategies

    πŸ’‘ Matrix Method for Properties

    For a relation RR on a finite set AA, its matrix representation MRM_R can be used to quickly check properties:

      • Reflexive: All diagonal elements are 1 (mii=1m_{ii}=1 for all ii).

      • Irreflexive: All diagonal elements are 0 (mii=0m_{ii}=0 for all ii).

      • Symmetric: The matrix is its own transpose (MR=MRTM_R = M_R^T).

      • Antisymmetric: If mij=1m_{ij}=1 and mji=1m_{ji}=1, then ii must be equal to jj. (No 1s are symmetric with respect to the diagonal, except on the diagonal itself).

      • Transitive: If the matrix product MRβ‹…MRM_R \cdot M_R (using Boolean arithmetic: 1+1=11+1=1) has a 1 at position (i,k)(i, k), then MRM_R must also have a 1 at (i,k)(i, k). In other words, if (MR2)ik=1(M_R^2)_{ik} = 1, then (MR)ik(M_R)_{ik} must be 1.

    ---

    Common Mistakes

    ⚠️ Avoid These Errors
      • ❌ Confusing Antisymmetric and Asymmetric: A relation can be both symmetric and antisymmetric simultaneously (e.g., the identity relation). An asymmetric relation, however, cannot have any symmetric pairs (a,b)(a,b) and (b,a)(b,a) where aβ‰ ba \neq b, and it must also be irreflexive. The key difference is the handling of self-loops.
      • ❌ Incomplete Transitivity Check: When checking for transitivity, students often miss a required pair. For R={(a,b),(b,c),(a,c),(c,d)}R = \{(a, b), (b, c), (a, c), (c, d)\}, one might miss checking if (b,d)(b,d) is needed. Since (b,c)∈R(b,c) \in R and (c,d)∈R(c,d) \in R, transitivity requires (b,d)∈R(b,d) \in R.
      • ❌ Assuming Reflexivity on a Subset: A relation RR on a set AA is reflexive only if (a,a)∈R(a,a) \in R for every a∈Aa \in A. If A={1,2,3}A = \{1, 2, 3\} and R={(1,1),(2,2),(1,2)}R = \{(1,1), (2,2), (1,2)\}, RR is not reflexive because (3,3)(3,3) is missing.
      • ❌ Circular vs. Transitive: Do not confuse the implications.
    - Transitive: (a,b)∧(b,c)β€…β€ŠβŸΉβ€…β€Š(a,c)(a,b) \land (b,c) \implies (a,c) - Circular: (a,b)∧(b,c)β€…β€ŠβŸΉβ€…β€Š(c,a)(a,b) \land (b,c) \implies (c,a) As we have proven, in the presence of reflexivity, these two properties imply each other (via symmetry).

    ---

    Practice Questions

    :::question type="MCQ" question="Let A={1,2,3,4}A = \{1, 2, 3, 4\}. Consider the relation R={(1,1),(2,2),(3,3),(1,2),(2,1),(2,3),(3,2)}R = \{(1,1), (2,2), (3,3), (1,2), (2,1), (2,3), (3,2)\}. Which of the following properties does RR possess?" options=["Reflexive and Transitive","Symmetric but not Transitive","Transitive but not Symmetric","Neither Symmetric nor Transitive"] answer="Symmetric but not Transitive" hint="Check each property systematically. For reflexivity, ensure all elements of A have self-loops. For transitivity, look for paths of length 2." solution="
    Step 1: Check Reflexivity.
    The set is A={1,2,3,4}A = \{1, 2, 3, 4\}. A reflexive relation on AA must contain (1,1),(2,2),(3,3),(4,4)(1,1), (2,2), (3,3), (4,4). The relation RR is missing (4,4)(4,4). Therefore, RR is not reflexive.

    Step 2: Check Symmetry.
    We check each pair.

    • (1,2)∈R(1,2) \in R. The pair (2,1)(2,1) is also in RR. This is satisfied.

    • (2,3)∈R(2,3) \in R. The pair (3,2)(3,2) is also in RR. This is satisfied.

    All other pairs are of the form (a,a)(a,a), which are trivially symmetric. Thus, RR is symmetric.

    Step 3: Check Transitivity.
    We look for pairs (a,b)(a,b) and (b,c)(b,c) in RR.

    • We have (1,2)∈R(1,2) \in R and (2,3)∈R(2,3) \in R. For transitivity, we must have (1,3)∈R(1,3) \in R.

    • The pair (1,3)(1,3) is not in RR.

    Therefore, RR is not transitive.

    Result: The relation is symmetric but not transitive.
    Answer: \boxed{\text{Symmetric but not Transitive}}
    "
    :::

    :::question type="NAT" question="Let SS be a set with 4 elements. What is the number of reflexive relations on SS?" answer="4096" hint="A relation on a set with nn elements is a subset of a Cartesian product of size nΓ—nn \times n. For a relation to be reflexive, which pairs must be included?" solution="
    Step 1: Define the set and the Cartesian product.
    Let the set be SS. The size of SS is ∣S∣=4|S| = 4.
    A relation on SS is a subset of SΓ—SS \times S.
    The size of the Cartesian product is ∣SΓ—S∣=∣Sβˆ£Γ—βˆ£S∣=4Γ—4=16|S \times S| = |S| \times |S| = 4 \times 4 = 16.
    The total number of relations on SS is the number of subsets of SΓ—SS \times S, which is 2162^{16}.

    Step 2: Apply the reflexive property constraint.
    A relation RR on SS is reflexive if for every x∈Sx \in S, the pair (x,x)(x,x) is in RR.
    The pairs on the main diagonal of the matrix representation are (s1,s1),(s2,s2),(s3,s3),(s4,s4)(s_1, s_1), (s_2, s_2), (s_3, s_3), (s_4, s_4). There are 4 such pairs.
    For RR to be reflexive, these 4 pairs must be included in the relation. There is no choice for them.

    Step 3: Count the remaining choices.
    There are a total of 16 pairs in SΓ—SS \times S.
    The 4 diagonal pairs have a fixed choice (they must be in RR).
    The remaining 16βˆ’4=1216 - 4 = 12 off-diagonal pairs can either be in the relation or not. For each of these 12 pairs, we have 2 choices.

    Step 4: Calculate the total number of reflexive relations.
    The total number of ways to form the relation is the product of the number of choices for each pair.
    Number of relations = 14Γ—212=2121^4 \times 2^{12} = 2^{12}.

    Step 5: Compute the final value.

    212=210Γ—22=1024Γ—4=40962^{12} = 2^{10} \times 2^2 = 1024 \times 4 = 4096

    Result: The number of reflexive relations on a set with 4 elements is 4096.
    Answer: \boxed{4096}
    "
    :::

    :::question type="MSQ" question="Let the set of integers be Z\mathbb{Z}. Define a function g:Zβ†’Zg: \mathbb{Z} \to \mathbb{Z} as g(x)=x2g(x) = x^2. Let ∼\sim be a relation on Z\mathbb{Z} defined by a∼ba \sim b if g(a)=g(b)g(a) = g(b). Let E\mathcal{E} be the set of equivalence classes of ∼\sim. Let a new function G:Eβ†’ZG: \mathcal{E} \to \mathbb{Z} be defined as G([x])=g(x)G([x]) = g(x). Which of the following statements is/are TRUE?" options=["The function gg is surjective.","The relation ∼\sim is an equivalence relation.","The function GG is injective (one-to-one).","The function GG is surjective (onto)."] answer="The relation ∼\sim is an equivalence relation.,The function GG is injective (one-to-one)." hint="Analyze the properties of the function g(x)=x2g(x)=x^2 on the domain of integers. Recall the properties of the induced function G." solution="
    Statement 1: The function gg is surjective.
    A function is surjective if its range equals its codomain. Here, the codomain is Z\mathbb{Z}. The range of g(x)=x2g(x) = x^2 for x∈Zx \in \mathbb{Z} is the set of perfect squares {0,1,4,9,...}\{0, 1, 4, 9, ...\}. This is not equal to all integers Z\mathbb{Z}. For example, there is no integer xx such that x2=βˆ’1x^2 = -1. Therefore, gg is not surjective. This statement is FALSE.

    Statement 2: The relation ∼\sim is an equivalence relation.
    The relation is defined as a∼bβ€…β€ŠβŸΊβ€…β€Šg(a)=g(b)a \sim b \iff g(a) = g(b). As proven in the notes, any relation defined this way from a function is an equivalence relation.

    • Reflexive: g(a)=g(a)β€…β€ŠβŸΉβ€…β€Ša∼ag(a) = g(a) \implies a \sim a.

    • Symmetric: a∼bβ€…β€ŠβŸΉβ€…β€Šg(a)=g(b)β€…β€ŠβŸΉβ€…β€Šg(b)=g(a)β€…β€ŠβŸΉβ€…β€Šb∼aa \sim b \implies g(a)=g(b) \implies g(b)=g(a) \implies b \sim a.

    • Transitive: a∼b∧b∼cβ€…β€ŠβŸΉβ€…β€Šg(a)=g(b)∧g(b)=g(c)β€…β€ŠβŸΉβ€…β€Šg(a)=g(c)β€…β€ŠβŸΉβ€…β€Ša∼ca \sim b \land b \sim c \implies g(a)=g(b) \land g(b)=g(c) \implies g(a)=g(c) \implies a \sim c.

    The relation is reflexive, symmetric, and transitive. This statement is TRUE.

    Statement 3: The function GG is injective (one-to-one).
    The function GG is defined from the set of equivalence classes E\mathcal{E} to Z\mathbb{Z}. As proven in the notes, such a function G([x])=g(x)G([x]) = g(x) is always injective.
    To verify: Assume G([x])=G([y])G([x]) = G([y]). This means g(x)=g(y)g(x) = g(y). By definition of the relation ∼\sim, this means x∼yx \sim y. If x∼yx \sim y, then they belong to the same equivalence class, i.e., [x]=[y][x] = [y]. Since G([x])=G([y])β€…β€ŠβŸΉβ€…β€Š[x]=[y]G([x]) = G([y]) \implies [x] = [y], the function GG is injective. This statement is TRUE.

    Statement 4: The function GG is surjective (onto).
    The function GG is surjective if and only if the original function gg is surjective. We already established in Statement 1 that gg is not surjective. Therefore, GG is also not surjective. This statement is FALSE.

    Result: The correct statements are "The relation ∼\sim is an equivalence relation." and "The function GG is injective (one-to-one)."
    Answer: \boxed{\text{The relation ∼\sim is an equivalence relation.,The function GG is injective (one-to-one).}}
    "
    :::

    ---

    Summary

    ❗ Key Takeaways for GATE

    • Properties are Fundamental: Be able to rapidly identify if a relation is reflexive, symmetric, antisymmetric, and transitive. Use matrix or graph representations as a tool for quick verification.

    • Equivalence Relations Partition Sets: Understand that an equivalence relation (Reflexive, Symmetric, Transitive) on a set AA groups elements into disjoint equivalence classes, whose union is AA. This is a core concept.

    • Special Properties: Be prepared for non-standard properties like "circular". The key result to remember is that a relation is an equivalence relation if and only if it is reflexive and circular.

    • Functions Induce Relations: A function f:Aβ†’Bf: A \to B induces an equivalence relation on its domain AA via a1∼a2β€…β€ŠβŸΊβ€…β€Šf(a1)=f(a2)a_1 \sim a_2 \iff f(a_1) = f(a_2). The induced map from the equivalence classes to BB is always well-defined and injective. It is bijective if and only if the original function ff was surjective.

    ---

    What's Next?

    πŸ’‘ Continue Learning

    A solid understanding of relations is the foundation for more advanced topics in discrete mathematics.

      • Partial Orders (Posets) and Lattices: If a relation is reflexive, antisymmetric, and transitive, it defines a partial order. This is the basis for structures like Hasse diagrams and lattices, which are important in algorithm design and theory of computation.
      • Functions: Relations are a superset of functions. Deepening your understanding of injective, surjective, and bijective functions will clarify the connection explored in this chapter and is crucial for many other GATE CS topics.
      • Graph Theory: A directed graph is a visual representation of a relation. Properties of relations, such as transitivity (transitive closure), have direct analogues in graph reachability algorithms.

    ---

    ---

    πŸ’‘ Moving Forward

    Now that you understand Relations, let's explore Functions which builds on these concepts.

    ---

    Part 3: Functions

    Introduction

    In the study of discrete mathematics, the concept of a function is of paramount importance. A function serves as a fundamental mechanism for formally describing a relationship between two sets, where each element of the first set is associated with exactly one element of the second. This simple yet powerful idea forms the bedrock upon which more complex structures in computer science are built, including data structures, algorithms, computability theory, and formal languages.

    For the GATE examination, a robust understanding of functions is not merely a prerequisite for this topic alone; it is intrinsically linked to the study of relations, set theory, and counting principles. We will explore the formal definition of a function, classify functions based on their mapping propertiesβ€”namely injectivity, surjectivity, and bijectivityβ€”and investigate the composition of functions. Mastery of these concepts is essential for solving a significant class of problems that frequently appear in the examination, often requiring the application of function properties to arguments about set cardinalities.

    πŸ“– Function

    A function ff from a non-empty set AA to a non-empty set BB, denoted as f:Aβ†’Bf: A \to B, is a rule that assigns to each element a∈Aa \in A exactly one element b∈Bb \in B. The set AA is called the domain of the function, and the set BB is called the codomain.

    We write f(a)=bf(a) = b to denote that bb is the unique element in BB assigned by ff to the element a∈Aa \in A.

    ---

    Key Concepts

    1. Domain, Codomain, Range, and Image

    While the domain and codomain define the function's scope, the concepts of image and range describe its actual output.

    • Domain (AA): The set of all possible inputs to the function.
    • Codomain (BB): The set of all possible outputs, as declared in the function's definition.
    • Image: The image of an element a∈Aa \in A under ff is the output element f(a)∈Bf(a) \in B.
    • Range (or Image of ff): The set of all actual output values produced by the function. The range of ff is a subset of the codomain BB, denoted as f(A)f(A) or Range⁑(f)\operatorname{Range}(f). Formally, Range⁑(f)={b∈Bβˆ£βˆƒa∈A,f(a)=b}\operatorname{Range}(f) = \{b \in B \mid \exists a \in A, f(a) = b\}.
    We observe that the range is always a subset of the codomain, i.e., Range⁑(f)βŠ†B\operatorname{Range}(f) \subseteq B.




    Domain (A)

    a1

    a2

    a3


    Codomain (B)

    Range


    b1

    b2

    b3

    b4










    In the diagram, f(a1)=b1f(a_1) = b_1, f(a2)=b2f(a_2) = b_2, and f(a3)=b1f(a_3) = b_1. The domain is {a1,a2,a3}\{a_1, a_2, a_3\}. The codomain is {b1,b2,b3,b4}\{b_1, b_2, b_3, b_4\}. The range is {b1,b2}\{b_1, b_2\}, which is a proper subset of the codomain.

    ---

    2. Types of Functions

    The properties of the mapping give rise to a critical classification of functions.

    Injective (One-to-One) Function

    A function is injective if distinct elements in the domain map to distinct elements in the codomain.

    πŸ“– Injective Function

    A function f:Aβ†’Bf: A \to B is injective (or one-to-one) if for every a1,a2∈Aa_1, a_2 \in A, the following implication holds:

    f(a1)=f(a2)β€…β€ŠβŸΉβ€…β€Ša1=a2f(a_1) = f(a_2) \implies a_1 = a_2

    Equivalently, its contrapositive form is often useful: a1β‰ a2β€…β€ŠβŸΉβ€…β€Šf(a1)β‰ f(a2)a_1 \neq a_2 \implies f(a_1) \neq f(a_2).

    For finite sets, an injection from AA to BB can only exist if the number of elements in the domain is less than or equal to the number of elements in the codomain.

    Surjective (Onto) Function

    A function is surjective if every element in the codomain is an image of at least one element from the domain.

    πŸ“– Surjective Function

    A function f:Aβ†’Bf: A \to B is surjective (or onto) if for every b∈Bb \in B, there exists at least one a∈Aa \in A such that f(a)=bf(a) = b.
    This is equivalent to stating that the range of the function is equal to its codomain: Range⁑(f)=B\operatorname{Range}(f) = B.

    For finite sets, a surjection from AA to BB can only exist if the number of elements in the domain is greater than or equal to the number of elements in the codomain.

    Bijective Function

    A function is bijective if it is both injective and surjective.

    πŸ“– Bijective Function

    A function f:A→Bf: A \to B is bijective if it is both injective and surjective. This means every element in the codomain is mapped to by exactly one element from the domain.

    A bijection establishes a perfect one-to-one correspondence between the elements of two sets.




    Injective (Not Surjective)








    Surjective (Not Injective)







    Bijective












    ---

    3. Cardinality and Functions

    For finite sets, the existence of certain types of functions imposes constraints on their cardinalities. These rules are fundamental for solving many GATE problems.

    ❗ Must Remember

    Let AA and BB be two finite sets.

    • If there exists an injective function f:Aβ†’Bf: A \to B, then it must be that ∣Aβˆ£β‰€βˆ£B∣|A| \le |B|.

    • If there exists a surjective function f:Aβ†’Bf: A \to B, then it must be that ∣A∣β‰₯∣B∣|A| \ge |B|.

    • If there exists a bijective function f:Aβ†’Bf: A \to B, then it must be that ∣A∣=∣B∣|A| = |B|.

    Furthermore, we can count the number of functions between two finite sets.

    πŸ“ Number of Functions

    The total number of functions from a finite set AA to a finite set BB is given by:

    N=∣B∣∣A∣N = |B|^{|A|}

    Variables:

      • ∣A∣|A| = Cardinality of the domain

      • ∣B∣|B| = Cardinality of the codomain


    When to use: This formula is used when asked to find the total possible mappings from one finite set to another, which is a common scenario in combinatorial problems related to functions (as seen in PYQ 3).

    Worked Example:

    Problem: Let SAS_A be the set of all functions from A={1,2,3}A = \{1, 2, 3\} to B={0,1}B = \{0, 1\}. Let SBS_B be the set of all 2Γ—22 \times 2 binary matrices. Does a bijection exist between SAS_A and SBS_B?

    Solution:

    Step 1: Calculate the cardinality of the set SAS_A.
    The domain is AA with ∣A∣=3|A|=3. The codomain is BB with ∣B∣=2|B|=2. The number of functions from AA to BB is ∣B∣∣A∣|B|^{|A|}.

    ∣SA∣=23=8|S_A| = 2^3 = 8

    Step 2: Calculate the cardinality of the set SBS_B.
    A 2Γ—22 \times 2 binary matrix has 2Γ—2=42 \times 2 = 4 entries. Each entry can be either 0 or 1 (2 choices).

    ∣SB∣=22Γ—2=24=16|S_B| = 2^{2 \times 2} = 2^4 = 16

    Step 3: Compare the cardinalities to determine if a bijection can exist.
    A bijection between two finite sets can only exist if their cardinalities are equal.

    ∣SA∣=8|S_A| = 8
    ∣SB∣=16|S_B| = 16

    Since ∣SAβˆ£β‰ βˆ£SB∣|S_A| \neq |S_B|, no bijection can exist between SAS_A and SBS_B.

    Answer: No,Β aΒ bijectionΒ doesΒ notΒ exist.\boxed{\text{No, a bijection does not exist.}}

    ---

    ---

    4. Composition of Functions

    We can combine functions to create new ones through an operation called composition.

    πŸ“– Function Composition

    Let f:Aβ†’Bf: A \to B and g:Bβ†’Cg: B \to C be two functions. The composition of gg and ff, denoted g∘fg \circ f (read "g composed with f"), is a function from AA to CC defined by:

    (g∘f)(a)=g(f(a)) for all a∈A(g \circ f)(a) = g(f(a)) \text{ for all } a \in A

    The output of ff becomes the input to gg.

    The properties of a composite function depend on the properties of its constituent functions. These relationships are frequently tested in GATE.

    ❗ Properties of Function Composition

    Let f:A→Bf: A \to B and g:B→Cg: B \to C be two functions.

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

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

    • If g∘fg \circ f is injective, then ff must be injective. (gg is not necessarily injective).

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

    Worked Example:

    Problem: Let f:Zβ†’Zf: \mathbb{Z} \to \mathbb{Z} be defined by f(x)=x+1f(x) = x+1, and g:Zβ†’Zg: \mathbb{Z} \to \mathbb{Z} be defined by g(x)=2xg(x) = 2x. Is the composite function f∘gf \circ g surjective? Is g∘fg \circ f surjective?

    Solution:

    Part 1: Analyze f∘gf \circ g

    Step 1: Define the composite function f∘gf \circ g.

    (f∘g)(x)=f(g(x))=f(2x)=2x+1(f \circ g)(x) = f(g(x)) = f(2x) = 2x + 1

    Step 2: Check for surjectivity.
    A function is surjective if its range equals its codomain (Z\mathbb{Z}). The range of (f∘g)(x)=2x+1(f \circ g)(x) = 2x+1 consists of all odd integers.

    Range⁑(f∘g)={…,βˆ’3,βˆ’1,1,3,… }\operatorname{Range}(f \circ g) = \{ \dots, -3, -1, 1, 3, \dots \}

    Step 3: Compare the range to the codomain.
    The range (all odd integers) is a proper subset of the codomain (all integers). For example, there is no integer xx such that 2x+1=22x+1 = 2. Therefore, the function is not surjective.

    Part 2: Analyze g∘fg \circ f

    Step 1: Define the composite function g∘fg \circ f.

    (g∘f)(x)=g(f(x))=g(x+1)=2(x+1)=2x+2(g \circ f)(x) = g(f(x)) = g(x+1) = 2(x+1) = 2x + 2

    Step 2: Check for surjectivity.
    The range of (g∘f)(x)=2x+2(g \circ f)(x) = 2x+2 consists of all even integers.

    Range⁑(g∘f)={…,βˆ’4,βˆ’2,0,2,4,… }\operatorname{Range}(g \circ f) = \{ \dots, -4, -2, 0, 2, 4, \dots \}

    Step 3: Compare the range to the codomain.
    The range (all even integers) is a proper subset of the codomain (all integers). For example, there is no integer xx such that 2x+2=32x+2 = 3. Therefore, this function is also not surjective.

    Answer: Neither f∘gf \circ g nor g∘fg \circ f is surjective.

    ---

    Problem-Solving Strategies

    πŸ’‘ GATE Strategy: Cardinality First

    When a question asks about the existence of an injection, surjection, or bijection between two finite sets (which might be described in complex ways, e.g., sets of matrices or sets of functions), the first and most efficient step is to calculate the cardinalities of the two sets.

      • If ∣Aβˆ£β‰ βˆ£B∣|A| \neq |B|, a bijection is impossible.
      • If ∣A∣>∣B∣|A| > |B|, an injection is impossible.
      • If ∣A∣<∣B∣|A| < |B|, a surjection is impossible.
    This approach can often answer the question or eliminate several options immediately without needing to reason about the functions themselves.

    ---

    Common Mistakes

    ⚠️ Avoid These Errors
      • ❌ Confusing Codomain and Range: Students often assume the range is the entire codomain. A function is only surjective if this is true. Always distinguish between the set of potential outputs (codomain) and the set of actual outputs (range).
      • ❌ Incorrectly Applying Composition Properties: A common error is to assume that if g∘fg \circ f is surjective, then ff must also be surjective. This is false.
    - βœ… Correct Logic: If g∘f:Aβ†’Cg \circ f: A \to C is surjective, it means for every c∈Cc \in C, there is an a∈Aa \in A such that g(f(a))=cg(f(a)) = c. This guarantees that gg covers all of CC. However, ff might not cover all of its codomain BB. It only needs to cover the part of BB that gg maps to CC.
      • ❌ Assuming Existence from Cardinality: While ∣Aβˆ£β‰€βˆ£B∣|A| \le |B| is a necessary condition for an injection to exist between finite sets, it does not describe the property of a given function. A specific function f:Aβ†’Bf: A \to B where ∣Aβˆ£β‰€βˆ£B∣|A| \le |B| is not automatically injective. You must check its definition.

    ---

    Practice Questions

    :::question type="MCQ" question="Let f:Aβ†’Bf: A \to B and g:Bβ†’Cg: B \to C be functions. If their composition g∘f:Aβ†’Cg \circ f: A \to C is an injective function, which of the following must be true?" options=["ff is injective.", "gg is injective.", "ff is surjective.", "gg is surjective."] answer="ff is injective." hint="Consider the definition of injectivity for the composite function:

    (g∘f)(a1)=(g∘f)(a2)β€…β€ŠβŸΉβ€…β€Ša1=a2(g \circ f)(a_1) = (g \circ f)(a_2) \implies a_1 = a_2
    . What does this imply about f(a1)f(a_1) and f(a2)f(a_2)?" solution="
    Step 1: State the premise.
    We are given that g∘fg \circ f is injective. This means that for any a1,a2∈Aa_1, a_2 \in A:
    (g∘f)(a1)=(g∘f)(a2)β€…β€ŠβŸΉβ€…β€Ša1=a2(g \circ f)(a_1) = (g \circ f)(a_2) \implies a_1 = a_2

    Step 2: Expand the definition of composition.

    g(f(a1))=g(f(a2))β€…β€ŠβŸΉβ€…β€Ša1=a2g(f(a_1)) = g(f(a_2)) \implies a_1 = a_2

    Step 3: Analyze the implication for function ff.
    We want to prove that ff is injective. To do this, we must show that

    f(a1)=f(a2)β€…β€ŠβŸΉβ€…β€Ša1=a2f(a_1) = f(a_2) \implies a_1 = a_2
    .
    Let us assume
    f(a1)=f(a2)f(a_1) = f(a_2)
    .

    Step 4: Apply function gg to both sides.
    If f(a1)=f(a2)f(a_1) = f(a_2), then applying the function gg to these equal elements must yield an equal result:

    g(f(a1))=g(f(a2))g(f(a_1)) = g(f(a_2))

    Step 5: Use the premise from Step 2.
    From our premise, we know that if

    g(f(a1))=g(f(a2))g(f(a_1)) = g(f(a_2))
    , it must follow that
    a1=a2a_1 = a_2
    .

    Step 6: Conclude the proof for ff.
    We have successfully shown that assuming

    f(a1)=f(a2)f(a_1) = f(a_2)
    leads to the conclusion
    a1=a2a_1 = a_2
    . This is precisely the definition of an injective function. Therefore, ff must be injective.

    (Note: gg is not necessarily injective. Consider A={1},B={2,3},C={4}A=\{1\}, B=\{2,3\}, C=\{4\}, with f(1)=2f(1)=2 and g(2)=4,g(3)=4g(2)=4, g(3)=4. Here g∘fg \circ f is injective, but gg is not.)
    "
    :::

    :::question type="NAT" question="Let P(S)P(S) denote the power set of a set SS. Let AA be a finite set. A bijective function exists from P(A)P(A) to the set B={1,2,3,…,1024}B = \{1, 2, 3, \dots, 1024\}. What is the cardinality of set AA?" answer="10" hint="Recall the formula for the cardinality of a power set. A bijection implies that the domain and codomain have equal cardinality." solution="
    Step 1: Understand the relationship between bijection and cardinality.
    The existence of a bijective function from a set S1S_1 to a set S2S_2 implies that their cardinalities are equal, i.e., ∣S1∣=∣S2∣|S_1| = |S_2|.

    Step 2: Identify the sets and their cardinalities.
    The domain is P(A)P(A), the power set of AA. The codomain is B={1,2,3,…,1024}B = \{1, 2, 3, \dots, 1024\}.
    The cardinality of the codomain is ∣B∣=1024|B| = 1024.

    Step 3: Use the bijection property to equate cardinalities.

    ∣P(A)∣=∣B∣=1024|P(A)| = |B| = 1024

    Step 4: Use the formula for the cardinality of a power set.
    The cardinality of the power set of a set SS with ∣S∣=n|S|=n is given by ∣P(S)∣=2n|P(S)| = 2^n. Let ∣A∣=k|A| = k.

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

    Step 5: Solve for ∣A∣|A|.
    We have the equation:

    2k=10242^k = 1024

    We recognize that 10241024 is a power of 2.

    2k=2102^k = 2^{10}

    Therefore,

    k=10k = 10
    .

    Result:
    The cardinality of set AA is 10.
    "
    :::

    :::question type="MSQ" question="Let A={1,2,3}A = \{1, 2, 3\} and B={a,b,c,d}B = \{a, b, c, d\}. Let SS be the set of all functions from AA to BB. Which of the following statements is/are correct?" options=["The total number of functions in SS is 81.", "No function in SS can be surjective.", "There exists at least one function in SS that is injective.", "The total number of functions in SS is 64."] answer="No function in SS can be surjective.,There exists at least one function in SS that is injective.,The total number of functions in SS is 64." hint="First, calculate the cardinalities of AA and BB. Then, apply the cardinality rules for the existence of injections and surjections. Use the formula for the total number of functions." solution="
    Statement 1 & 4: Total number of functions
    The number of functions from a set AA to a set BB is ∣B∣∣A∣|B|^{|A|}.
    Here, ∣A∣=3|A| = 3 and ∣B∣=4|B| = 4.
    Total functions = 43=644^3 = 64.
    Therefore, "The total number of functions in SS is 64" is correct, and "The total number of functions in SS is 81" is incorrect.

    Statement 2: Surjective functions
    For a surjective function from AA to BB to exist, we must have ∣A∣β‰₯∣B∣|A| \ge |B|.
    Here, ∣A∣=3|A| = 3 and ∣B∣=4|B| = 4. Since 3<43 < 4, it is not possible to create a surjective function from AA to BB. The range of any function from AA can have at most 3 elements, but the codomain BB has 4 elements. Thus, the range can never equal the codomain.
    Therefore, "No function in SS can be surjective" is correct.

    Statement 3: Injective functions
    For an injective function from AA to BB to exist, we must have ∣Aβˆ£β‰€βˆ£B∣|A| \le |B|.
    Here, ∣A∣=3|A| = 3 and ∣B∣=4|B| = 4. Since 3≀43 \le 4, an injective function can exist.
    For example, we can define f(1)=a,f(2)=b,f(3)=cf(1)=a, f(2)=b, f(3)=c. This is a valid injective function as distinct elements in AA map to distinct elements in BB.
    Therefore, "There exists at least one function in SS that is injective" is correct.

    The correct options are the ones stating that the total number of functions is 64, no function can be surjective, and at least one injective function exists.
    "
    :::

    ---

    Summary

    ❗ Key Takeaways for GATE

    • Function Types are Defined by Mapping: A function is injective (one-to-one) if no two inputs map to the same output. It is surjective (onto) if every element in the codomain is an output. It is bijective if it is both.

    • Cardinality Rules are Crucial: For finite sets AA and BB, an injection f:Aβ†’Bf: A \to B implies ∣Aβˆ£β‰€βˆ£B∣|A| \le |B|, a surjection implies ∣A∣β‰₯∣B∣|A| \ge |B|, and a bijection implies ∣A∣=∣B∣|A| = |B|. These rules are powerful shortcuts for problem-solving.

    • Master Composition Properties: Understand the implications of composite functions. If g∘fg \circ f is surjective, then gg must be surjective. If g∘fg \circ f is injective, then ff must be injective. Memorize these one-way implications as they are frequently tested.

    • Know How to Count Functions: The total number of functions from set AA to set BB is ∣B∣∣A∣|B|^{|A|}. This is fundamental for combinatorial problems involving functions.

    ---

    ---

    What's Next?

    πŸ’‘ Continue Learning

    This topic provides a foundation for several other areas in Discrete Mathematics.

      • Relations: A function is a specific type of binary relation where every element in the domain is related to exactly one element in the codomain. Understanding functions helps clarify the properties of more general relations.
      • Group Theory: Bijections from a set to itself, known as permutations, form a group under the operation of function composition. The study of bijective functions is central to abstract algebra.
      • Combinatorics: Counting the number of injective, surjective, and bijective functions are classic combinatorial problems that build directly upon the definitions learned here.
    Master these connections to build a comprehensive and interconnected understanding for the GATE examination.

    ---

    πŸ’‘ Moving Forward

    Now that you understand Functions, let's explore Partial Orders and Lattices which builds on these concepts.

    ---

    Part 4: Partial Orders and Lattices

    Introduction

    In our study of discrete mathematical structures, relations form a fundamental building block. While equivalence relations partition a set into disjoint classes, another class of relations, known as partial orders, imposes a hierarchical structure. Partial orders allow us to compare elements of a set in a way that captures notions of precedence, containment, or hierarchy, without requiring that every pair of elements be comparable. This is a natural generalization of the familiar "less than or equal to" relation on numbers.

    This chapter introduces the formal definition of a partially ordered set (poset) and its standard graphical representation, the Hasse diagram. We will then explore key concepts within posets, such as bounds, maximal and minimal elements, which culminate in the definition of a lattice. A lattice is a special type of poset with a highly regular structure, ensuring that any two elements have a unique least upper bound and a unique greatest lower bound. Though not frequently tested in GATE, a firm grasp of these concepts is essential for a complete understanding of discrete structures.

    πŸ“– Partially Ordered Set (Poset)

    A relation RR on a set SS is a partial order if it is reflexive, antisymmetric, and transitive. A set SS together with a partial order RR is called a partially ordered set, or poset, and is denoted by (S,R)(S, R) or (S,βͺ―)(S, \preceq), where βͺ―\preceq is a generic symbol for a partial order relation.

      • Reflexive: For all a∈Sa \in S, (a,a)∈R(a, a) \in R, or aβͺ―aa \preceq a.
      • Antisymmetric: For all a,b∈Sa, b \in S, if (a,b)∈R(a, b) \in R and (b,a)∈R(b, a) \in R, then a=ba = b. (If aβͺ―ba \preceq b and bβͺ―ab \preceq a, then a=ba = b).
      • Transitive: For all a,b,c∈Sa, b, c \in S, if (a,b)∈R(a, b) \in R and (b,c)∈R(b, c) \in R, then (a,c)∈R(a, c) \in R. (If aβͺ―ba \preceq b and bβͺ―cb \preceq c, then aβͺ―ca \preceq c).

    ---

    Key Concepts

    1. Hasse Diagrams

    A finite poset can be represented by a directed graph. However, this graph often contains redundant information. A Hasse diagram is a simplified graphical representation that captures the essential structure of a finite poset.

    To construct a Hasse diagram for a poset (S,βͺ―)(S, \preceq):

  • Start with the directed graph of the relation.

  • Remove all self-loops, as reflexivity is assumed for any poset.

  • Remove all transitive edges. An edge (a,c)(a, c) is transitive if there exists an element bb such that aβͺ―ba \preceq b and bβͺ―cb \preceq c. We only keep the "covering" relations.

  • Arrange the vertices such that all edges point upwards. This allows us to remove the arrowheads from the edges, as the direction is implied by the vertical placement.
  • The resulting graph, with vertices as points and covering relations as lines, is the Hasse diagram.

    Worked Example:

    Problem: Let S={1,2,3,4,6,12}S = \{1, 2, 3, 4, 6, 12\} and let the relation be divisibility, denoted by '∣\mid'. Draw the Hasse diagram for the poset (S,∣)(S, \mid).

    Solution:

    Step 1: Verify that (S,∣)(S, \mid) is a poset.

    • Reflexivity: a∣aa \mid a for any integer aa. (True)

    • Antisymmetry: If a∣ba \mid b and b∣ab \mid a, then a=ba = b for positive integers a,ba, b. (True)

    • Transitivity: If a∣ba \mid b and b∣cb \mid c, then a∣ca \mid c. (True)

    Thus, (S,∣)(S, \mid) is a poset.

    Step 2: Identify the covering relations.
    We draw an edge from aa to bb if a∣ba \mid b and there is no cc (where cβ‰ a,cβ‰ bc \neq a, c \neq b) such that a∣ca \mid c and c∣bc \mid b.

    • 1 covers 2, 3.

    • 2 covers 4, 6.

    • 3 covers 6.

    • 4 covers 12.

    • 6 covers 12.


    Step 3: Draw the Hasse diagram.
    Place the elements at different levels. The "smaller" elements (divisors) are at the bottom.





    1


    2


    3


    4


    6


    12









    Answer: The diagram above is the Hasse diagram for the poset (S,∣)(S, \mid).

    ---

    2. Bounds and Lattices

    Within a poset, we can analyze the relationship between elements of a subset. This leads to the concepts of upper and lower bounds.

    πŸ“– Bounds in a Poset

    Let (S,βͺ―)(S, \preceq) be a poset and let AA be a subset of SS.

      • An element u∈Su \in S is an upper bound of AA if aβͺ―ua \preceq u for all a∈Aa \in A.
      • An element l∈Sl \in S is a lower bound of AA if lβͺ―al \preceq a for all a∈Aa \in A.
      • An element x∈Sx \in S is the least upper bound (lub) or supremum of AA if xx is an upper bound of AA, and for any other upper bound yy of AA, we have xβͺ―yx \preceq y.
      • An element z∈Sz \in S is the greatest lower bound (glb) or infimum of AA if zz is a lower bound of AA, and for any other lower bound ww of AA, we have wβͺ―zw \preceq z.

    The lub and glb, if they exist, are unique. The existence of a unique lub and glb for every pair of elements gives a poset a special structure, which we define as a lattice.

    πŸ“ Lattice

    A poset (L,βͺ―)(L, \preceq) is called a lattice if for every pair of elements a,b∈La, b \in L, both the least upper bound (lub) and the greatest lower bound (glb) exist in LL.

    The lub of {a,b}\{a, b\} is often denoted by a∨ba \lor b (join).
    The glb of {a,b}\{a, b\} is often denoted by a∧ba \land b (meet).

    When to use: To determine if a given poset is a lattice, one must check if every possible pair of elements has a well-defined meet and join within the poset.

    In the Hasse diagram for (S={1,2,3,4,6,12},∣)(S=\{1, 2, 3, 4, 6, 12\}, \mid), consider the subset A={4,6}A = \{4, 6\}.

    • The upper bounds are elements that are multiples of both 4 and 6. In SS, only 12 is a multiple of both. So, the set of upper bounds is {12}\{12\}. The lub is therefore 12.

    • The lower bounds are elements that divide both 4 and 6. In SS, these are 1 and 2. The set of lower bounds is {1,2}\{1, 2\}. The greatest among these is 2. The glb is therefore 2.

    Since every pair in this poset has a unique lub and glb, (S,∣)(S, \mid) is a lattice.

    ---

    ---

    Problem-Solving Strategies

    πŸ’‘ GATE Strategy: Checking for a Lattice

    For a finite poset represented by a Hasse diagram, to quickly check if it is a lattice, you do not need to test every single pair of elements. Instead, focus on pairs that are "incomparable" (neither aβͺ―ba \preceq b nor bβͺ―ab \preceq a).

    • Identify all pairs of incomparable elements. For example, in the diagram above, {2,3}\{2, 3\} and {4,3}\{4, 3\} are incomparable pairs.

    • For each such pair, find their set of common upper bounds and common lower bounds by visually tracing paths upwards and downwards in the Hasse diagram.

    • Verify that each of these sets has a unique least element (for upper bounds) and a unique greatest element (for lower bounds).

    • If this condition holds for all incomparable pairs, the poset is a lattice. If you find even one pair that lacks a unique lub or glb, it is not a lattice.

    ---

    Common Mistakes

    ⚠️ Avoid These Errors
      • ❌ Confusing Maximal/Minimal with Greatest/Least: A maximal element has no element "above" it. A greatest element is "above" all other elements. A poset can have multiple maximal elements but at most one greatest element.
    βœ… Correct: The greatest element (if it exists) is the unique maximal element. Minimal and least elements have a similar relationship. In our example Hasse diagram, 12 is both maximal and greatest. 1 is both minimal and least.
      • ❌ Assuming any Poset is a Lattice: Not every poset is a lattice. The existence of a lub and glb for every pair is a strong condition.
    βœ… Correct: Always verify the lub/glb condition for pairs of incomparable elements. For example, a poset with a Hasse diagram shaped like the letter 'N' is not a lattice because the two middle elements have no lub.

    ---

    Practice Questions

    :::question type="MCQ" question="Let S={a,b,c}S = \{a, b, c\}. Which of the following relations on the power set P(S)P(S) is a partial order but NOT a total order?" options=["Set Equality (=)","Set Intersection (∩\cap)","Set Union (βˆͺ\cup)","Set Subset (βŠ†\subseteq)"] answer="Set Subset (βŠ†\subseteq)" hint="A total order requires every pair of elements to be comparable. Consider two sets like {a}\{a\} and {b}\{b\} from P(S)P(S) and check if they are comparable under the given relations." solution="Let us analyze the options for the poset (P(S),R)(P(S), R).

  • Set Equality (=): This is an equivalence relation, not a partial order (it is not antisymmetric in the general sense required for ordering distinct elements).

  • Set Intersection (∩\cap): This is an operation, not a relation of the required form.

  • Set Union (βˆͺ\cup): This is also an operation.

  • Set Subset (βŠ†\subseteq):

  • - Reflexive: AβŠ†AA \subseteq A for any set AA. (True)
    - Antisymmetric: If AβŠ†BA \subseteq B and BβŠ†AB \subseteq A, then A=BA = B. (True)
    - Transitive: If AβŠ†BA \subseteq B and BβŠ†CB \subseteq C, then AβŠ†CA \subseteq C. (True)
    Therefore, (P(S),βŠ†)(P(S), \subseteq) is a poset.

    Is it a total order? A total order requires that for any two elements X,Y∈P(S)X, Y \in P(S), either XβŠ†YX \subseteq Y or YβŠ†XY \subseteq X. Consider X={a}X = \{a\} and Y={b}Y = \{b\}. Neither {a}βŠ†{b}\{a\} \subseteq \{b\} nor {b}βŠ†{a}\{b\} \subseteq \{a\} is true. Thus, the elements are incomparable, and it is not a total order.

    Hence, set subset (βŠ†\subseteq) is the correct answer."
    :::

    :::question type="NAT" question="Consider the set D30={1,2,3,5,6,10,15,30}D_{30} = \{1, 2, 3, 5, 6, 10, 15, 30\} with the partial order of divisibility. What is the greatest lower bound (glb) of the set {10,15}\{10, 15\}?" answer="5" hint="The glb of two numbers under the divisibility relation is their greatest common divisor (GCD)." solution="
    Step 1: Identify the poset and the subset.
    The poset is (D30,∣)(D_{30}, \mid), where D30D_{30} is the set of divisors of 30. The subset is A={10,15}A = \{10, 15\}.

    Step 2: Find the set of all lower bounds of AA.
    A lower bound ll must satisfy l∣10l \mid 10 and l∣15l \mid 15. In other words, we are looking for the common divisors of 10 and 15.
    Divisors of 10 are {1,2,5,10}\{1, 2, 5, 10\}.
    Divisors of 15 are {1,3,5,15}\{1, 3, 5, 15\}.
    The set of common divisors (lower bounds) is {1,5}\{1, 5\}.

    Step 3: Find the greatest element in the set of lower bounds.
    The set of lower bounds is {1,5}\{1, 5\}. The greatest element in this set under the divisibility relation (or standard ≀\le) is 5.

    Result:
    Answer: \boxed{5}
    "
    :::

    :::question type="MSQ" question="Let (S,βͺ―)(S, \preceq) be the poset represented by the following Hasse diagram. The set is S={a,b,c,d,e,f}S = \{a, b, c, d, e, f\}. Which of the following statements are true?




    a

    b

    c

    d

    e

    f






    " options=["The poset has a unique minimal element.","The lub of {b,c}\{b, c\} is ff.","The poset is a lattice.","The element aa is the least element."] answer="The element aa is the least element.,The poset has a unique minimal element." hint="Analyze the structure of the diagram. A least element is one that is 'below' all others. For the lattice property, check if incomparable pairs like {d,e}\{d, e\} have a unique lub and glb." solution="
    Let's evaluate each statement:

  • The poset has a unique minimal element. A minimal element has no elements below it. In the diagram, only element 'a' has no incoming edges from below. Thus, 'a' is the unique minimal element. This statement is true.
  • The lub of {b,c}\{b, c\} is ff. The upper bounds of {b,c}\{b, c\} are elements that are reachable from both bb and cc by an upward path. Following the paths, we see that dd, ee, and ff are not upper bounds. In fact, there are no common upper bounds for {b,c}\{b, c\} in the diagram. This statement is false.
  • The poset is a lattice. A poset is a lattice if every pair of elements has a unique lub and a unique glb. Let's consider the pair {d,e}\{d, e\}. The upper bounds of {d,e}\{d, e\} must be above both. The only element above both dd and ee is ff. So, lub(d,e)=flub(d, e) = f. The lower bounds of {d,e}\{d, e\} must be below both. Following paths down from dd and ee, we find the common lower bounds are {b,c,a}\{b, c, a\}. The greatest elements in this set of lower bounds are bb and cc. Since there are two 'greatest' lower bounds (bb and cc are incomparable), there is no unique glb. Therefore, the poset is not a lattice. This statement is false.
  • The element aa is the least element. A least element must be related to every other element (i.e., aβͺ―xa \preceq x for all x∈Sx \in S). From the diagram, there is an upward path from 'a' to every other node. Thus, 'a' is the least element. This statement is true.

  • "
    :::

    ---

    Summary

    ❗ Key Takeaways for GATE

    • A Partially Ordered Set (Poset) is defined by a relation that is reflexive, antisymmetric, and transitive. This structure imposes a hierarchy without requiring all elements to be comparable.

    • A Hasse Diagram is a standard, simplified visualization of a finite poset, where direction is implied by vertical placement, and redundant (reflexive, transitive) edges are removed.

    • A Lattice is a special type of poset where every pair of elements {a,b}\{a, b\} has a unique Least Upper Bound (lub, or a∨ba \lor b) and a unique Greatest Lower Bound (glb, or a∧ba \land b). To verify if a poset is a lattice, check this condition for all pairs, especially the incomparable ones.

    ---

    What's Next?

    πŸ’‘ Continue Learning

    This topic provides foundational knowledge for more advanced structures in discrete mathematics.

      • Boolean Algebra: A Boolean algebra is a complemented, distributive lattice. Understanding lattices is the first step toward grasping the algebraic structure of logic and digital circuits.

      • Graph Theory: While Hasse diagrams are a specific type of graph, the general study of directed acyclic graphs (DAGs) shares many conceptual similarities with posets, particularly in scheduling and dependency analysis problems.


    Mastering the fundamentals of posets and lattices will provide a solid base for these related and more frequently tested GATE topics.

    ---

    Chapter Summary

    πŸ“– Set Theory, Relations, and Functions - Key Takeaways

    From our comprehensive study of sets, relations, and functions, we have established several core principles that are indispensable for the GATE examination. The following points encapsulate the most critical concepts to be mastered.

    • Set Cardinality and the Principle of Inclusion-Exclusion: A firm grasp of set operations is fundamental. For finite sets, we must be proficient in applying the Principle of Inclusion-Exclusion to determine the cardinality of the union of multiple sets, as this is a frequent source of numerical problems. The cardinality of a power set, ∣P(A)∣=2∣A∣|\mathcal{P}(A)| = 2^{|A|}, is another essential result.

    • Properties of Binary Relations: The ability to classify a binary relation is a primary skill. We must be able to systematically test a given relation for reflexivity, irreflexivity, symmetry, antisymmetry, and transitivity. These properties are the building blocks for the more complex structures that follow.

    • Equivalence Relations and Partitions: We have seen the profound connection between equivalence relations and partitions. An equivalence relation on a set SS partitions SS into disjoint equivalence classes. Conversely, any partition of SS defines a unique equivalence relation. Counting the number of possible equivalence relations on a finite set is a common advanced problem.

    • Partially Ordered Sets (Posets) and Hasse Diagrams: A relation that is reflexive, antisymmetric, and transitive defines a partial order. We must be adept at translating a poset on a finite set into its Hasse diagram and, from the diagram, identifying maximal, minimal, greatest, and least elements.

    • Lattices: A lattice is a special type of poset where every pair of elements has a unique least upper bound (join, ∨\vee) and a greatest lower bound (meet, ∧\wedge). We must be able to determine if a given poset constitutes a lattice. The power set lattice (P(S),βŠ†)(\mathcal{P}(S), \subseteq) is the canonical example, exhibiting properties of being both complemented and distributive.

    • Classification of Functions: The concepts of injective (one-to-one), surjective (onto), and bijective (one-to-one correspondence) functions are central. Many counting problems in discrete mathematics reduce to the problem of counting the number of functions of a certain type between two finite sets.

    ---

    Chapter Review Questions

    :::question type="MCQ" question="Let A={1,2,3,4}A = \{1, 2, 3, 4\} and let RR be a relation on AA defined as R={(x,y)∣x,y∈AΒ andΒ f(x)=f(y)}R = \{(x, y) \mid x, y \in A \text{ and } f(x) = f(y)\} for some function f:Aβ†’{a,b,c}f: A \to \{a, b, c\}. Which of the following statements about RR must be true, regardless of the choice of ff?" options=["RR is a partial order.","RR is an equivalence relation.","The number of ordered pairs in RR is at most 4.","RR is the identity relation, i.e., R={(1,1),(2,2),(3,3),(4,4)}.R = \{(1,1), (2,2), (3,3), (4,4)\}."] answer="B" hint="Test the properties of reflexivity, symmetry, and transitivity based on the definition f(x)=f(y)f(x) = f(y)." solution="
    The relation RR is defined on AA such that (x,y)∈R(x, y) \in R if and only if f(x)=f(y)f(x) = f(y). We must check the properties that hold for any function f:Aβ†’{a,b,c}f: A \to \{a, b, c\}.

  • Reflexivity: For any x∈Ax \in A, we have f(x)=f(x)f(x) = f(x). Therefore, (x,x)∈R(x, x) \in R for all x∈Ax \in A. The relation is reflexive.
  • Symmetry: Assume (x,y)∈R(x, y) \in R. By definition, this means f(x)=f(y)f(x) = f(y). Since equality is symmetric, this implies f(y)=f(x)f(y) = f(x). Therefore, (y,x)∈R(y, x) \in R. The relation is symmetric.
  • Transitivity: Assume (x,y)∈R(x, y) \in R and (y,z)∈R(y, z) \in R. By definition, f(x)=f(y)f(x) = f(y) and f(y)=f(z)f(y) = f(z). Since equality is transitive, this implies f(x)=f(z)f(x) = f(z). Therefore, (x,z)∈R(x, z) \in R. The relation is transitive.
  • Since RR is reflexive, symmetric, and transitive, it is an equivalence relation. This holds true for any function ff.

    Let us examine why the other options are not necessarily true:

    • A) RR is a partial order: A partial order must be antisymmetric. If we choose a function that is not injective, e.g., f(1)=af(1) = a and f(2)=af(2) = a, then (1,2)∈R(1, 2) \in R and (2,1)∈R(2, 1) \in R, but 1β‰ 21 \neq 2. Thus, RR is not necessarily antisymmetric.

    • C) The number of ordered pairs in RR is at most 4: If we choose a constant function, e.g., f(x)=af(x) = a for all x∈Ax \in A, then f(x)=f(y)f(x) = f(y) for all pairs (x,y)(x, y). In this case, R=AΓ—AR = A \times A, and ∣R∣=∣A∣2=42=16|R| = |A|^2 = 4^2 = 16. This is greater than 4.

    • D) RR is the identity relation: This only occurs if the function ff is injective (one-to-one). However, since ∣A∣=4|A|=4 and the codomain has size 3, by the Pigeonhole Principle, no injective function from AA to {a,b,c}\{a, b, c\} exists. Therefore, RR can never be the identity relation in this specific case.


    Thus, the only statement that must be true is that RR is an equivalence relation.
    "
    :::

    :::question type="NAT" question="Let AA be a set with 5 elements and BB be a set with 3 elements. The number of surjective (onto) functions from AA to BB is ______." answer="150" hint="Use the Principle of Inclusion-Exclusion. Start with the total number of functions and subtract those that are not onto." solution="
    Let ∣A∣=m=5|A| = m = 5 and ∣B∣=n=3|B| = n = 3.
    The total number of functions from AA to BB is nm=35n^m = 3^5.

    A function is surjective if every element in the codomain BB is mapped to by at least one element from the domain AA. We can count the number of surjective functions using the Principle of Inclusion-Exclusion.

    The formula for the number of surjective functions from a set of size mm to a set of size nn is:

    S(m,n)=βˆ‘k=0n(βˆ’1)k(nk)(nβˆ’k)mS(m, n) = \sum_{k=0}^{n} (-1)^k \binom{n}{k} (n-k)^m

    Here, m=5m=5 and n=3n=3.

    S(5,3)=(30)(3βˆ’0)5βˆ’(31)(3βˆ’1)5+(32)(3βˆ’2)5βˆ’(33)(3βˆ’3)5S(5, 3) = \binom{3}{0}(3-0)^5 - \binom{3}{1}(3-1)^5 + \binom{3}{2}(3-2)^5 - \binom{3}{3}(3-3)^5

    Let's calculate each term:

    • Term 1: (30)β‹…35=1β‹…243=243\binom{3}{0} \cdot 3^5 = 1 \cdot 243 = 243. (This is the total number of functions).

    • Term 2: (31)β‹…25=3β‹…32=96\binom{3}{1} \cdot 2^5 = 3 \cdot 32 = 96. (This subtracts functions that miss at least one specific element).

    • Term 3: (32)β‹…15=3β‹…1=3\binom{3}{2} \cdot 1^5 = 3 \cdot 1 = 3. (This adds back functions that miss at least two specific elements, as they were subtracted twice).

    • Term 4: (33)β‹…05=1β‹…0=0\binom{3}{3} \cdot 0^5 = 1 \cdot 0 = 0. (This subtracts functions that miss three elements, which is impossible).


    Combining these results:
    S(5,3)=243βˆ’96+3βˆ’0=150S(5, 3) = 243 - 96 + 3 - 0 = 150

    Therefore, the number of surjective functions from AA to BB is 150.
    Answer: \boxed{150}"
    :::

    :::question type="MCQ" question="Consider the set of divisors of 36, D36={1,2,3,4,6,9,12,18,36}D_{36} = \{1, 2, 3, 4, 6, 9, 12, 18, 36\}. Let the relation be 'divides', denoted by '∣\mid'. Which of the following statements about the poset (D36,∣)(D_{36}, \mid) is FALSE?" options=["The poset is a lattice.","The greatest lower bound of {12,18}\{12, 18\} is 6.","The least upper bound of {4,9}\{4, 9\} is 36.","The element 2 is a minimal element."] answer="D" hint="Recall the definitions of minimal element, GLB (meet), LUB (join), and lattice. A minimal element is one with no elements strictly smaller than it." solution="
    Let us analyze the poset (D36,∣)(D_{36}, \mid). The relation is divisibility.
    In this context:

    • The greatest lower bound (GLB) of two numbers is their greatest common divisor (GCD).

    • The least upper bound (LUB) of two numbers is their least common multiple (LCM).


    We will evaluate each statement:

    A) The poset is a lattice.
    For any pair of elements {a,b}\{a, b\} in D36D_{36}, their GCD and LCM must also be in D36D_{36}. Since all elements are divisors of 36, the GCD of any two elements will also be a divisor of 36. Similarly, the LCM of any two elements that are divisors of 36 will also be a divisor of 36. For example, LUB({12,18})=LCM(12,18)=36LUB(\{12, 18\}) = LCM(12, 18) = 36, which is in D36D_{36}. GLB({12,18})=GCD(12,18)=6GLB(\{12, 18\}) = GCD(12, 18) = 6, which is in D36D_{36}. This holds for all pairs. Therefore, the poset is a lattice. This statement is TRUE.

    B) The greatest lower bound of {12,18}\{12, 18\} is 6.
    GLB({12,18})=GCD(12,18)GLB(\{12, 18\}) = GCD(12, 18). The divisors of 12 are {1,2,3,4,6,12}\{1, 2, 3, 4, 6, 12\}. The divisors of 18 are {1,2,3,6,9,18}\{1, 2, 3, 6, 9, 18\}. The greatest common divisor is 6. This statement is TRUE.

    C) The least upper bound of {4,9}\{4, 9\} is 36.
    LUB({4,9})=LCM(4,9)LUB(\{4, 9\}) = LCM(4, 9). Since GCD(4,9)=1GCD(4, 9) = 1, the LCM(4,9)=4Γ—9=36LCM(4, 9) = 4 \times 9 = 36. This statement is TRUE.

    D) The element 2 is a minimal element.
    A minimal element is an element mm such that there is no other element xx in the set for which x∣mx \mid m and xβ‰ mx \neq m. In our set D36D_{36}, the element 1 is present. We have 1∣21 \mid 2 and 1β‰ 21 \neq 2. Therefore, 2 is not a minimal element. The only minimal element in this poset is 1, which is also the least element. This statement is FALSE.
    "
    :::

    :::question type="NAT" question="In a class, 40% of students enrolled for Mathematics, 70% enrolled for Computer Science. If 15% of the students enrolled for both Mathematics and Computer Science, and every student enrolled for at least one of the two subjects, what is the total number of students in the class if 35 students enrolled for Mathematics only?" answer="200" hint="Let the total number of students be NN. Express the number of students in each category as a percentage of NN and use the given absolute number to solve for NN." solution="
    Let MM be the set of students enrolled for Mathematics and CC be the set of students enrolled for Computer Science. Let the total number of students in the class be NN.

    From the problem statement, we have:

    • ∣M∣=0.40N|M| = 0.40 N

    • ∣C∣=0.70N|C| = 0.70 N

    • ∣M∩C∣=0.15N|M \cap C| = 0.15 N


    The number of students who enrolled for Mathematics only is given by ∣Mβˆ£βˆ’βˆ£M∩C∣|M| - |M \cap C|.
    We are given that this number is 35.
    So, we can set up the equation:
    ∣Mβˆ£βˆ’βˆ£M∩C∣=35|M| - |M \cap C| = 35

    Substituting the percentage values in terms of NN:
    0.40Nβˆ’0.15N=350.40 N - 0.15 N = 35

    0.25N=350.25 N = 35

    14N=35\frac{1}{4} N = 35

    N=35Γ—4N = 35 \times 4

    N=140N = 140

    The information that "every student enrolled for at least one" leads to ∣MβˆͺC∣=∣M∣+∣Cβˆ£βˆ’βˆ£M∩C∣=0.40N+0.70Nβˆ’0.15N=0.95N|M \cup C| = |M| + |C| - |M \cap C| = 0.40 N + 0.70 N - 0.15 N = 0.95 N. If every student enrolled for at least one, then ∣MβˆͺC∣=N|M \cup C| = N, which implies 0.95N=N0.95 N = N, or 0.05N=00.05 N = 0, meaning N=0N=0. This is a contradiction with the existence of 35 students. We proceed by assuming this clause is an error in the problem statement, as the rest of the data is consistent and allows for a unique solution for NN.

    The total number of students in the class is 140.
    Answer: \boxed{140}"
    :::

    ---

    What's Next?

    πŸ’‘ Continue Your GATE Journey

    Having completed this chapter on Set Theory, Relations, and Functions, we have established a firm foundation in discrete mathematics. The abstract structures and rigorous definitions discussed herein are not isolated topics; rather, they form the essential vocabulary for many advanced areas of computer science and engineering.

    Key connections to upcoming chapters include:

      • Graph Theory: A binary relation on a set can be directly visualized as a directed graph, where the elements of the set are vertices and the ordered pairs in the relation are edges. Properties like reflexivity (self-loops), symmetry (bidirectional edges), and transitivity find natural graphical interpretations.
      • Combinatorics and Probability: The counting techniques explored, particularly those involving functions and the Principle of Inclusion-Exclusion, are cornerstones of combinatorics. These skills are indispensable for solving problems in permutation, combination, and the calculation of probabilities in a discrete sample space.
      • Group Theory: The concept of a function is generalized to that of a binary operation, which is central to the study of algebraic structures like groups, rings, and fields. The properties of relations, such as associativity and the existence of identity and inverse elements, are formalized in this context.
      • Mathematical Logic: Set theory is the bedrock upon which formal logic is built. The set operations of union, intersection, and complement correspond directly to the logical operators OR (∨\lor), AND (∧\land), and NOT (Β¬\neg), respectively. This correspondence is formalized in the study of Boolean Algebra.
    As we proceed, we will find that the principles mastered in this chapter are constantly revisited and applied in these more specialized domains.

    🎯 Key Points to Remember

    • βœ“ Master the core concepts in Set Theory, Relations, and Functions before moving to advanced topics
    • βœ“ Practice with previous year questions to understand exam patterns
    • βœ“ Review short notes regularly for quick revision before exams

    Related Topics in Engineering Mathematics

    More Resources

    Why Choose MastersUp?

    🎯

    AI-Powered Plans

    Personalized study schedules based on your exam date and learning pace

    πŸ“š

    15,000+ Questions

    Verified questions with detailed solutions from past papers

    πŸ“Š

    Smart Analytics

    Track your progress with subject-wise performance insights

    πŸ”–

    Bookmark & Revise

    Save important questions for quick revision before exams

    Start Your Free Preparation β†’

    No credit card required β€’ Free forever for basic features