Does Ball Sort Puzzle always have a solution?

Partial solution: Even for $n = 12$ and $2$ empty stacks, the game is not solvable for this initial configuration:

a a a a b b b b c c c c
d e f g g h i j j k l d
i i k k l l e e f f h h
. . . . . . . . . . . .

This diagram uses $4$ balls of colors a, b, c, spread across the top layers, and $2$ or $3$ balls of colors d, e, f, g, h, i, j, k, l. Each . represents a "don't care" -- i.e. they can be filled arbitrarily with the remaining balls of colors d through l.

The key observation is that the first four moves might as well be all of the same (top) color:

  • The first move, without loss of generality, might be a to an empty stack $E_1$.

  • Every future move involving an a must be either to $E_1$ or the other empty stack $E_2$, because every a started at the top and it is impossible to put another a on top of it.

  • Moving another a to $E_1$ cannot possibly hurt, since nothing else can go onto $E_1$, and the a in $E_1$ cannot go anywhere else (except $E_2$, which doesn't improve the game state).

  • Therefore, the first four moves might as well move all four a's onto $E_1$.

Moving all the a's exposed four new balls, but by construction, they are all different colors defg, and, if you move any of them into $E_2$, this exposes yet another new color i or k and the game is at a dead-end (thanks to @JaapScherphuis for pointing this out). The same is true if the first four moves moved all four b's or all four c's. So for the next four moves, we might as well move all four balls of another top color. Another four balls will be exposed. However after these eight moves:

  • If we moved all a's and b's, the only common color exposed is g. This is the only legal move left, and whichever g you move, it will expose yet a new color (k or l) and the game is at a dead-end.

  • If we moved all a's and c's, the only common color exposed is d, and moving either d will expose a new color (h or i) and the game is at a dead-end.

  • If we moved all b's and c's, the only common color exposed is j, and moving either j will expose a new color (e or f) and the game is at a dead-end.

Further thoughts: I wonder if, by similar logic, for any number of empty stacks $m$ (above discusses $m=2$), there exists large enough $n$ s.t. some starting configurations will be unsolvable. All we need is $n$ so large that no matter which $m$ top colors your choose to move first, the $4m$ balls your exposed at layer $3$ have very few common colors, and after making those moves, the newly exposed balls at layer $2$ are all new.

Tags:

Puzzle