Talk:Topswops

From Rosetta Code

Speed?

Should I change the limits and ask for an output table for n in 1..8 instead? The idea is not to solicit heavily speed optimised solutions but to show an accurate solution in idiomatic code. --Paddy3118 22:48, 22 November 2012 (UTC)

I would be surprised if there was not a better algorithm than the straightforward translation of the rounding process. So I think it's fine to let n from 1 to 10 in order to give an incentive to find a good algorithm.--Grondilu 23:16, 22 November 2012 (UTC)

Repitition?

I assume you're not allowed to repeat configurations? Otherwise you could swap infinitely for any initial setup that didn't start with 1. --Mwn3d 20:26, 23 November 2012 (UTC)

I think I read that for all starting permutations you either start at or end up with one on top. There was no mention of it not terminating. There is a variant where you only count a perm if it ends up sorted when the one is on top. (It doesn't always). --Paddy3118 23:28, 23 November 2012 (UTC)
There's no need to worry about that. It's easy to prove that the swapping process always terminates with 1 at the front, which is the same as saying the configurations will never repeat. --Ledrug 00:22, 24 November 2012 (UTC)