Exercise #3

Let's say that the birth disparity between two authors is the absolute value of the difference between their years of birth, the death disparity is the absolute value of the difference between their years of death, and the chronological disparity is the sum of the birth disparity and the death disparity.

Given the name, year of birth, and year of death of an author A, one can search a database (like the one presented in exercise #2) for A's closest contemporary -- the author B, listed in the database, who has the smallest chronological disparity from B. For instance, using the list-of-authors database, the closest contemporary of Francis Bacon (1561-1626) is William Shakespeare (1564-1616), because the chronological disparity between them is only 13 and no author listed in the database has a lower chronological disparity from Bacon.

The assignment is to design, write, and test a Scheme procedure named closest-contemporary that takes the three-element list containing an author's surname, year of birth, and year of death, searches the list-of-authors database, and returns the string that gives the surname of the author's closest contemporary:

> (closest-contemporary '("Bacon" 1561 1626))
"Shakespeare"

Use your closest-contemporary procedure to find the closest contemporary of each of the following authors -- yes, you guessed it --

  1. Pierre-Augustin Caron de Beaumarchais (1732-1799)
  2. James Gould Cozzens (1903-1978)
  3. George Farquhar (1678-1707)
  4. André Maurois (1885-1976)
  5. William of Malmesbury (1090-1143)
  6. Frank Zappa (1940-1993)

This document is available on the World Wide Web as

http://www.math.grin.edu/courses/Scheme/fall-1997/exercise-3.html

created September 5, 1997
last revised September 5, 1997

John David Stone (stone@math.grin.edu)