18.04.2013 Views

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Implementation Challenges<br />

Next: Graph <strong>Algorithm</strong>s Up: Breaking Problems Down Previous: Exercises<br />

Implementation Challenges<br />

1. (*) Many types of products sold appeal more to members of one ethnic group than another.<br />

Perhaps Greeks eat more pasta per capita than Russians do, while Japanese find baseball more<br />

appealing than do Italians. A market researcher might be interested in having a program scan the<br />

names on a mailing list to select the ones most likely to be, say, Greek to target for a given<br />

mailing.<br />

Develop a program that makes reasonable mappings between pairs of first/ last names and<br />

ethnicities. One approach would be to compute the edit distance between query names and a<br />

family of names of known ethnicity. Feel free to experiment with other approaches.<br />

2. (*) In the game of Battleship, the first player hides a collection of, say, three ships on a<br />

grid. <strong>The</strong> second player guesses a series of grid positions and is informed whether they hit<br />

or miss a battleship. <strong>The</strong> second player continues to query until each of the battleship<br />

positions has been probed. While the second player must succeed after making 100 different<br />

probes, we seek a strategy to use as few probes as possible to achieve the goal.<br />

Develop a program that tries to efficiently sink all the battleships. One reasonable algorithmic<br />

approach would be based on divide-and-conquer or binary search.<br />

3. (*) A Caesar shift (see Section ) is a very simple class of ciphers for secret messages.<br />

Unfortunately, they can be broken using statistical properties of English. Develop a program<br />

capable of decrypting Caesar shifts of sufficiently long texts.<br />

<strong>Algorithm</strong>s<br />

Mon Jun 2 23:33:50 EDT 1997<br />

file:///E|/BOOK/BOOK2/NODE58.HTM [19/1/2003 1:37:09]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!