Skip to main content
1 of 4

Maximum distance within a subset of permutations

I'm modelling a scheduler that accepts a sequence of requests and outputs a sequence of responses, one response per request. It can partially reorder requests, but only within a finite queue. Specifically, I have a queue with maximum size q. The numbers 1 through N are fed into the queue in order. When the queue reaches its maximum size, the scheduler removes an item from the queue and outputs it. When the end of input is reached, the scheduler removes and outputs items from the queue, one at a time. The choice of which item to remove from the queue is completely up to the scheduler. Therefore, the output is a permutation of the input, however, not all permutations are possible. For example, if the queue size is only 2, it would be impossible to output the numbers 1 through N in reverse order. I'll call the set of possible permutations P.

I have two permutations x and y that are elements of P. I want to compare them by looking at the inversion count of $xy^{-1}$. (I don't know if $xy^{-1}$ is an element of P.) What is the maximum possible value of this inversion count? Is there literature available on this topic?