Group Project Programming and Optimization; What I Did and a Bonus Problem
This assignment has two parts, worth 90% and 60% of the grade,
respectively---Yes, that is 150%---the bonus problem is worth 50%
extra credit, equivalent to 10 points in the midterm. Printed/written
copies of both parts are due in class on Tuesday Nov. 13. Each group
should hand in one copy for Part I, and each person should hand in
individually Part II.
Part I. Group Project Programming and Optimization.
Each group is asked to build a complete system by completing the
coding task and to write a report about the coding task and the code.
Your report should include all information that you think is
important, including but not restricted to the following:
Part II. What I did and a Bonus Problem.
1. Describe what you did for the course this week, as in
Part III of Homework 1.
2. Will be given here after tomorrow's lecture. ... Here it
is (given on 11/06/01)
Sequence local average problem: given a sequence of numbers, say in
a[0]..a[n-1]
, and a window width k
, we want
to compute, for each index, say called i
, ranging from
0
to n-k
, the average of the k
numbers from i
forward. The following program computes
this.
input a[0..n-1];
input k;
declare s;
declare ave[0..n-k];
for i := 0 to n-k do {
s := 0;
for j := i to i+k-1 do
s := s+a[j];
ave[i] := s/k;
}
output ave[0..n-k];
This problem has many applications, for example, in computing, say,
50-day stock average. It is also used often in sampling data
sequences in general.
How many arithmetic operations does this program do? How would you
make it computer faster? How many arithmetic operations does your
optimized program do?
A Bonus Problem.
As in the Bonus part of Homework 1.