Let me list the game and then I will pose my question.
A game called finding Ace is described as follows. Given a pack of 13 cards of the same suit picked from a shuffled deck, we are going to find the Ace in the following way. Let the left most end be the top. If the card on the top is 1 (i.e., Ace), then the game is over. Otherwise, check the number on the top card, say n, then remove the first n cards from the pack and put them back in the reverse order. Repeat the process until Ace surfaces to the top.
D7 D13 D10 D4 D5 D1 D6 D2 D12 D11 D9 D3 D8
D6 D1 D5 D4 D10 D13 D7 D2 D12 D11 D9 D3 D8
D13 D10 D4 D5 D1 D6 D7 D2 D12 D11 D9 D3 D8
D8 D3 D9 D11 D12 D2 D7 D6 D1 D5 D4 D10 D13
D6 D7 D2 D12 D11 D9 D3 D8 D1 D5 D4 D10 D13
D9 D11 D12 D2 D7 D6 D3 D8 D1 D5 D4 D10 D13
D1 D8 D3 D6 D7 D2 D12 D11 D9 D5 D4 D10 D13
Reverse 6 times.
My question: What is the absolute maximum number of reverses it would take to move the ace to the top?
I wrote a program that would play this game and then ran it a billion times to see the results.
The highest number of reverses the program found was 79.
I am going to edit my code to list the original arrangement of the game that takes the most reverses, I just have not gotten around to it. Maybe that will give a clue as to if there is an arrangement that would take more reverses than 79.
I know this may not be the actual maximum because there are over 6 billion arrangements possible, while I have checked less than a billion.
Hopefully someone has a simple solution to compute the most reverses needed.