Slashdot Mirror


Solving Feynman's Unsolved Puzzle?

An anonymous reader asks: "In The Feynman Lectures on Computation, Richard Feynman poses an interesting little puzzle involving the synchronization of finite state machines acting as generals and soldiers. While he was able to find an answer to the problem, the minimum time solution apparently eluded him, and he ended his description of the puzzle with the following Fermat-like declaration: 'Somebody has actually found a solution with this minimum time. That is very difficult though, and you should not be so ambitious. It is a nice problem, however, and I often spend time on airplanes trying to figure it out. I haven't cracked it yet.' My best attempt performs at about 3N, not quite the minimum time of 2N-2. So I'm asking Slashdot: Has anyone ever come across the minimum time solution to this puzzle? Or maybe someone here can figure it out!"

"Here is the full description of the problem, in Feynman's own words. Please remember that these are finite state machines, so you can't use any methods that involve counting the number of soldiers or assigning a number to each soldier.

Problem 3.4: Before turning to Turing machines, I will introduce you to a nice FSM problem that you might like to think about. It is called the 'Firing Squad' problem. We have an arbitrarily long line of identical finite state machines that I call 'soldiers'. Let us say there are N of them. At one end of the line is a 'general', another FSM. Here is what happens. The general shouts 'Fire'. The puzzle is to get all of the soldiers to fire simultaneously, in the shortest possible time, subject to the following constraints: firstly, time goes in units; secondly, the state of each FSM at time T+1 can only depend on the state of its next-door neighbors at time T; thirdly, the method you come up with must be independent of N, the number of soldiers. At the beginning, each FSM is quiescent. Then the general spits out a pulse, 'fire', and this acts as an input for the soldier immediately next to him. This soldier reacts as in some way, enters a new state, and this in turn affects the soldier next to him and so on down the line. All the soldiers interact in some way, yack yack yack, and at some point they become synchronized and spit out a pulse representing their 'firing'. (The general, incidentally, does nothing on his own initiative after starting things off.)

There are different ways of doing this, and the time between the general issuing his order and the soldiers firing is usually found to be between 3N and 8N. It is possible to prove that the soldiers cannot fire earlier than T=2N-2 since there would not be enough time for all the required information to move around. Somebody has actually found a solution with this minimum time. That is very difficult though, and you should not be so ambitious. It is a nice problem, however, and I often spend time on airplanes trying to figure it out. I haven't cracked it yet."

3 of 90 comments (clear)

  1. I'm no math wiz by iq+in+binary · · Score: 2, Insightful

    Define a straight line.....

    Seriously, the straight line might just be the solution to that problem.

    That thought just popped up in my head, feel free to flame me for being open.

    --
    Of all the Universal Constants, here's one I know: Nice guys finish last ;)
  2. Re:Conditional logic by dmorin · · Score: 4, Insightful
    You can do conditional logic in FSM's (my statement was a little too broad), you just have to plan it out ahead of time. Base it on what you know. The only communication you have with N-1 or N+1 is the pulse they send you. As far as I know, an FSM isn't even allowed to have a state called "Waiting for pulse" which then turns into a "If pulse is type 1 go here, else go here" node. Instead you have to put yourself into "Waiting for pulse type 2" state, and then when a pulse comes in, you have toa ssume that's what you got. So you have to know ahead of time what state to put yourself in, you can't be surprised by anything.

    This is why this is such a good problem -- because a giant FSM has the overlying assumption that there are no unknowns, but the problem definition seems to have an unknown in N. It's not really unknown once the system is running, though. The problem is just to build the smaller pieces in such a way that when stuck together, they work correctly regardless of what N is. That's different from saying "they work correctly *because* they know what N is, or can otherwise predict it."

  3. Re:A new kind of science by Mr.+Slippery · · Score: 2, Insightful
    Stephen Wolfram's "A New Kind of Science" addresses this puzzle with cellular automata.

    Cellular automata are exactly what this problem is asking about! A CA is a bunch of FSMs hooked together. More precisely, a quick Googling says:

    On a regular lattice (repeated structure of points have the same kind of neighborhood) one puts a finite-state machine at each point. The input to the machine is the states of all machines in its neighborhood. The behaviour is to change its state based in a determined way, as a function of the states of its neighbors and its own state. The states of all machines in the lattice are updated synchronously (simultaneously).
    --
    Tom Swiss | the infamous tms | my blog
    You cannot wash away blood with blood