Number of possible inequalities for $n$ variables. Let's say there are two variables $x$ and $y$. Here are the possible inequalities:
(i) $x&lt;y$ 
(ii) $x&gt;y$ 
(iii) $x=y$ 
So, there are $3$ possible inequalities. But let's say there are $n$ variables $x_1,x_2,x_3,x_4,\cdots,x_n$. How many possible distinct inequalities are there?
I assume this problem requires combinatorics , but I am not sure how to apply them in this problem.
Edit: Maybe this problem can be related with coin arranging (point me if I am wrong)
First of all , we can arrange coins (where order matters).But ,we will also allow for the coins to stack on top of each other.In the stacks (There can be multiple stacks) , order doesn't matter.Stacks will be represented with parenthesis.
For $1$ coin , there is $1$ way to arrange them.

$1$ $[x_1]$

For $2$ coins , there are $3$ ways to arrange them.

$12$ $[x_1 &lt; x_2]$
$21$ $[x_1 &gt; x_2]$
$(12)$ $[x_1 = x_2]$

For $3$ coins , there are $13$ ways to arrange them.

$123$ $[x_1 &lt; x_2,x_2 &lt; x_3,x_3 &gt; x_1]$
$132$ $[x_1 &lt; x_2,x_2 &gt; x_3,x_3 &gt; x_1]$
$213$ $[x_1 &gt; x_2,x_2 &lt; x_3,x_3 &gt; x_1]$
$231$ $[x_1 &gt; x_2,x_2 &lt; x_3,x_3 &lt; x_1]$
$312$ $[x_1 &lt; x_2,x_2 &gt; x_3,x_3 &lt; x_1]$
$321$ $[x_1 &gt; x_2,x_2 &gt; x_3,x_3 &lt; x_1]$
$(12)3$ $[x_1 = x_2,x_2 &lt; x_3,x_3 &gt; x_1]$
$3(12)$ $[x_1 = x_2,x_2 &gt; x_3,x_3 &lt; x_1]$
$1(23)$ $[x_1 &lt; x_2,x_2 = x_3,x_3 &gt; x_1]$
$(23)1$ $[x_1 &gt; x_2,x_2 = x_3,x_3 &lt; x_1]$
$2(13)$ $[x_1 &gt; x_2,x_2 &lt; x_3,x_3 = x_1]$
$(13)2$ $[x_1 &lt; x_2,x_2 &gt; x_3,x_3 = x_1]$
$(123)$ $[x_1 = x_2,x_2 = x_3,x_3 = x_1]$

I thought of thinking of stacks as variables that are equal.And a variable being left/right to another variable corresponding to a varialbe less than/ greater than another variable.So my thought is..
number of ways to arrange $n$ coins = number of distinct inequalities for $n$ variables.(Hope this helps)
As Mike Earnest commented, these are ordered Bell numbers or Fubini numbers, and OEIS A000670 shows many ways to calculate them, though not a closed form.
My preference would be with a recursion, letting $f(n,k)$ be the number of orderings of $n$ variables involving $k$ distinct values. When you introduce the $n$th variable, you can

either introduce it to an ordering of $n-1$ variables with $k$ distinct values by matching it to one of the existing distinct values

or introduce it to an ordering of $n-1$ variables with $k-1$ distinct values by matching it to one of the $k$ gaps between, before or after the existing distinct values


So $$f(n,k)=k\big(f(n-1,k) + f(n-1,k-1)\big)$$
and you can start with $f(1,1)=1$ and $f(1,k)=0$ for $k\not=1$, or from $f(0,0)=1$ and $f(0,k)=0$ for $k\not=0$.
You then get a table like this
$$\begin{matrix}
 &amp; k&amp; 0&amp; 1&amp; 2&amp; 3&amp; 4&amp; 5&amp; 6&amp; 7&amp; 8&amp; &amp; \text{Sum}\\
n&amp; &amp; &amp; &amp; &amp; &amp; &amp; &amp; &amp; &amp; &amp; &amp; \\
0&amp; &amp; 1&amp; 0&amp; 0&amp; 0&amp; 0&amp; 0&amp; 0&amp; 0&amp; 0&amp; &amp; 0\\
1&amp; &amp; 0&amp; 1&amp; 0&amp; 0&amp; 0&amp; 0&amp; 0&amp; 0&amp; 0&amp; &amp; 1\\
2&amp; &amp; 0&amp; 1&amp; 2&amp; 0&amp; 0&amp; 0&amp; 0&amp; 0&amp; 0&amp; &amp; 3\\
3&amp; &amp; 0&amp; 1&amp; 6&amp; 6&amp; 0&amp; 0&amp; 0&amp; 0&amp; 0&amp; &amp; 13\\
4&amp; &amp; 0&amp; 1&amp; 14&amp; 36&amp; 24&amp; 0&amp; 0&amp; 0&amp; 0&amp; &amp; 75\\
5&amp; &amp; 0&amp; 1&amp; 30&amp; 150&amp; 240&amp; 120&amp; 0&amp; 0&amp; 0&amp; &amp; 541\\
6&amp; &amp; 0&amp; 1&amp; 62&amp; 540&amp; 1560&amp; 1800&amp; 720&amp; 0&amp; 0&amp; &amp; 4683\\
7&amp; &amp; 0&amp; 1&amp; 126&amp; 1806&amp; 8400&amp; 16800&amp; 15120&amp; 5040&amp; 0&amp; &amp; 47293\\
8&amp; &amp; 0&amp; 1&amp; 254&amp; 5796&amp; 40824&amp; 126000&amp; 191520&amp; 141120&amp; 40320&amp; &amp; 545835\\
\end{matrix}$$
with the final column giving the result you want
To make an inequality, you need two of the variables and one of three operators, so $n (n-1) 3.$ Notice that the order of the variables matters, so you do not divide by two.