Collating the Coins
My Best Mathematical and Logic Puzzles
Lay out five coins in a row, alternating three pennies (P) and two dimes (D): P D P D P. The goal is to reorder them, in as few moves as possible, so the three pennies sit together on the left and the two dimes together on the right: P P P D D.
[Figure: two rows of five touching coins, each row drawn along a faint dashed horizontal guide line. Top row, left to right: penny, dime, penny, dime, penny. Bottom row: three pennies followed by two dimes.]
A move works like this: pick two touching coins, one of which must be a penny and the other a dime, and slide the pair, as a unit, to a different spot along the guide line. The two must remain in contact throughout, and their left-right order must be preserved (whichever coin was on the left stays on the left). Gaps in the row are allowed between moves, but the final arrangement must be a gap-free row. It needn’t sit at the same place on the line as the start.
Without the penny-plus-dime restriction it would be easy (three moves by shifting same-kind pairs); with it, the puzzle is much harder.