CMIMC 2020 Combinatorics and Computer Science Problem 3

Consider a 1-indexed array that initially contains the integers 1 to 10 in increasing order.

The following action is performed repeatedly (any number of times):

def action( ):

  • Choose an integer \mathrm{n} between 1 and 10 inclusive

  • Reverse the array between indices 1 and \mathrm{n} inclusive

  • Reverse the array between indices \mathrm{n}+1 and 10 inclusive (If \mathrm{n}=10, we do nothing)

How many possible orders can the array have after we are done with this process?