|
|
|
|
|
The problem: Imagine a row of n DFAs.
The leftmost DFA is the "general", and all of the other DFAs are
"soldiers". Each DFA is adjacent to exactly two others, one on its
right and one on its left, except for the general and the rightmost
soldier who are adjacent to only one other DFA. Initially, all DFAs
start in their initial state. At some arbitrary point in time, the
general is placed in a special state called "fire when ready", and at
some time later, all soldier DFAs must switch into a "fire" state
simultaneously, and this must be the first time that any of them is in
the "fire" state.
Assume that there is a global clock. At each time step, each DFA may change its state. The next state of a DFA may depend only on its own current state and the current state(s) of its neighbors. The DFAs must all have the same program (that is, they are all identical DFAs), except perhaps the general and the rightmost soldier. The number of states allowed should be some constant that DOES NOT DEPEND on n, the number of DFAs in the line. More specifically, your design should consist of the description of a general DFA, a soldier DFA, and a rightmost DFA, such that regardless of the number of soldiers we line up between the general and the rightmost soldier, the squad will still function properly. Be sure to describe in words (no DFA notation necessary) exactly how your solution works, and argue that it does in fact work. For even more fun, program your solution and generate a graphic display of instantaneous "snapshots" showing how the squad operates.
|
|
|
|
To convince all those skeptics out there that I didn't draw the cute bathroom tile pattern on the left using SuperPaint or xpaint, I'm giving you access to a special Web version of the firing squad. Just enter the number of soldiers you would like to see (including the general and the rightie), and check the box for animation, and click Fire When Ready. If you check the Animation box, you'll see a display similar to the one at the top, and if you don't, you'll see the tiles like on the left here. Guess how many soldiers the displays on this page have?
One last note: Though this problem can certainly be solved in fewer than 23 states, this solution is O(n) - specifically, n soldiers will always fire in fewer than 3n ticks. |
Don't see anything on this page? Sorry, your browser doesn't support
tables.
Don't see the animated GIFs? Sorry, your browser doesn't support the
full GIF89a.
Don't know what I'm talking about? Sorry, you must not be in Theocomp
this semester.
This page is entirely the work of Dominic Mazzoni. The picture of Ran
was stolen without his permission from one of his Web pages. All
opinions expressed or implied are not in any way supposed to reflect
the views of Prof. Libeskind-Hadas or any other member of the HMC CS
staff, or of the college. But that's okay, they have their own
opinions and views!