Suppose there are 2n+1 holes and 2 sets of n sticks, one set white and another black.
The sticks are initially organized so that the white sticks are left, there is a hole in the middle and the black sticks are right.
A stick can move by either:
1) being placed on the hole next to it, if empty
2) jump the neighboring stick iff the neighbor stick is of different color and the next hole is empty
Find an algorithm that minimizes the number of movements to switch the sides of all sticks.
Here's some examples I've done - not sure if they're optimal though.
1. 0_1
2. 01_
3. _10
4. 1_0
1. 00_11
2. 0_011
3. 010_1
4. 01_01
5. 0110_
6. 011_0
7. 01_10
8. _1010
9. 1_010
10. 110_0
11. 11_00
1. 000_111
2. 00_0111
3. 0010_11
4. 001_011
5. 00110_1
6. 0011_01
7. 001_101
8. 0_10101
9. 01_0101
10. 0110_01
11. 011010_
12. 01101_0
13. 011_100
14. 01_1100
15. _101100
16. 1_01100
17. 110_100
18. 11_0100
19. 111_000
1. 0000_1111
2. 000_01111
3. 0001_0111
4. 00_100111
5. 001_00111
6. 0010_0111
7. 001010_11
8. 00101_011
9. 001_10011
10. 0011_0011
11. 001_10011
12. 0_1010011
13. 01_010011
14. 0110_0011
15. 01100_011
16. 0110010_1
17. 011001_01
18. 0110_1001
19. 01101_001
20. 011_10001
21. 0111_0001
22. 011_10001
23. 01_110001
24. _10110001
25. 1_0110001
26. 110_10001
27. 11_010001
28. 1110_0001
29. 11100_001
30. 111000_01
31. 11100010_
32. 1110001_0
33. 11100_100
34. 1110_0100
35. 111010_00
36. 11101_000
37. 111_10000
38. 1111_0000
It seems to me this is the Tower of Hanoi disguised, but I'm not really sure how to do the mapping/conversion and write the algorithm. Any ideas?
Assuming this thing isn't the tower of hanoi, would the best approach be to solve it little by litte? ie 0000_1111 -> 0001_0111 -> 0011_0011 -> etc.