This is a computer science, using lisp language. Use dr.racket to open the file!
In the game 20 questions, there are two players. The first player (the answerer) thinks of an object. Then the second player (the questioner) asks a series of yes-no questions, and the answerer answers each of them. After the questioner thinks that she has asked enough questions, she guesses the identity of the object that the answerer had in mind.
We can model this scenario using a binary tree. Here is such a tree from a second-year computer science class:
The nodes at the bottom of the tree (the leaves) represent guesses to the identity of the object. The other nodes correspond to questions. The left child of a question node describes what the questioner will do if the answerer responds yes to the question; the right child describes the response to a no answer. In general, a tree of questions-and-answers is called a decision tree.
Problem 2 – Starter
Suppose you have a roster for players on two opposing tennis teams, and each roster is ordered by team rank, with the best player listed first. When both teams play, the best players of each team play one another, and the second-best players play one another, and so on down the line. When one team has more players than the other, the lowest ranking players on the larger team do not play.
Design a function that takes two lists of players and produces a list of matches, according to the approach described above.
Problem 3 – Starter
The starter contains the data definitions that represent a family tree, as well as a completed design of a function that tries to find the age of a given name in the family tree. Use local expressions to improve the function. Be prepared to tell the TA which of three uses of local to improve a function you are using.