WoodCentral Forums

Est. 1998 — 27 years of woodworking knowledge

Friday puzzle -- left and right

Posts

Friday puzzle -- left and right

#1

Friday puzzle -- left and right

Alex Y

You are given four letters and four digits in the following position:

ABCD_1234

Your goal is to get to this position:

1234_ABCD

With the following restrictions:

1) Letters can only move to the right, and digits only to the left.

2) The only allowable moves are to an adjacent empty spot (and the space above is only one character wide), or jumping over one character to that empty spot.

Your answer can just be a list of letters and digits in the order moved

Re: Friday puzzle -- left and right

#2

Correction

Alex Y

My second rule was slightly mis-stated:

2) The only allowable moves are to an adjacent empty spot (and the space above is only one character wide), or jumping over one character to that empty spot.

Should say "an empty spot." You can jump the last one in line even if there is another empty spot internal to the list of digits and letters.

Sorry if that caused any confusion.

Re: Friday puzzle -- left and right

#3

Get out those coins!

Alex Y

I'm not sure what to make of the deafening silence on this one. The source I got it from listed this as an easy puzzle, and maybe everyone thought this was too easy to deserve a reply. Or maybe you are like me and found this tricky (in my case, despite having solved it may times in the past).

Anyway, get out four pennies and four nickels, or some checkers, different colored paper clips, etc., and see if having a physical implementation will help. The version I had as a kid was wooden, with 11 "dents" in a row, and five white and five black marbles.

Re: Friday puzzle -- left and right

#4

Re: Correction

Larry Barrett

I did work on this a little over weekend. My usual way is to try a simpler problem to see if there is a pattern that can be extrapolated.

So,

A_1 is trivial

AB_12:

AB1_2

A_1B2

A_12B (is this what you mean by your correction?)

A1_2B

_1A2B

1_A2B

12_AB

Before trying next level, want to make sure I understand the rules.

Re: Friday puzzle -- left and right

#5

Re: Correction

Alex Y

My usual way is to try a simpler problem to see if there is a pattern that can be extrapolated.


An often-helpful problem-solving technique, to which this problem will yield.

So,

A_1 is trivial

AB_12:

AB1_2

A_1B2

A_12B (is this what you mean by your correction?)



No. From A_1B2, the only legal moves are to _A1B2 and A1_B2.

And thinking about the version I had as a kid, my "correction" is unnecessary (not wrong, but probably confusing and possibly leading one astray). Better just to think of nine positions for the four letters and four numerals.

BTW, your first two moves, getting to A_1B2, are correct for the "level 2" puzzle.

Re: Friday puzzle -- left and right

#6

Re: Correction

Larry Barrett

OK

AB_12

AB1-2

A-1B2

-A1B2

1A-B2

1A2B-

1A2-B

1-2AB

12-AB

and for the 3 level

ABC-123

ABC1-23

AB-1C23

A-B1C23

A1B-C23

A1B2C-3

A1B2C3-

A1B2-3C

A1-2B3C

-1A2B3C

1-A2B3C

12A-B3C

12A3B-C

12A3-BC

12-3ABC

123-ABC

Re: Friday puzzle -- left and right

#7

Correct for 3


Re: Friday puzzle -- left and right

#8

Re: Level 4

Larry Barrett

ABCD-1234

ABCD1-234

ABC-1D234

AB-C1D234

AB1C-D234

AB1C2D-34

AB1C2D3-4

AB1C2-3D4

AB1-2C3D4

A-1B2C3D4

-A1B2C3D4

1A-B2C3D4

1A2B-C3D4

1A2B3C-D4

1A2B3C4D-

1A2B3C4-D

1A2B3-4CD

1A2-3B4CD

1-2A3B4CD

12-A3B4CD

123A-B4CD

123A4B-CD

123A4-BCD

123-4ABCD

1234-ABCD

If the above is correct, it is interesting that the solution for level 2 required 9 moves (including the starting position), the solution for level 3 required 16 moves, and the solution for level 4 required 25 moves.

Re: Friday puzzle -- left and right

#9

Correct!

Alex Y

Looks right to me. The obvious mirror image solution starting with D also works.

This becomes easy, even for large numbers of pieces (16 checkers of each color in 33 spaces) if you follow the principle of moving as close as possible to alternating colors (or digits/letters) until you have them completely alternating, then move as many of one type, then the other toward their objective.

Interesting observation of the squares. I wonder if the pattern of moves may help. Just listing the moved pieces, the solutions are:

1) 1A1

2) 1BA12BA2

3) 1CB123CBA123BA3

4) 1DC123DCBA1234DCBA234BA4

It looks like the number moves for n pieces per side is

3 moves of all n pieces at the middle of the solution, = 3n

At each end of the solutions, moves of 1+2+3+...+n-1 = (n-1)*n/2

So middle + 2 ends = 3n+(n-1)*n = n^2+2n = (n+1)^2-1, which when adding in the starting position is the same as your observation.

And I just did it with five alligator clips vs 5 paperclips, and got 36 positions, which I'll count as qed :)

Re: Friday puzzle -- left and right

#10

QED indeed!

Larry Barrett

Very cool. Neat to discover hidden symmetry like this.

👍 This page answered my questions

Your vote helps other woodworkers quickly find the answers and techniques that actually work in the shop.