Number of relations

Let set A: A={  1,  2  }A = \{\ \ 1, \ \ 2\ \ \}

Powerset of A: P(A)={  ,  {1},  {2},  {1,2}  }P(A) = \{\ \ \varnothing,\ \ \{1\},\ \ \{2\},\ \ \{1,2 \}\ \ \}

Cartesian product of the set AA: A×A={  (1,1),  (1,2),  (2,1),  (2,2)  }A\times A = \{ \ \ (1,1),\ \ (1,2),\ \ (2,1),\ \ (2,2)\ \ \}

Enumerated powerset of the Cartesian product of the set AA i.e. P(A×A)=P(A2)\mathcal{P}(A\times A) = \mathcal{P}(A^2) is given below. There are 16 elements in this powerset i.e. there are 16 possible relations:

  • 1 possible way to choose no pairs (0-place): (40)4\choose 0

  • 4 possible ways to choose 1 pair (1-place): (41)4\choose 1

  • 6 possible ways to choose 2 pairs (2-place): (42)4\choose 2

  • 4 possible ways to choose 3 pairs (3-place): (43)4\choose 3

  • 1 possible way to choose all pairs (n-place): (44)4\choose 4

The formula to choose k-places out of n elements:

(nk)=n!k!(nk)!{n \choose k} = {\frac{n!}{k!(n-k)!}}

Enumerated powerset of the Cartesian product of the set AA:

P(  {  (1,1),  (1,2),  (2,1),  (2,2)  }  )={R1:,R2:{(1,1)},R3:{(1,2)},R4:{(2,1)},R5:{(2,2)},R6:{(1,1),(1,2)},R7:{(1,1),(2,1)},R8:{(1,1),(2,2)},R9:{(1,2),(2,1)},R10:{(1,2),(2,2)},R11:{(2,1),(2,2)},R12:{(1,1),(1,2),(2,1)},R13:{(1,1),(1,2),(2,2)},R14:{(1,1),(2,1),(2,2)},R15:{(1,2),(2,1),(2,2)},R16:{(1,1),(1,2),(2,1),(2,2)}}{\\ \mathcal{P}(\ \ \{\ \ (1,1),\ \ (1,2),\ \ (2,1),\ \ (2,2)\ \ \}\ \ ) = \\ \Huge\{\\ R_1: \varnothing, \\ R_2: \{(1,1)\}, \\ R_3: \{(1,2)\}, \\ R_4: \{(2,1)\}, \\ R_5: \{(2,2)\}, \\ R_6: \{(1,1), (1,2)\}, \\ R_7: \{(1,1), (2,1)\}, \\ R_8: \{(1,1), (2,2)\}, \\ R_9: \{(1,2), (2,1)\}, \\ R_{10}: \{(1,2), (2,2)\}, \\ R_{11}: \{(2,1), (2,2)\}, \\ R_{12}: \{(1,1), (1,2), (2,1)\}, \\ R_{13}: \{(1,1), (1,2), (2,2)\}, \\ R_{14}: \{(1,1), (2,1), (2,2)\}, \\ R_{15}: \{(1,2), (2,1), (2,2)\}, \\ R_{16}: \{(1,1), (1,2), (2,1), (2,2)\} \\ \Huge\} \\}

Relations:

  • null (1): R1R_1

  • identity (1): R8R_8

  • universal (1): R16R_{16}

  • reflaxive (4): R1,R8,R13,R16R_1, R_8, R_{13}, R_{16}

  • irreflexive (4): R1,R3,R4,R9R_1, R_3, R_4, R_9

  • symmetric (8): R1,R2,R5,R8,R9,R12,R15,R16R_1, R_2, R_5, R_8, R_9, R_{12}, R_{15}, R_{16}

  • anti-symmetric (12): R1R8,R10,R11,R13,R14R_1-R_8, R_{10}, R_{11}, R_{13}, R_{14}

  • asymmetric (5): R1R5R_1-R_5

  • transitive (13): only R9R_9 and R15R_{15} are not transitive

