Would I be able to use mathematics to prove properties that would help me solve this series of puzzles?

260 Views Asked by At

I realise that this may be a little different from most of the questions you get on math.stackexchange, so for that I apologize. I also apologize if there's no "one right answer" given the way I've phrased this question.

There's a puzzle in the video game Final Fantasy XIII-2 that is colloquially known as the "Hands of Time" puzzle. It's reasonably easy to solve it algorithmically. Right now I try to "think ahead" and that works well on small puzzles but really falls apart on big ones. I'm wondering if there's a way to describe a number of its properties and give concrete advice to a player so they'd be able to quickly and easily solve a given puzzle without resorting to doing the algorithm in their head. In addition, this is something of a mental exercise for me because I'm neither a mathematician (in high school and University I tolerated it but I've never enjoyed it) nor an algorithms person and I'm curious to observe how others reason about puzzles like this one.

Anyway, here's the puzzle.

You have a list of $N$ numbers that are arranged in a circle. When you "activate" a number at position $n \in N$ (let's call that number $g$ since it's basically an array at position $n$), the "two hands of the clock" (minute hand and hour hand) first point to position $n$ but then "spread out" such that they independently point at position $n-g$ and $n+g$, then the number $g$ disappears (if you go above N or below 1 you would wrap around the list, such that $-1$ actually points to $N$, $-2$ points to $N-2$, and so forth). This means that if you're given a number $n = \frac{N}{2}$ and $N$ is even, the hands both point to the opposite size of the clock. It's customary to have the values $g$ be $g \leq \frac{N}{2}$. If both numbers at $g$ at position $n-g$ and $g$ at position $n+g$ are already activated then you lose. The goal of the puzzle is to activate every number in the list $N$.

An example may look like this:

  2
3   2
1   1
  2

You're given free reign to select the starting position. If you select the "2" at the 12 o'clock position, the 2 at the 12 o'clock position disappears and the hands then point 2 away at the 1 and the 1. Then you would select the "left" 1, it would disappear, and the hands would point at 3 and 2; you would select 3 and the hands would point at the opposite 1. You select that 1 (only space you can go to) and the hands would go to the 2 at 6 o'clock and on the upper-right. Selecting either of these 2s ensures that you can select the other one, and you would solve the puzzle. If I gave the positions IDs starting at the top going clockwise, it would be 1-2-3-4-5-6 and the solution to this puzzle would be 1-5-6-3-6-2.

There's an online puzzle creator (and solver) and a related Gaming.Stackexchange discussion. If you look up "Hands of Time Final Fantasy XIII-2" you will get some pictures of what the clock looks like in-game.

1

There are 1 best solutions below

0
On

If I understand the puzzle correctly, you're describing a directed graph or digraph and are searching for an algorithm to find a Hamiltonian path. It is easy to find lots of general references to that like this example: https://stackoverflow.com/questions/1987183/randomized-algorithm-for-finding-hamiltonian-path-in-a-directed-graph

That's hard in the general case, but it provides a general framework for thinking about it. Now realize you have a special case where every node points to exactly two other nodes (though they may be the same node in the special case of n=N/2). That might allow some much more elegant solution. I'll come back and edit if I think of one. Since what you asked for was a way to describe the properties, I thought it might be valuable to write in even without an elegant solution.