Prerequisite – Introduction and types of Relations

Relations are represented using ordered pairs, matrix and digraphs:

**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.

**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:

**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:

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

## Recommended Posts:

- Mathematics | Closure of Relations and Equivalence Relations
- Discrete Mathematics | Types of Recurrence Relations - Set 2
- Mathematics | Introduction and types of Relations
- Mathematics | Representations of Matrices and Graphs in Relations
- Discrete Mathematics | Hasse Diagrams
- PDNF and PCNF in Discrete Mathematics
- Last Minute Notes – Discrete Mathematics
- Practice Set for Recurrence Relations
- Different types of recurrence relations and their solutions
- Number of possible Equivalence Relations on a finite set
- Minimum relations satisfying First Normal Form (1NF)
- Finding the candidate keys for Sub relations using Functional Dependencies
- Discrete Maths | Generating Functions-Introduction and Prerequisites
- Last Minute Notes - Engineering Mathematics
- Mathematics | Set Operations (Set theory)
- Mathematics | The Pigeonhole Principle
- Mathematics | Matrix Introduction
- Mathematics | Introduction to Propositional Logic | Set 1
- Mathematics | Propositional Equivalences
- Mathematics | Predicates and Quantifiers | Set 1

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.