challenges - Rose

advertisement
Challenge 1: The Tower of Hanoi
The tower of Hanoi is an old puzzle. Here’s the setup: You have three stacks, one with some items in ascending order.
Your goal is to move all the objects to the right peg. Here are the rules:
At no time may a larger object lie on top of a smaller object.
You may only move one object at a time.
Here is the solution for four disks: (read from left to right.
->
->
->
->
->
->
->
->
->
->
->
->
On the table are five items. Following the game rules, move the stack from the left spot to the right spot, counting the
number of moves taken.
How many moves did it take?
Challenge 2: Sorting lots of items.
On the table are 100 cards, each one with a number. Your goal is to sort them.
Briefly describe the approach you will take to sort the cards.
Measure the time it takes to sort the cards. How long did it take?
Did you take advantage of having multiple people? If so, how? If not, how could you have used teamwork to sort?
Challenge 3. Sorting by different keys.
There is a deck of cards available to you. First, describe how you would sort it by suit. (The number on the card isn’t
important, I just want it so all the diamonds appear first, then the clubs, then the hearts, then the spades.)
Measure the time it takes to do this sort.
Now, do the same thing, this time sorting by number, and not suit. (All the aces first, then the twos, then the threes,
etc.)
Measure the time it takes to do this sort.
Challenge 4. Fake Pennies.
A villain has infiltrated the United States treasury! The villain walked out with two hundred million dollars, and the
government is looking in to this theft. (Fortunately, it was Zimbabwe dollars.)
The villain also left a puzzle. He grabbed a handful of pennies and placed them in a jar. He also put a fake penny in the
jar. Investigators are pretty sure the fake penny weighs less than the real ones. A high-technology currency counter has
determined that there were 48 pennies in the jar, but it isn’t sure which one is the fake.
The ruffian also broke all of the treasury’s high-precision balances, and all you’re left with is the pan balance on the
table.
Using the balance, determine which penny is the fake one. Here’s a stupid approach to find the fake:
Choose a penny. Place that one in the right pan. Never touch the right pan again.
Now, one-by-one, check every penny against the one in the right pan, by placing it in the left pan. If the left pan
is heavier than the right, you know the first penny is the fake. If the left pan is lighter, then the penny in the left
is the fake.
For forty-eight pennies in the jar, this method would take 47 weighings.
Can you do it in 24 weighings?
Can you do it in five? (the answer is yes, please explain how.)
What would be an appropriate punishment for the villain? (“Listening to Charles talk” is NOT going to get you very much
credit!)
Challenge 5: Caller ID.
You have been called by someone with the number 812-379-0069. They left their name as “Steve B.” You have NO idea
who that is. Using the provided phone book, find out what Steve B’s last name is. (I’ve given you the B section of the
book.)
Describe the algorithm you used to find this information.
Challenge 6. Find my professor!
One of my favorite professors here is Ed Mottel. Find his phone number.
Describe the algorithm you used to find this information.
Challenge 7: Old problems.
Here are two age-old problems. The first is the wolf-sheep-cabbage problem, dating back to the ninth century:
Once upon a time a farmer went to market and purchased a wolf, a sheep, and a cabbage. On his way home, the farmer
came to the bank of a river and hired a boat. But in crossing the river by boat, the farmer could carry only himself and a
single one of his purchases - the wolf, the sheep, or the cabbage.
If left alone, the wolf would eat the sheep, and the sheep would eat the cabbage.
The farmer's challenge was to carry himself and his purchases to the far bank of the river, leaving each purchase intact.
How did he do it?
There are cards on the table to help you visualize the scenario.
The second one is a tricky logic puzzle. It’s also two thousand years old!
You stand at a fork in the road. Next to each of the two forks, there stands a guard. You know the following things: 1.
One path leads to Paradise, the other to Death. From where you stand, you cannot distinguish between the two paths.
Worse, once you start down a path, you cannot turn back. 2. One of the two guards always tells the truth. The other
guard always lies. Unfortunately, it is impossible for you to distinguish between the two guards.
You have permission to ask one guard one question to ascertain which path leads to Paradise. Remember that you do
not know which guard you're asking -- the truth-teller or the liar -- and that this single question determines whether you
live or die. The question is: What one question asked of one guard guarantees that you are led onto the path to
Paradise, regardless of which guard you happen to ask?
Challenge 8. Queens!
Consider a chess board with a queen on it.
The queen can move left, right, up, down,
and diagonally. The dots on the board in
figure 1 show every space the queen can
reach. Interestingly, for any chessboard
larger than 4x4, we can fit one queen on
every row, and have none of the queens be
able to attack each other. For example,
figure 3 has four queens on a chessboard,
none able to attack any other. Figure 2 has
eight queens who cannot attack each other.
Figure 1. One queen
.
Figure 2 Eight queens
Using the grid below, place five queens in the 5x5 chess board so that no two queens can
attack each other. To get you started, note that there can be only one queen in each row. (If
there were two, they would attack each other.) If you finish the 5x5, try the 6x6.
Figure 3 Four queens
Download