Transitive Relation: Definition, Count on Small Sets, Properties and Worked Examples

Learn how to test a relation for transitivity, complete its transitive closure, use graph and matrix checks, and count every valid case on a two-element set.

KnowledgeGate Team

Exam prep & CS education

Updated 22 Nov 20265 min read
Transitive Relation: Definition, Count on Small Sets, Properties and Worked Examples

Transitivity is easy to recite but surprisingly easy to test incompletely. It is a condition on every composable pair of arrows, so a relation may look reasonable while one missing shortcut makes it fail. Every composable pair of arrows must have its shortcut; transitive closure, digraphs, and Boolean matrices express and test this requirement, while pair choices on a two-element labelled set can be checked exhaustively. If the notation feels unfamiliar, first review set theory and relations.

Define a transitive relation and read the quantifiers correctly

Let R is a subset of A x A be a binary relation. The relation R is transitive when, for every x,y,z in A, the statements (x,y) in R and (y,z) in R together imply (x,z) in R. In arrow form, x -> y -> z requires the shortcut x -> z. Equivalently, R composed with R is a subset of R. Unlike reflexivity, which inspects individual diagonal pairs, transitivity must compose pairs whose middle values match.

The variables need not be distinct. If both (a,b) and (b,a) belong to R, then the chains a -> b -> a and b -> a -> b require (a,a) and (b,b).

Transitivity can also hold vacuously. For R={(1,2)} on {1,2,3}, no pair ends where another begins, so there is no missing shortcut. This relation is transitive, but not reflexive or symmetric. Transitive does not automatically mean antisymmetric or an equivalence relation either.

Find every missing shortcut in one worked relation

Take A={1,2,3,4} and

R_0={(1,2),(2,3),(3,4)}.

The first failure is immediate: (1,2) and (2,3) are present, but (1,3) is absent. Similarly, (2,3) followed by (3,4) requires (2,4).

Build the transitive closure in rounds:

  1. Round 1 adds (1,3) and (2,4).

  2. The new pairs expose length-three reachability. Either (1,3) with (3,4), or (1,2) with (2,4), requires (1,4).

Therefore,

R^+={(1,2),(2,3),(3,4),(1,3),(2,4),(1,4)}.

Now verify completion. Reach(1)={2,3,4}, Reach(2)={3,4}, Reach(3)={4}, and Reach(4)={}. Every reachable endpoint already has a direct ordered pair in R^+, so it is transitive. No loop is forced because the digraph has no directed return path.

Two-panel directed graph showing a relation on A = {1,2,3,4} and its transitive closure, with arrows 1->3, 2->4, and 1->4 added.

Test the same relation with a digraph or Boolean matrix

Order the rows and columns as 1,2,3,4. The adjacency matrix of R^+ is

Code
0 1 1 1
0 0 1 1
0 0 0 1
0 0 0 0

A 1 in cell (i,j) means that (i,j) belongs to the relation. Under Boolean multiplication, its square is

Code
0 0 1 1
0 0 0 1
0 0 0 0
0 0 0 0

Every 1 in M^2 is already a 1 in M. Thus M^2 <= M entry by entry, which proves transitivity. By contrast, the Boolean square of the matrix for R_0 contains 1 at (1,3) and (2,4), where its original matrix contains 0. One mismatch disproves transitivity. The graph test and matrix test are simply two ways to express the same length-two-path rule.

Count transitive relations on a small labelled set

A set of size n has n^2 possible ordered pairs, so it has 2^{n^2} binary relations in total. Transitivity couples those pair choices. Therefore, 2^{n^2} is not the number of transitive relations, and there is no independent-choice exponent for the required subset.

Work completely on B={a,b}. Write the four possible pairs as aa=(a,a), ab=(a,b), ba=(b,a), and bb=(b,b). There are 2^4=16 relations. Exactly three fail:

  • {ab,ba}

  • {aa,ab,ba}

  • {ab,ba,bb}

In each case, ab and ba create both return chains, but at least one required loop is absent. Hence the number of transitive relations is

16-3=13.

Two checks support the count. If both loops are fixed as present, all four choices of including or excluding ab and ba are transitive. If both loops are absent, exactly three relations are transitive: {}, {ab}, and {ba}. For labelled sets, the counts are 2 for n=1, 13 for n=2, and 171 for n=3. These are specific counts, not values of 2^{n^2}.

A 4-by-4 grid of 16 subsets of {aa,ab,ba,bb} shows 13 transitive cells and red exceptions {ab,ba}, {aa,ab,ba}, and {ab,ba,bb}.

Know which operations preserve transitivity

Intersection preserves transitivity. If transitive relations R and S both contain (x,y) and (y,z), each must contain (x,z). Their intersection therefore contains it too. The same proof works for the intersection of any family of transitive relations.

Inverse also preserves transitivity. For example,

T={(1,2),(2,3),(1,3)}

has inverse T^{-1}={(2,1),(3,2),(3,1)}. The reversed chain 3 -> 2 -> 1 includes its required shortcut 3 -> 1.

Union is not preserved in general. On {1,2,3}, R={(1,2)} and S={(2,3)} are each transitive vacuously, but R union S lacks (1,3). Arbitrary changes are unsafe too. Adding (2,3) to R creates that missing shortcut, while deleting (1,3) from T breaks the chain 1 -> 2 -> 3.

Transitivity questions: pair lists, closure additions and preservation claims

For a pair-list check, consider U={(1,1),(1,2),(2,2)}. Its composable cases are (1,1) followed by (1,1), which reproduces (1,1); (1,1) followed by (1,2), which requires (1,2); (1,2) followed by (2,2), which also requires (1,2); and (2,2) followed by itself. Every result is present, so U is transitive.

For a minimum-addition question on R_0, the answer is {(1,3),(2,4),(1,4)}. Adding only the first two is insufficient because 1 -> 4 remains a path without a direct arrow. For the two-element counting form, the answer is 13, not 16 or 4.

For a property statement, remember that intersection and inverse preserve transitivity, while union need not. These are common exam-style formats, so use discrete mathematics set theory and relations MCQs to practise the decision process rather than memorising isolated answers.

Transitivity traps: distinct variables, one-pass closure and two-way pairs

Do not inspect only pairs printed next to one another. Match every second coordinate with every first coordinate. Also, never assume x,y,z must be distinct.

After adding immediate shortcuts, recheck the relation because those additions may create longer chains. A two-way pair is another warning: a -> b and b -> a force both loops. In {ab,ba}, checking only a -> b -> a finds the missing aa, but b -> a -> b also finds the missing bb.

Use the quickest valid rejection when possible. In R_0, (1,2) and (2,3) already disprove transitivity because (1,3) is missing. In counting questions, treat 2^{n^2} only as the total number of binary relations, not the final transitive count.

Transitivity checklist: compose, add the shortcut, then recheck

Match the middle element, demand the shortcut, and repeat until no new pair is forced. For a matrix, check M^2 <= M under Boolean multiplication. Keep 13 as the worked count for a two-element labelled set, not a general formula. For a broader CS foundation, explore Zero to Hero. To organise GATE preparation, use GATE Guidance by Sanchit Sir, or browse the current GATE course options.