You have three cards in front of you labeled in some order 1, 2 and 3, and three card-sized bins labeled with a letter that signifies Left, Middle and Right, in the order shown. The cards, all of which remain face up, have been placed at random in one or more bins, in such a way that, if any cards are stacked, only the top card is visible. And, if only two cards are visible, one cannot tell which bin holds the hidden card.
+-----+ +-----+ +-----+
| | | | | |
+---| L |---| M |---| R |---+ | | | | | | | |
| +-----+ +-----+ +-----+ |
+---------------------------------+ You are to devise an algorithm that ends with all cards in the L bin with 1 on top and 3 on the bottom, in a bounded number of moves. Each move in the algorithm consists of taking a single card from the top of one pile and placing it on the top of another (possibly empty) pile. An independent observer will keep track of things and will signal completion.
Your algorithm, on the other hand, may not keep track of things. Each move it makes must take its cues only from the visible information at each point in the process. Specifically, a move cannot depend on any invisible cards, its previous move or the number of moves it has made. Further, it must be able to begin from a random starting point. A move might take the form "If a 2 is visible, move it one bin to the right." In that case, the 2 card would move to L if it happened to start in R. In that sense, the configuration functons as ring, with "move to the right" meaning CW, and "move to the left" meaning CCW.
To restate: For any configuration with one, two or three visible cards, distributed in any order in L, M and R, your algorithm must specify the next move to make. And since your algorithm can't distinguish an L stack of 1 2 3 from 1 3 2, it will be told when it has (successfully) completed.
Question
bonanova
You have three cards in front of you labeled in some order 1, 2 and 3, and three card-sized bins labeled with a letter that signifies Left, Middle and Right, in the order shown. The cards, all of which remain face up, have been placed at random in one or more bins, in such a way that, if any cards are stacked, only the top card is visible. And, if only two cards are visible, one cannot tell which bin holds the hidden card.
+-----+ +-----+ +-----+
| | | | | |
+---| L |---| M |---| R |---+
| | | | | | | |
| +-----+ +-----+ +-----+ |
+---------------------------------+
You are to devise an algorithm that ends with all cards in the L bin with 1 on top and 3 on the bottom, in a bounded number of moves. Each move in the algorithm consists of taking a single card from the top of one pile and placing it on the top of another (possibly empty) pile. An independent observer will keep track of things and will signal completion.
Your algorithm, on the other hand, may not keep track of things. Each move it makes must take its cues only from the visible information at each point in the process. Specifically, a move cannot depend on any invisible cards, its previous move or the number of moves it has made. Further, it must be able to begin from a random starting point. A move might take the form "If a 2 is visible, move it one bin to the right." In that case, the 2 card would move to L if it happened to start in R. In that sense, the configuration functons as ring, with "move to the right" meaning CW, and "move to the left" meaning CCW.
To restate: For any configuration with one, two or three visible cards, distributed in any order in L, M and R, your algorithm must specify the next move to make. And since your algorithm can't distinguish an L stack of 1 2 3 from 1 3 2, it will be told when it has (successfully) completed.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.