Unit01Exercises Student
Unit01Exercises Student
Each week, exercises will have some activities that can be done in groups. This week’s ac-
tivity will introduce you to the process. We’ll use a simple game to explore basic searching
algorithms.
3. Play the game a few times to ensure that everyone understands the rules.
4. Identify 4–5 different guessing strategies that Player B could use. Each strategy should
describe a different approach to the game. For example: Start at 1, and count up until the correct
answer is found. In computer science, we call such strategies algorithms. Try to have a mixture
of simple and clever algorithms, including ones that young children could use.
a)
b)
c)
d)
e)
5. Rank order the algorithms with regard to how fast they will find the right answer. Write 1
for the fastest algorithm (fewest guesses) and 5 for the slowest one (most guesses).
6. Rank order the algorithms with regard to how easy they are to describe or specify. (Suppose
you had to explain them to a first-grader so that he/she could play the game.) Write 1 for the
algorithm that is easiest to describe and 5 for the one that is hardest.
In computing, we often must search for a particular item in a set. Computer scientists are particularly
interested in searching very large sets, with thousands or millions of values. For example, the Harvard
University Library has roughly 16,000,000 volumes, and the US Library of Congress has roughly 22
million cataloged books and over 100,000,000 total items.
Exercise: Algorithms
Complete the following Chapter Review Problems (not in the textbook).
1. Euclidean algorithm. Euclid wrote one of the first known algorithms around 300 BC, and
it’s still in use today! Refer to Figure 0.2 (on Page 3) of the textbook to find the GCD of the
following numbers. Use the provided tables to show the values of M, N, and R after each step.
There may be more rows than needed. Circle or * the final answer in each table.
21 and 34 34 and 55
M N R M N R
3. Name that chapter. Use the Table of Contents and Section 0.3 to match the topics on the right
with their corresponding chapters on the left. Each chapter is referenced only one time.
1. Data Storage how algorithms are represented and discovered
9. Database Systems 1’s and 0’s, logic gates, and digital circuits