chapter
    Sets, Relations, Functions and Order Structures PYQs for GATE CS

    Solve 8+ Sets, Relations, Functions and Order Structures previous year questions for GATE CS with answers and detailed solutions. Free sample questions below.

    Try a question

    Answer it here to see how it works. Nothing is recorded until you sign in.

    Question 1
    2026 Slot Set2 PYQ
    Level 3: Exam Standard

    Let be a binary relation on the set , where if the product of and is square of an integer. Which of the following properties is/are satisfied by ?

    Question 2
    2025 Slot Set2 PYQ
    Level 3: Exam Standard
    Let be the set of all functions from to . Define the binary relation on as follows:

    if and only if , where .

    Which of the following statement(s) is/are TRUE?
    Question 3
    2025 Slot Set1 PYQ
    Level 3: Exam Standard
    is a function from to , is a function from to , and their composition defined as is a mapping from to .

    If and are onto (surjective) functions, which ONE of the following is TRUE about the function ?
    Question 4
    2024 Slot Set2 PYQ
    Level 3: Exam Standard

    Let be the partial order defined on the set as follows

    The number of total orders on that contain is __________

    Question 5
    2024 Slot Set1 PYQ
    Level 3: Exam Standard

    Let and be non-empty finite sets such that there exist one-to-one and onto functions (i) from to and (ii) from to . The number of possible values of is __________

    Question 6
    2023 PYQ
    Level 3: Exam Standard
    Let be an onto (or surjective) function, where and are nonempty sets. Define an equivalence relation on the set as


    where . Let be the set of all the equivalence classes under . Define a new mapping as



    Which of the following statements is/are TRUE?
    Question 7
    2021 Slot Set2 PYQ
    Level 3: Exam Standard
    Consider the following sets, where :

    : Set of all matrices with entries from the set
    : Set of all functions from the set to the set

    Which of the following choice(s) is/are correct?
    Question 8
    2021 Slot Set1 PYQ
    Level 3: Exam Standard
    A relation is said to be circular if and together imply .
    Which of the following options is/are correct?
    Free preview ends here

    Login to view the complete previous-year questions and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Sets, Relations, Functions and Order Structures PYQs for GATE CS

    Solve 8+ Sets, Relations, Functions and Order Structures previous year questions for GATE CS with answers and detailed solutions. Free sample questions below.

    Chapter Roadmap: Discrete Structures

    Chapter Roadmap

    Discrete Structures

    1. Function Properties, Composition & Cardinality

    Mapping elements, counting functions, and analyzing composed operations.

    2. Relation Properties & Equivalence Conditions

    Reflexivity, symmetry, transitivity, and the precise rules of equivalence.

    3. Equivalence Relations & Quotient Mappings

    Partitioning sets into equivalence classes and mapping them cleanly.

    4. Partial Orders, Linear Extensions & Lattices

    Hierarchies, Hasse diagrams, and finding bounds in ordered sets.

    Functions as Precise Machines

    Functions as Precise Machines

    A function is a specific type of relation that assigns exactly one element of to each element of .

    The Three Key Sets

    1. Domain (): The set of all valid inputs. Every element here must be mapped.
    2. Codomain (): The set of all possible outputs. It defines the boundaries of the function.
    3. Range (or Image): The set of actual outputs produced. It is always a subset of the codomain ().
    Mathematical Condition:
    If and , then .
    (An input cannot have multiple outputs).

    Sets, Relations, Functions and Order Structures: Solved Questions with Step-by-Step Explanations (8 Problems)

    Question 1 · Engineering Mathematics · 2026_Set2 MSQ

    Let be a binary relation on the set , where if the product of and is square of an integer. Which of the following properties is/are satisfied by ?

    1. A.

      Reflexive

    2. B.

      Symmetric

    3. C.

      Transitive

    4. D.

      Antisymmetric

    Correct Answer:

    ["A","B","C"]

    Step-by-Step Solution

    Key idea: This is a relation properties question, recognizable by the condition that the product of two elements is a perfect square.

    Step 1: Check Reflexivity. For any , , which is a perfect square. Thus, . Reflexive is TRUE.

    Step 2: Check Symmetry. If , then . Since multiplication is commutative, , so . Symmetric is TRUE.

    Step 3: Check Transitivity. Suppose and . Then and for some integers . We need to check if is a perfect square. Notice that . For to be an integer square, must divide . Let the prime factorization of have . Since , (where ). Similarly, (where ). We need . This is always true because if , then , which contradicts and . Thus, always divides , making an integer. Therefore, is always a perfect square. Transitive is TRUE.

    Step 4: Check Antisymmetry. since , and , but . Thus, it is NOT antisymmetric.

    Answer: Options A, B, and C.

    Question 2 · Engineering Mathematics · 2025_Set2 MSQ
    Let be the set of all functions from to . Define the binary relation on as follows:

    if and only if , where .

    Which of the following statement(s) is/are TRUE?
    1. A.

      is a symmetric relation

    2. B.

      is a partial order

    3. C.

      is a lattice

    4. D.

      is an equivalence relation

    Correct Answer:

    ["B","C"]

    Step-by-Step Solution

    Key idea: This is a poset and lattice identification question on a function space, recognizable by the pointwise ordering of functions.

    Step 1: Analyze the relation . iff for all .

    Step 2: Check if it's a partial order (Option B).

    • Reflexive: is true for all .
    • Antisymmetric: and for all .
    • Transitive: and .

    Thus, is a partial order. Option B is true.

    Step 3: Check if it's a lattice (Option C). For any , we can define the pointwise maximum and pointwise minimum . Since the codomain is , these are well-defined functions in and satisfy the properties of join and meet. Thus, it is a lattice. Option C is true.

    Step 4: Check symmetry (Option A) and equivalence (Option D). does not imply (e.g., ). So it's not symmetric, hence not an equivalence relation. Options A and D are false.

    Answer: Options B and C.

    Question 3 · Engineering Mathematics · 2025_Set1 MCQ
    is a function from to , is a function from to , and their composition defined as is a mapping from to .

    If and are onto (surjective) functions, which ONE of the following is TRUE about the function ?
    1. A.

      must be an onto (surjective) function.

    2. B.

      must be a one-to-one (injective) function.

    3. C.

      must be a bijective function, that is, both one-to-one and onto.

    4. D.

      is not required to be a one-to-one or onto function.

    Correct Answer:

    D

    Step-by-Step Solution

    Key idea: This is a function composition property question, recognizable by the given surjectivity of and .

    Step 1: Analyze the given conditions. We know is onto, and is onto.

    Step 2: Test if must be onto. Consider , , . Let and . Here, is onto and is onto, but is not onto (2 is not in the range of ). Thus, is not required to be onto.

    Step 3: Test if must be one-to-one. Consider , , . Let and . Here, is onto and is onto, but is not one-to-one.

    Step 4: Since is neither required to be onto nor one-to-one, Option D is the only necessarily true statement.

    Answer: Option D.

    Question 4 · Engineering Mathematics · 2024_Set2 NAT

    Let be the partial order defined on the set as follows

    The number of total orders on that contain is __________

    Correct Answer:

    5

    Step-by-Step Solution

    Key idea: This is a counting linear extensions question, recognizable by the request for the number of total orders containing a given partial order.

    Step 1: Identify the cover relations (dependencies) from . The non-reflexive pairs are , , and . This means in any valid total order, 1 must appear before 2, 3 must appear before 2, and 3 must appear before 4.

    Step 2: A valid total order (linear extension) is a permutation of that respects these dependencies.

    Step 3: The minimal elements (those with no prerequisites) are 1 and 3. So the sequence must start with either 1 or 3.

    Case 1: The sequence starts with 1. The remaining elements are . Since 3 must precede both 2 and 4, 3 must be the next element. The remaining elements have no dependencies between them, so they can be arranged in ways: and .

    Case 2: The sequence starts with 3. The remaining elements are . The only remaining dependency is . The number of valid permutations of 3 elements with one specific order constraint is . These are: , , and .

    Step 4: Total linear extensions = 2 (from Case 1) + 3 (from Case 2) = 5.

    Answer: 5.

    Question 5 · Engineering Mathematics · 2024_Set1 NAT

    Let and be non-empty finite sets such that there exist one-to-one and onto functions (i) from to and (ii) from to . The number of possible values of is __________

    Correct Answer:

    2

    Step-by-Step Solution

    Key idea: This is a cardinality and bijection constraint question, recognizable by the existence of bijections between Cartesian products and set unions.

    Step 1: Let and . Since there is a bijection from to , we must have , so .

    Step 2: Since there is a bijection from to , their cardinalities must be equal. Thus, .

    Step 3: We know . The size of the union is , where .

    Step 4: Since is a subset of , the intersection size must satisfy .

    Step 5: Equating the cardinalities gives , which means .

    Step 6: Apply the bounds on :

    From , we get . Since (non-empty), .

    From , we get . Since , this is always true.

    Step 7: The possible integer values for are 1 and 2.

    • If , (sets are identical).
    • If , (sets are disjoint).

    Both are valid. The number of possible values for is 2.

    Answer: 2.

    Question 6 · Engineering Mathematics · 2023 MSQ
    Let be an onto (or surjective) function, where and are nonempty sets. Define an equivalence relation on the set as


    where . Let be the set of all the equivalence classes under . Define a new mapping as



    Which of the following statements is/are TRUE?
    1. A.

      is NOT well-defined.

    2. B.

      is an onto (or surjective) function.

    3. C.

      is a one-to-one (or injective) function.

    4. D.

      is a bijective function.

    Correct Answer:

    ["B","C","D"]

    Step-by-Step Solution

    Key idea: This is a quotient mapping question, recognizable by the definition of an equivalence relation based on a function's output and the induced mapping on equivalence classes.

    Step 1: Check if is well-defined. Suppose . By the definition of the equivalence relation, this means , which implies . Therefore, . The output does not depend on the choice of representative, so is well-defined. Option A is FALSE.

    Step 2: Check if is onto. We are given that is onto. For any , there exists some such that . Then . Thus, is onto. Option B is TRUE.

    Step 3: Check if is one-to-one. Suppose . This means . By the definition of the equivalence relation, implies , which means . Thus, is one-to-one. Option C is TRUE.

    Step 4: Since is both one-to-one and onto, it is bijective. Option D is TRUE.

    Answer: Options B, C, and D.

    Question 7 · Engineering Mathematics · 2021_Set2 MSQ
    Consider the following sets, where :

    : Set of all matrices with entries from the set
    : Set of all functions from the set to the set

    Which of the following choice(s) is/are correct?
    1. A.

      There does not exist a bijection from to .

    2. B.

      There exists a surjection from to .

    3. C.

      There exists a bijection from to .

    4. D.

      There does not exist an injection from to .

    Correct Answer:

    ["B","C"]

    Step-by-Step Solution

    Key idea: This is a cardinality comparison question, recognizable by the need to compare the sizes of two differently described sets.

    Step 1: Calculate the cardinality of . An matrix has entries. Each entry can be independently chosen from the set , which has 3 elements. Thus, .

    Step 2: Calculate the cardinality of . The set of all functions from a domain of size to a codomain of size is . Here, the domain is , which has size . The codomain is , which has size 3. Thus, .

    Step 3: Compare the cardinalities. Since and both are finite sets, there exists a bijection between them.

    Step 4: Evaluate the options. Since a bijection exists, Option C is true. A bijection is also a surjection, so Option B is true. Options A and D are false because they claim a bijection or injection does not exist.

    Answer: Options B and C.

    Question 8 · Engineering Mathematics · 2021_Set1 MSQ
    A relation is said to be circular if and together imply .
    Which of the following options is/are correct?
    1. A.

      If a relation S is reflexive and symmetric, then S is an equivalence relation.

    2. B.

      If a relation S is circular and symmetric, then S is an equivalence relation.

    3. C.

      If a relation S is reflexive and circular, then S is an equivalence relation.

    4. D.

      If a relation S is transitive and circular, then S is an equivalence relation.

    Correct Answer:

    ["C"]

    Step-by-Step Solution

    Key idea: This is a relation property equivalence question, recognizable by the definition of a circular relation and the conditions for an equivalence relation.

    Step 1: Recall the definition of an equivalence relation: it must be reflexive, symmetric, and transitive.

    Step 2: Analyze Option A. Reflexive and symmetric do not guarantee transitive (e.g., a path of length 2 in a graph without the closing edge). False.

    Step 3: Analyze Option B. Circular and symmetric. Circular means . With symmetry, , so it is transitive. However, it lacks reflexivity (e.g., the empty relation on a non-empty set is circular and symmetric but not reflexive). False.

    Step 4: Analyze Option C. Reflexive and circular.

    • Symmetry: . Since reflexive, . By circularity, . So symmetric.
    • Transitivity: . By circularity, . By symmetry, . So transitive.

    Since it is reflexive, symmetric, and transitive, it is an equivalence relation. True.

    Step 5: Analyze Option D. Transitive and circular. Lacks reflexivity (e.g., the empty relation). False.

    Answer: Option C.

    More previous year questions (pyqs) in this unit