The value of each element in the result should be the sum of all elements in the original list up to and including that element. So, the first element in the output list is 1 = 1, the second is 1 + 2 = 3, the third is 1 + 2 + 3 = 6, the fourth is 1 + 2 + 3 + 4 = 10, and the fifth is 1 + 2 + 3 + 4 + 5 = 15.

Sorry for the confusion on this. You will receive full credit for this question if your answer either solves the problem as corrected here, or produces the same outputs as the example shown in the original exam.

Exam 2 is available now: [PDF]. Exam 2 is due at the beginning of class on Wednesday, 30 November.

If you prefer to type your answers for Exam 2 (which can include cut-and-pasting from your editor), you may use this Word template: [DOCX]. If you use the template, make sure you do not lose your formatting (including indenting) when you past into the boxes, and do not break the pagination of the exam. Please print the exam using single-sided printing.

Here’s the video on the philosophy of computability from today’s class:

The comments are also available, but I strongly recommend trying the problems on your own before reading the comments: [PDF].

If you can do well on the practice exam, you should be able to do well on your exam.

The Assistant Coaches will hold two review sessions for Exam 2:

Wednesday, 7:30pm (Rice 442)

Thursday, 6:30pm (Rice 442)

As before, there will be two review sessions scheduled to make it easier for everyone to be able to attend at least one of them. The prepared material for both will be similar, but the actual content will depend on your questions.