The Wayback Machine - https://web.archive.org/web/20240528204247/https://www.geeksforgeeks.org/discrete-mathematics-representing-relations/
Open In App

Discrete Mathematics | Representing Relations

Last Updated : 13 Dec, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

Prerequisite – Introduction and types of Relations
Relations are represented using ordered pairs, matrix and digraphs:

  1. Ordered Pairs –
    In this set of ordered pairs of x and y are used to represent relation. In this corresponding values of x and y are represented using parenthesis.

    Example: {(1, 1), (2, 4), (3, 9), (4, 16), (5, 25)}
    This represent square of a number which means if x=1 then y = x*x = 1 and so on.
    

  2. Representing using Matrix –
    In this zero-one is used to represent the relationship that exists between two sets. In this if a element is present then it is represented by 1 else it is represented by 0. In this method it is easy to judge if a relation is reflexive, symmetric or transitive just by looking at the matrix.

    Suppose R is a relation from X={x1, x2, .....xn} to Y={y1, y2....yn}
    It is represented by :-
    M[i, j]={1, if (Xi, Yj) belongs to R
            0, if (Xi, Yj) does not belong to R}
    

    If A={1, 2, 3} and B={1, 2} and Relation R is
    R = {(2, 1), (3, 1), (3, 2)}
    then all corresponding value of Relation will be represented by “1” else “0”.

    It is represented as:

    It’s corresponding possible relations are:

  3. Digraph –
    A digraph is known was directed graph. It consists of set ‘V’ of vertices and with the edges ‘E’. Here E is represented by ordered pair of Vertices.
    In the edge (a, b), a is the initial vertex and b is the final vertex.
    If edge is (a, a) then this is regarded as loop.

    Example: Suppose we have relation forming

    R = {(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)} 

    This relation is represented using digraph as:


    Previous Article
    Next Article

Similar Reads

Types of Sets in Discrete Structure or Discrete Mathematics
In this article, we will discuss Types of Sets in Discrete Structure or Discrete Mathematics. Also, we will cover the examples. Let's discuss one by one. Partially Ordered Set or POSET : Partial Ordered Set (POSET) consists of sets with three binary relations as follows. Reflexive Relation -One in which every element maps to itself. Anti-Symmetric
3 min read
Discrete Mathematics | Types of Recurrence Relations - Set 2
Prerequisite - Solving Recurrences, Different types of recurrence relations and their solutions, Practice Set for Recurrence Relations The sequence which is defined by indicating a relation connecting its general term an with an-1, an-2, etc is called a recurrence relation for the sequence. Types of recurrence relations First order Recurrence relat
4 min read
Discrete Mathematics | Hasse Diagrams
A Hasse diagram is a graphical representation of the relation of elements of a partially ordered set (poset) with an implied upward orientation. A point is drawn for each element of the partially ordered set (poset) and joined with the line segment according to the following rules: If p<q in the poset, then the point corresponding to p appears l
4 min read
PDNF and PCNF in Discrete Mathematics
PDNF: It stands for Principal Disjunctive Normal Form. It refers to the Sum of Products, i.e., SOP. For eg. : If P, Q, R are the variables then (P . Q' . R) + (P' . Q . R) + (P . Q . R') is an example of an expression in PDNF. Here '+' i.e. sum is the main operator. You might be confused if there exists any difference between DNF (Disjunctive Norma
2 min read
Four Color Theorem and Kuratowski’s Theorem in Discrete Mathematics
Planar Graph :If a graph can be drawn on the plane without crossing, it is said to be planar.Coloring of a simple graph is the assignment of color to each vertex of the graph so that no two adjacent vertices are assigned the same color. Bi-Partite Graphs : A bipartite graph, also known as a bi-graph, is a set of graph vertices that has been dissect
6 min read
Arguments in Discrete Mathematics
Arguments are an important part of logical reasoning and philosophy. It also plays a vital role in mathematical proofs. In this article, we will throw some light on arguments in logical reasoning. Logical proofs can be proven by mathematical logic. The proof is a valid argument that determines the truth values of mathematical statements. The argume
4 min read
Types of Proofs - Predicate Logic | Discrete Mathematics
Introduction :The most basic form of logic is propositional logic. Propositions, which have no variables, are the only assertions that are considered. Because there are no variables in propositions, they are either always true or always false .Example - P : 2 + 4 = 5. (Always False) is a proposition.Q : y * 0 = 0. (Always true) is a proposition. Th
7 min read
Principal Ideal Domain (P.I.D.) | Discrete Mathematics
Prerequisite : Rings in Discrete Mathematics Introduction :Algebraic Structure : A non-empty set G equipped with 1 or more binary operations is called algebraic structure.Example - (N,+) where N is a set of natural numbers and(R, *) R is a set of real numbers. Here ' * ' specifies a multiplication operation. RING : An algebraic structure that sets
6 min read
Hypergraph & its representation | Discrete Mathematics
Introduction :A hypergraph is a graph in which hyperedges (generalized edges) can connect to a subset of vertices/nodes rather than two vertices/nodes.The edges (also known as hyperedges) of a hypergraph are arbitrary nonempty sets of vertices. A k-hypergraph has all such hyperedges connecting exactly k vertices; a normal graph is thus a 2-hypergra
4 min read
Elementary Matrices | Discrete Mathematics
Prerequisite : Knowledge of Matrices & Identity Matrix Introduction :A matrix is a collection of numbers arranged in a row-by-row and column-by-column arrangement. The elements of a matrix must be enclosed in parenthesis or brackets.Example - The 3 * 3 matrix means a matrix with 3 rows & 3 columns with a total of 9 elements. (3*3 = 9) [capt
3 min read