Finding all posets on a set

Solution 1:

Counting the possible partial orders on $\{1,\dots,n\}$ is a very hard task. For $n\le 4$ you can do it by hand, but it’s pretty tedious, and I don’t know of any really nice way to approach the task. For instance, for $n=3$ you get the following five Hasse diagrams:

   o  
   |  
   o              o   o               o                 o  
   |               \ /               / \                |  
   o                o               o   o               o   o         o  o  o  
  (a)              (b)               (c)                 (d)            (e)

The numbers $1,2$, and $3$ can be entered into (a) in $3!=6$ distinguishable ways. In (b) there are $3$ ways to choose the minimum element, and that’s it: the two diagrams below represent the same partial order.

         2   3              3   2  
          \ /                \ /  
           1                  1

Similarly, there are $3$ ways to choose the top element in (c), and the order of the other two elements in the picture doesn’t affect the partial order represented by the picture. In diagram (d) there are $3$ ways to choose the element that’s not comparable to the other two elements, and there are then $2$ ways to order those two elements, so there are $3\cdot2=6$ partial orders on $\{1,2,3\}$ represented by (d). Finally, (e) represents only one partial order, the relation of equality on $\{1,2,3\}$. That’s a total of $6+3+3+6+1=19$ partial orders on the set $\{1,2,3\}$.

There are $16$ unlabelled Hasse diagrams on four elements; it would probably be worth your while to try to find them. All of them except

     o   o   o   o

give rise to more than one partial order on $\{1,2,3,4\}$, some of them as many as $4!=24$; the total number of partial orders on $\{1,2,3,4\}$ turns out to be $219$.

Solution 2:

This is the integer sequence A001035: for n=18 the number you are looking for is 241939392597201176602897820148085023. The problem has been quite extensively studied: see a detailed discussion on the A001035 link above.

Solution 3:

I don't know any way to count them, otheer than to systematically list them. For $\{{a,b,c\}}$, you can have

  1. no pair related: just one way to do that,

  2. $a\lt b$, with $c$ incomparable: 3 ways to choose the small element, 2 ways to choose the large, 6 orders all told,

  3. a linear order, like $a\lt b\lt c$: 6 orders like this, from the 6 permutations of 3 objects,

  4. one element larger than the other two, those two being incomparable: 3 orders like this, from the 3 ways to choose the big element, and

  5. one element smaller than the other two, those two being incomparable: 3 orders like this, from the 3 ways to choose the small element.

All told, that's $1+6+6+3+3=19$.

There may be more information in the link at the URL I gave in my comment.