If $n$ is an integer, how many permutations are less than, equal to and greater than $n$?
For example if $n=24335$, $43325\gt n$, $23345\lt n$, etc...
If $n$ is an integer, how many permutations are less than, equal to and greater than $n$?
For example if $n=24335$, $43325\gt n$, $23345\lt n$, etc...
Interesting puzzle. You could figure it out recursively:
At some point you have 1 digit left which has only one permutation (equal).
This is basically just a restatement of your problem rather than a solution, but maybe it will help lead to something greater...
Let $L(n), E(n), G(n)$ be the number of permutations less than, equal to, or greater than $n$, respectively. Suppose the digits of $n$ are $d_1 d_2 \ldots d_m$ (in the usual order, most significant at the left).
I'll start with the case where all the digits are distinct. Then $E(n) = 1$. A permutation $d_1' d_2' \ldots d_m' < d_1 d_2 \ldots d_m$ iff for some $k = 1 \ldots m-1$, $d_i' = d_i$ for all $i < k$ while $d_k' < d_k$. Let $R_k$ be the number of $i > k$ with $d_i < d_k$. Then the number of permutations with $d_i' = d_i$ for all $i < k$ and $d_k' < d_k$ is $R(k)(m-k)!$, so that $L(n) = \sum_{k=1}^{m-1} R_k (m-k)!$, and $G(n) = m! - 1 - L(n)$. So for example with $n = 231$, $R_1 = 1$, $R_2 = 1$, and $L(231) = 1 \times 2! + 1 \times 1! = 3$.
EDIT: Mistake deleted.