Computing the transitive relations on a set

33 Views Asked by At

I have a project for my algebra seminar and I have no idea how can I make it. I would be very happy if someone would give me some tips.

Input: non-zero natural number n

• Output:

  1. the number of transitive relations on a set A = {a_1, . . . , an}
  2. the transitive relations on a set A = {a_1, . . . , an} (for n ≤ 4)

Example for n=2:

  1. the number of transitive relations on a set A = {a_1, a_2} is 13
  2. the transitive relations on a set A = {a_1, a_2} are:

R_1 = ∅, R_2 = {(a_1, a_1)}, R_3 = {(a_1, a_2)}, R_4 = {(a_2, a_1)},

R_5 = {(a_2, a_2)}, R_6 = {(a_1, a_1),(a_1, a_2)}, R_7 = {(a_1, a_1),(a_2, a_1)},

R_8 = {(a_1, a_1),(a_2, a_2)}, R_9 = {(a_1, a_2),(a_2, a_2)}, R_10 = {(a_2, a_1),(a_2, a_2)},

R_11 = {(a_1, a_1),(a_2, a_2),(a_1, a_2)}, R_12 = {(a_1, a_1),(a_2, a_2),(a_2, a_1)},

R_13 = {(a_1, a_1),(a_1, a_2),(a_2, a_1),(a_2, a_2)}.

I know C++ and Python.