Reinforcement Learning and Artificial Intelligence (RLAI)

# CMPUT 325: Assignment 2

Due: Thursday, 28 September, 2006 by 23:59:59.

Specs:
Do exercises 1.11, 1.14, 1.31a, 1.34, 1.35, 1.40, 1.42 from Structure and Interpretation of Computer Programs (second edition).

Submission Instructions:
Write all your answers in a plain text file named a2.  From the directory where this file is located, type in the following command:
`astep -c c325 -p ex2 a2`
When prompted if this is your primary submission, answer Y.  You may submit as many times as you like; the last version you submit will be marked.  All submissions should be primary submissions, not just the last.

Rules, Guidelines and Suggestions:
• For exercise 1.14, a general term (e.g. linear, cubic) is sufficient to answer the questions on growth
• The code you write for exercises 1.31a, 1.40 and 1.42 will be tested electronically.  To ensure we can test your code, please do the following:
• For 1.31a, you should define the functions product (which takes four parameters as defined for sum), factorial (which takes one parameter, the number to find the factorial of), and pi/4 (which takes one parameter, the number of terms to multiply, and returns the estimate of the value of pi/4)
• For 1.40 you should define the function cubic which takes three parameters as defined in the question
• For 1.42 you should define the function mycompose (not compose) which takes two parameters as defined in the question
• You may write whatever additional functions you need
• For the proof in exercise 1.35, notice that this question is not worth too many marks.  If your proof is taking many steps, consider using a different identity concerning the golden ratio.  Also, do not just compute the value of the function at phi
• Use functional programming in this and all assignments from Chapters 1 and 2.  To be on the safe side:
• use only functions that have been mentioned in the book prior to the exercise being worked on
• never use mutating operators, such as (re)assignment of variables.  Define is ok
• For questions which require procedures to be written, hand in syntactically correct Scheme code (which hopefully is also algorithmically correct)
• We will be marking for style on some questions.  Code which is cleanly written, and which performs the given task well will receive a higher mark than solutions which are poorer in terms of structure and algorithm. Put closing parenthesis on the same line as the thing they enclose, not on a new line by themselves. No orphan parenthesis!
• Be certain you are using the correct edition of the text.  Not all exercises are similar between the first and second editions of the text.  Ditto for the online version
Test Cases:
Test Case file updated at 1255 Tuesday September 26.  Make sure you have the most recent copy, especially when testing the function pi/4.

Maysam has generously donated a collection of test cases, for you to use in drscheme.  Save the linked file to disk, and open it in drscheme to see the tests.  Make sure that these test cases are not included in the file you submit for marks.

Mark Breakdown:

 Question Marks 1.11 6 1.14 4 1.31a 5 1.34 2 1.35 4 1.40 3 1.42 3 Total 27 Cumulative Total 53

Back to CMPUT 325 Homepage