MathorynMathematical Formula Database

Set Theory & Logic

Number of Binary Relations on a Set

A binary relation on AA is any subset of A×AA\times A, so there are 2n22^{n^2} of them; fixing all nn diagonal pairs leaves 2n2−n2^{n^2-n} reflexive relations. These counts are used in discrete mathematics to show how fast the number of relations grows.

#{R⊆A×A}=2n2,#{reflexive}=2n2−n(∣A∣=n)\#\{R\subseteq A\times A\}=2^{n^2},\qquad \#\{\text{reflexive}\}=2^{n^2-n}\quad(|A|=n)
LaTeX\#\{R\subseteq A\times A\}=2^{n^2},\qquad \#\{\text{reflexive}\}=2^{n^2-n}\quad(|A|=n)

Variables

nn
number of elements of A
A×AA\times A
set of ordered pairs

Example

How many relations and reflexive relations are there on a 33-element set?

  1. ∣A×A∣=9|A\times A|=9, so 29=5122^9=512 relations.
  2. Reflexive: 29−3=262^{9-3}=2^6.

Answer: 512512 relations, 6464 reflexive.

Related formulas