4 ms·
As the author notes, these numbers are upper bounds for a fixed trivial strategy. That makes me wonder, which permutations (for each size) are the most difficul
by LegionMammal978 2y ago
As the author notes, these numbers are upper bounds for a fixed trivial strategy. That makes me wonder, which permutations (for each size) are the most difficult to achieve using an optimal strategy? How might we solve such a problem short of brute force?
- zxz910 2y agoA variant of bubble sort I think would work. Taking into consideration the 'rotating index', each operation would correctly order three cards within the rotating index. In each N pass, we should see each element at least 3 times, and it must advance toward it's desired position at least once. since it can't be at the 'wrong' end of the triple multiple times. Worst case in N^2 ops we should be done.
- klyrs 2y agoI've worked out a few such puzzles involving permutations and the answer always seems to be either "one vexatious ordering" or "half of all permutations"