Algorithmic Puzzles
Latest Publications


TOTAL DOCUMENTS

4
(FIVE YEARS 0)

H-INDEX

0
(FIVE YEARS 0)

Published By Oxford University Press

9780199740444, 9780197563021

Author(s):  
Anany Levitin ◽  
Maria Levitin

1. A Wolf, a Goat, and a Cabbage A man finds himself on a riverbank with a wolf, a goat, and a head of cabbage. He needs to transport all three to the other side of the river in his boat. However, the boat has room for only the man himself and one other item (either the wolf, the goat, or the cabbage). In his absence, the wolf would eat the goat, and the goat would eat the cabbage. Show how the man can get all these “passengers” to the other side. 2. Glove Selection There are 20 gloves in a drawer: 5 pairs of black gloves, 3 pairs of brown, and 2 pairs of gray. You select the gloves in the dark and can check them only after a selection has been made. What is the smallest number of gloves you need to select to guarantee getting the following? (a) At least one matching pair (b) At least one matching pair of each color 3. Rectangle Dissection Find all values of n > 1 for which one can dissect a rectangle into n right triangles, and outline an algorithm for doing such a dissection. 4. Ferrying Soldiers A detachment of 25 soldiers must cross a wide and deep river with no bridge in sight. They notice two 12-year-old boys playing in a rowboat by the shore. The boat is so tiny, however, that it can only hold two boys or one soldier. How can the soldiers get across the river and leave the boys in joint possession of the boat? How many times does the boat pass from shore to shore in your algorithm? 5. Row and Column Exchanges Can one transform the left table in Figure 2.1 into the right table by exchanging its rows and columns? 6. Predicting a Finger Count A little girl counts from 1 to 1000 using the fingers of her left hand as follows. She starts by calling her thumb 1, the first finger 2, middle finger 3, ring finger 4, and little finger 5.


Author(s):  
Anany Levitin ◽  
Maria Levitin

The purpose of this tutorial is to briefly review a few general strategies for designing algorithms. While these strategies are not all applicable to every puzzle, taken collectively they provide a powerful tool kit. Not surprisingly, these strategies are also used for solving many problems in computer science. Therefore, learning to apply these strategies to puzzles can serve as an excellent introduction to this important field. But before we embark on reviewing major algorithm design strategies, we need to make an important comment on two types of algorithmic puzzles. Every algorithmic puzzle has an input. An input defines an instance of the puzzle. The instance can be either specific (e.g., find a false coin among eight coins with a balance) or general (e.g., find a false coin among n coins with a balance). When dealing with a specific instance of a puzzle, the solver has no obligations beyond solving the instance given. In fact, it might be the case that other instances of the puzzle do not have the same solution or even do not have solutions at all. On the other hand, specific numbers in a puzzle’s statement may be of no significance whatsoever. Then solving the general instance of the puzzle could be not only more satisfying but, on occasion, even easier. But whether a puzzle is presented by a specific instance or given in its most general form, it is almost always a good idea to solve a few small instances of it anyway. On rare occasions the solver might be misled by such investigation, but much more often it can provide useful insights into the puzzle given. Theoretically, many puzzles can be solved by exhaustive search—a problem-solving strategy that simply tries all possible candidate solutions until a solution to the problem is found. Little ingenuity is typically required in applying exhaustive search. Therefore, puzzles are rarely offered to a person (as opposed to a computer) in the expectation that a solution will be found by applying this strategy.


Author(s):  
Anany Levitin ◽  
Maria Levitin

1. A Wolf, a Goat, and a Cabbage With one insignificant exception, the puzzle can be solved by making a sequence of the only moves available in each situation. 2. Glove Selection Imagine a malevolent adversary who wants you to draw as many gloves as possible before getting what you need. Note that gloves are not socks: they can be right-handed and left-handed. 3. Rectangle Dissection Triangles in question need not be of the same size. 4. Ferrying Soldiers Solve the problem of ferrying one soldier first. 5. Row and Column Exchanges The answer is “no”; determine why. 6. Predicting a Finger Count Reenact the girl’s count long enough to see a pattern that makes the answer obvious. 7. Bridge Crossing at Night The answer is “yes,” and the solution does not involve any tricks. 8. Jigsaw Puzzle Assembly A similar problem is discussed in the book’s tutorial on algorithm analysis techniques. 9. Mental Arithmetic There are at least two different ways to compute this sum. Both use the methods discussed in the tutorial on algorithm analysis techniques. 10. A Fake Among Eight Coins “Three” is not the correct answer to the puzzle. 11. A Stack of Fake Coins The answer is “one.” Take advantage of the fact that the scale gives the exact weight. 12. Questionable Tiling The answer is “no.” 13. Blocked Paths Use dynamic programming as explained in the tutorial on algorithm design strategies. 14. Chessboard Reassembly What parts of the board do you have to cut to solve the puzzle? 15. Tromino Tilings Only one of the three questions has a “yes” answer. 16. Making Pancakes What is the fastest way to make three pancakes? Also note that n = 1 is, in fact, a special case here. 17. A King’s Reach The puzzle statement does not forbid the king to visit the same square more than once. Also, make sure that your answer is correct for every value of n ≥ 1. 18. A Corner-to-Corner Journey Observe the colors of the squares the knight jumps through.


Author(s):  
Anany Levitin ◽  
Maria Levitin

Most puzzles do not lend themselves to such simple solutions. This one is a rare exception in that the man has just one meaningful choice on all but the third trip The puzzle can also be solved by using the state-space graph (see [Lev06, Section 6.6]), similar to the solution of the Two Jealous Husbands puzzle in the tutorial on general design strategies. The states of the puzzle can also be represented by vertices of a cube. These alternative representations make it obvious that the seven trips is the fewest possible here. This classic puzzle was included in Alcuin’s collection—the earliest known collection of mathematical problems in Latin—which we already had a chance to mention in the first tutorial. On the appearance of this puzzle in other parts of the world, see [Ash90]. In modern times, it has become a standard feature in puzzle collections. Surprisingly, the puzzle still attracts the attention of mathematicians and computer scientists (see [Cso08]).


Sign in / Sign up

Export Citation Format

Share Document