Assignment 1 Feedback

Here are some general statistics and feedback for Assignment 1:

The average score was 92%. Good work!

Question 1

Almost all of you got full marks here. Those who did not -- check your code carefully and don't be so careless next time!

Question 2

Since I went over this in class and released the algorithm, I expected you guys to do well. The most common mistake was: for some reason some of you thought that the first term was "1", the second term was "4/1", the third term was "4/3", etc. Not too sure why you would think that, since "1" was not in the description at all.

Question 3

This question posed the most problems for people. Many of you apparently misunderstood the question. The idea is this:

The algorithm should therefore be:

  1. Ask the user for the value of x and n.
  2. Set the result (let's call it guess) to be equals to x/2.
  3. For i starting from 2 and continuing through n:
    1. Calculate the value of the ith version of guess and use it to update guess: guess = (guess + x/guess)/2.
  4. Print out the final value of guess

Other problems: