Notation or theory on functions which reorder sequences

81 Views Asked by At

I wanted to come up with a simple way of reordering the elements in some sequence $a=\left[ a_{0}, a_{1} \cdots a_{n} \right]$ in a specific way. My solution was to have a sequence of integers $b=\left[ b_{0}, b_{1} \cdots b_{n} \right]$ of the same length as $a$ such that for some index $i$, $0 \le b_{i} \le n - i$

For example: $$ a = \left[ 1, 2, 3, 4 \right] \\ b = \left[ 3, 0, 1, 0 \right] $$

$b$ would be applied as a function to $a$ creating a new sequence $c$. The process for constructing $b(a)=c$ would be as follows:

  1. $c = []$
  2. Remove element $a \left[ b \left[ 0 \right] \right]$ from sequence $a$ and append to $c$
  3. For the next index $i$, remove element $a \left[ b \left[ i \right] \right]$ from the remaining sequence $a$ and append to $c$
  4. Repeat #3 until $a$ has no remaining elements

So with the example sequences $a$ and $b$ above,

$$ c = \left[ 4, 1, 3, 2 \right] $$

I call these functions mixers, for obvious reasons. I've been playing with this for a few days and come up with ideas on inverse mixers and composition of mixers. My question is whether there exists some standard mathematical notation and theory for such a function on sequences.