Hi all,

By participating in the Euler project I saw this beautiful
and interesting, but difficult (that is to say for me) programming
language J (I program most of the Euler problems in Haskell).

So, digging in the J-forum archives I saw this nice little problem.
I'm not a expert in math or programming (just an enthusiastic homo ludens).

It took me a while before I was able to understand the working of the
program.
But it was a nice experience in both J and a bit of group theory.

So, this said, may be I'm allowed to put some remarks to the 1d-rubik.
(with the possibility of saying nothing new to you people, ;-))

Roger Hui wrote:
> The following provides a sequence but not necesarily
> the shortest sequence. I note that some
> permutations have no solution (are not in the
> subgroup generated by p).
It looks to me that the subgroup is the alternating group of the
permutation group,
meaning they are even permutations. By saying this, one can ask 'are the
odd permutation
arrangements of the puzzle unsolvable?' I tried several and they always
fail,
and .... I'm not able to proof this ;-)
>
> p=: 3 2 1 0 4 5, 0 4 3 2 1 5,:0 1 5 4 3 2
>
> tab=: 3 : 0
> 'p q'=. y
> p=. p , ,/ {"1/~ p
> q=. q , , ,&.>/~ q
> b=. ~: p
> (b#p) ; < b#q
> )
>
> 'P Q'=: tab^:_ p;<,&.>0 1 2
>
> solve0=: Q {::~ P i. ]
> solve =: solve0 @: <:
>
I'm also very interested if it's possible to compose a intelligent solver
(may be based on group theory knowledge).
> solve 1 3 2 6 5 4
> 1 2 1
> solve 5 6 2 1 4 3
> 0 2
> solve 6 5 4 1 2 3
> 0 1 2
>

greetings

@@i = Arie



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to