I have to create two algorithms (but I think it is more of a combinatorics question).
Let there be list of permutations on elements $\{1,2,...,k\}, k \in N$ and this list is alphabetically ordered (meaning that e.q. permutations with $\pi(1) = 10$ is in this list before $\pi(1) = 2$).
1) Find position of specified permutation in that list - e.g. input is (1, 2, 4, 3, 5) and find position, it would give 3
2) Find what permutation lies in that list on specified position - e.g. input is 3 and I should find what permutation is on third line, that can be something like (1, 2, 4, 3, 5)
I tried to approach this as counting permutations that can be before specified one, but it seems quite complicated since $k$ can be huge number... at least for me as a combinatorics newbie.
Is there maybe some approximation that would give me some decent starting point from which I'd be able to start checking permutations manually and not having exponential time complexity?
Thanks a lot!