Summary:

  • The number of distinct binary relations on an n-element set is 2(n2)2^{(n^2)}

  • The number of reflexive and irreflexive relations is the same.

  • The number of strict partial orders (irreflexive transitive relations) is the same as that of partial orders.

  • the number of equivalence relations is the number of partitions, which is the Bell number.

Ordered pair (1,2)={{1},{1,2}}(1,2) = \{\{1\},\{1,2\}\}

Powerset of A: P(A)P(A)

={,{1},{2},{1,2}}= \{\varnothing, \{1\}, \{2\}, \{1,2\}\}

={,{1},{2},{1,2},{2,1}}= \{\varnothing, \{1\}, \{2\}, \{1,2\}, \{2,1\}\}

={,{1},{1,2},{2},{2,1}}= \{\varnothing, \{1\},\{1,2\}, \{2\},\{2,1\}\}

={,(1,2),(2,1)}= \{\varnothing, (1,2), (2,1) \}

Ordered pair (x,y)={{x},{x,y}}(x,y) = \{\{x\},\{x,y\}\}

if x=yx=y then (a,a)(a,a)

={{a},{a,a}}=\{\{a\},\{a,a\}\}

={{a},{a}}=\{\{a\},\{a\}\}

={{a}}=\{\{a\}\}

Sets

  • A set is an unordered collection of distinct objects (that share some common property) considered as an object in its own right.

  • defined intensionaly (semantically): "A set of odd positive ints"

  • defined extensionaly (enumeration): {a,b,c}\{a,b,c\}

  • denoted with a capital letter: A={a,b,c}A=\{a,b,c\}, elements with lowercase

  • If aa is an element of set BB then: aBa\in B, if not aBa\notin B

  • Order or repetition unimportant: {{a},b,}={b,{a},{},b,,{}}\{\{a\},b,\varnothing\}=\{b, \{a\},\{\},b,\varnothing,\{\}\}

  • A set can contain other sets, xA,AMx \in A, A \in \mathscr{M}, so xAx\in A but xMx \notin \mathscr{M}.

  • Two sets are equal if they contain the same elements.

Types

  • An empty set contains no elements: ={}\varnothing = \{\}

  • A set, {a,b}\{a,b\}, is distinguished from the ordered pair, (a,b)(a,b)

  • nn-element set is different from ordered nn-tuple: {x1,x2,,xn}(x1,,xn)\{x_1, x_2,\dots,x_n\} \neq (x_1,\dots, x_n)

  • Two ordered pairs are equal iff: (a,b)=(x,y)    a=xb=y(a,b) = (x,y) \iff a=x \land b = y

  • The order of the elements or their repetition is of no consequence to sets, {a,b,{}}={b,{},b,,a}\{a,b,\{\}\}=\{b,\{\},b,\varnothing,a\}.

  • {}={{}}\{\varnothing\}=\{\{\}\}

Subset and powerset

  • if all elements of a set AA are also elements of a set BB, then AA is a subset of BB: ABA \subseteq B and BB is a superset of AA: BAB \supseteq A.

  • a set BB is equal to AA if the two sets consist of exactly the same elements: A=B    ABBAA = B \iff A \subseteq B \land B \subseteq A.

  • if ABA \subseteq B but BAB \neq A then AA is a proper subset of BB: ABA \subset B.

  • if a set PP contains all possible subsets of a set AA, then PP is a powerset of AA, denoted as P(A)P(A).

  • e.g. if A={a,b}A=\{a,b\}, then P={{a},{b},{ab},{}}P=\{\{a\},\{b\},\{ab\},\{\varnothing\}\}

  • here, the cardinality (number of elements) of PP is 4, denoted as P=4|P|=4

Properties of sets: A,B,C\forall A,B,C

  • AAA \subseteq A (reflexivity)

  • ABBCACA \subseteq B \land B \subseteq C \rightarrow A \subseteq C (transitivity)

  • ABBAA=BA \subseteq B \land B \subseteq A \rightarrow A=B (anti-symmetry, axiom of extensionality)

  • A\varnothing \subseteq A

  • AA=A\subseteq \varnothing \rightarrow A=\varnothing

Last updated