CSC165 Discrete Structure

Discrete StructureUnit 1010 min read

Relations & Closures: Types, Properties, and Applications

Unit 10 of Discrete Structure covers relations (reflexive, symmetric, transitive, equivalence), relation closures (reflexive, symmetric, transitive), Hasse diagrams, and partial orders, with emphasis on proofs, examples, and real-world applications like database design and network routing.

1. Introduction to Relations

1.1 Definition and Representation

A relation from set to set is a subset of the Cartesian product :

  • If , we write .
  • Representation methods:
    • Roster form: List of ordered pairs (e.g., ).
    • Matrix representation: Binary matrix where if , else .
    • Directed graph: Nodes = elements of , edges = ordered pairs.

Example: Let , . Matrix:

   1  2  3
1 [0,1,0]
2 [0,0,1]
3 [1,0,0]

1.2 Types of Relations on a Set (Binary Relations)

For a relation on , key properties:

Property Definition Example
Reflexive , is reflexive.
Irreflexive on .
Symmetric .
Antisymmetric .
Transitive .
Equivalence Reflexive, symmetric, and transitive. on .

Worked Example: Check if on is:

  • Not reflexive: Missing .
  • Symmetric: has , but lacks . False.
  • Transitive: and imply . False.

2. Relation Closures

Closures extend a relation to satisfy a property with minimal additions.

2.1 Reflexive Closure

Definition: Smallest reflexive relation containing . Method:

  1. Add all pairs for if missing.
  2. Formula: .

Example: Let , . Reflexive closure: .

2.2 Symmetric Closure

Definition: Smallest symmetric relation containing . Method:

  1. For every , add if not present.
  2. Formula: .

Example: Let . Symmetric closure: .

2.3 Transitive Closure

Definition: Smallest transitive relation containing . Methods:

  1. Warshall’s Algorithm (for matrix representation):
    • Initialize adjacency matrix of .
    • For to : .
  2. Graph-based: Add edges for all paths of length ≥2.

Example: Let on . Transitive closure: .

Worked Example: Find transitive closure of .

  • Add (via ).
  • Add (via ).
  • Final: .

3. Equivalence Relations and Partitions

3.1 Equivalence Relations

A relation is equivalence if it is reflexive, symmetric, and transitive.

  • Equivalence classes: For , .
  • Partition: Set of disjoint equivalence classes covers .

Example: Let , .

  • Equivalence classes: , .
  • Partition: .

3.2 Partial Orders

A relation is a partial order if:

  1. Reflexive.
  2. Antisymmetric.
  3. Transitive.
  • Hasse Diagram: Visual representation omitting reflexive/transitive edges.

Example: Let , "divides" relation.

  • Hasse Diagram:
        32
        |
        16
       /  \
      8    5
      |
      2
      |
      1
    
  • Elements:
    • Maximal: 32 (no element above it).
    • Minimal: 1 (no element below it).
    • Greatest: 32 (divides all others).
    • Least: 1 (divisible by all others).

4. Applications of Relations

Application Relation Type Example
Database Design Functional dependency (FD) where (e.g., SSN \rightarrow Name).
Network Routing Reachability if packet can go from to .
Social Networks Friendship (symmetric) if and are friends.
Equivalence Classes Partitioning data Grouping students by department.
Order Theory Partial orders File system hierarchies (directories/subdirectories).

5. Common Mistakes and Clarifications

  1. Confusing Symmetric/Antisymmetric:

    • Symmetric: .
    • Antisymmetric: .
    • Example: is symmetric but not antisymmetric.
  2. Transitive Closure Missteps:

    • Forgetting to add all implied pairs (e.g., missing in the earlier example).
    • Tip: Use Warshall’s algorithm for matrices to avoid omission.
  3. Equivalence vs. Partial Order:

    • Equivalence relations partition sets; partial orders define hierarchies.
    • Example: "Divides" is a partial order, but "congruence modulo " is an equivalence relation.
  4. Hasse Diagrams:

    • Only draw edges for direct relations (omit transitive edges).
    • Example: In the "divides" relation, is omitted if exists.

Exam Tip

What Examiners Look For

  1. Definitions:

    • Always state properties (reflexive/symmetric/transitive) before proving them.
    • Example: "To show is symmetric, we check: for all , ."
  2. Closure Problems:

    • Reflexive/Symmetric: List missing pairs explicitly.
    • Transitive: Use a table or graph to track implied pairs.
    • Example: For , write: "Since and are in , by transitivity, must be added."
  3. Equivalence Relations:

    • Partition the set and verify classes are disjoint and cover .
    • Example: For , write: "The equivalence classes are , which partitions ."
  4. Hasse Diagrams:

    • Draw the diagram neatly and label maximal/minimal/greatest/least elements.
    • Example: For the "divides" relation, explicitly state: "32 is the greatest element as it is related to all others."
  5. Recurrence Relations (from past papers):

    • Although this unit focuses on relations, recurrence relations (e.g., ) often appear in exams.
    • Solution Method:
      1. Find the characteristic equation (e.g., ).
      2. Solve for roots: (double root).
      3. General solution: .
      4. Use initial conditions to find and .
  6. Graph Theory Terms (Euler/Hamilton Paths):

    • Euler Path: Traverses every edge exactly once (exists if exactly 0 or 2 vertices have odd degree).
    • Hamilton Path: Visits every vertex exactly once (no simple degree condition; NP-hard to verify).
    • Example: In a cycle graph (), both Euler and Hamilton paths exist.

Mark Distribution Insights

  • Definitions (20%): 1-2 marks per property (reflexive/symmetric/transitive).
  • Proofs (30%): Structured steps (e.g., "Assume ...").
  • Closures (25%): Correctly identify missing pairs or use algorithms.
  • Applications (15%): Relate to real-world scenarios (e.g., databases, networks).
  • Diagrams (10%): Accuracy and clarity in Hasse diagrams.

Quick Revision Checklist

Topic Key Questions to Answer
Relation Properties Can you list all 6 properties (reflexive, irreflexive, symmetric, antisymmetric, transitive, equivalence)?
Closures How would you compute the symmetric closure of ?
Equivalence Given , what are the equivalence classes on ?
Partial Orders Draw the Hasse diagram for on where if divides .
Applications How is the "divides" relation used in computer science?

Based on the TU BSc CSIT syllabus for Discrete Structure (CSC165), unit 10.

Discussion

Loading…