|
One way to compare algorithms is to play the "Guess My Rule" game. Here's how it goes:
| Someone makes up a mystery algorithm (like "take a number, double it, and add 2 to the answer"). He or she writes it down or draws a picture of it (with machines, for example) and keeps it secret. |
| The algorithm writer then takes "requests." Other people suggest inputs and request outputs. Everyone records the results. |
| Other people try to guess the algorithm with as few requests as possible. If someone says, "I've got it," that person writes down his or her guess of the algorithm, either in words or pictures. |
| If the guess is the same as the mystery algorithm, the round is over. If (as often happens) the guessed algorithm looks different from the mystery algorithm, the guessers have to either prove that they will always produce the same result, or they must find an input where the algorithms produce different outputs. For example, a match for "take a number, double it, and add 2" might be "take a number, add 1, and double the answer." |
Note 3
In the following Interactive Activity, the computer will make up several mystery algorithms, and you can try to guess them!
This activity requires the Flash plug-in, which you can download for free from Macromedia's Web site. If you prefer, you can try the low-tech version of this activity described above with some colleagues.
|